go-cyber/x/liquidity/abci.go

package liquidity

import (
	"time"

	"github.com/cosmos/cosmos-sdk/telemetry"
	sdk "github.com/cosmos/cosmos-sdk/types"

	"github.com/cybercongress/go-cyber/v7/x/liquidity/keeper"
	"github.com/cybercongress/go-cyber/v7/x/liquidity/types"
)

// In the Begin blocker of the liquidity module,
// Reinitialize batch messages that were not executed in the previous batch and delete batch messages that were executed or ready to delete.
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) {
	defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)
	k.DeleteAndInitPoolBatches(ctx)
}

// In case of deposit, withdraw, and swap msgs, unlike other normal tx msgs,
// collect them in the liquidity pool batch and perform an execution once at the endblock to calculate and use the universal price.
func EndBlocker(ctx sdk.Context, k keeper.Keeper) {
	defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
	k.ExecutePoolBatches(ctx)
}

Synonyms

space-pussy/x/bandwidth/abci.go
go-cyber/x/cyberbank/abci.go
go-cyber/x/rank/abci.go
space-pussy/x/graph/abci.go
go-cyber/x/dmn/abci.go
space-pussy/x/cyberbank/abci.go
space-pussy/x/rank/abci.go
space-pussy/x/dmn/abci.go
go-cyber/x/clock/abci.go
go-cyber/x/bandwidth/abci.go
go-cyber/x/graph/abci.go

Neighbours