keeper

package
v0.0.0-...-baf6593 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TempTVLPlacerholder is a placeholder value for TVL.
	// TODO(CORE-836): Remove this after `GetBaseline` is fully implemented.
	TempTVLPlacerholder = big.NewInt(20_000_000_000_000)
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	authorities []string,
) *Keeper

func (Keeper) GetBaseline

func (k Keeper) GetBaseline(
	ctx sdk.Context,
	denom string,
	limiter types.Limiter,
) *big.Int

GetBaseline returns the current capacity baseline for the given limiter. `baseline` formula:

baseline = max(baseline_minimum, baseline_tvl_ppm * current_tvl)

func (Keeper) GetDenomCapacity

func (k Keeper) GetDenomCapacity(
	ctx sdk.Context,
	denom string,
) (val types.DenomCapacity)

GetDenomCapacity returns `DenomCapacity` for the given denom.

func (Keeper) GetLimitParams

func (k Keeper) GetLimitParams(
	ctx sdk.Context,
	denom string,
) (val types.LimitParams)

GetLimitParams returns `LimitParams` for the given denom.

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) InitializeForGenesis

func (k Keeper) InitializeForGenesis(ctx sdk.Context)

func (Keeper) ListLimitParams

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) ProcessDeposit

func (k Keeper) ProcessDeposit(
	ctx sdk.Context,
	denom string,
	amount *big.Int,
)

ProcessDeposit processes a inbound IBC transfer, by updating the capacity lists for the denom.

func (Keeper) ProcessWithdrawal

func (k Keeper) ProcessWithdrawal(
	ctx sdk.Context,
	denom string,
	amount *big.Int,
) error

ProcessWithdrawal processes an outbound IBC transfer, by updating the capacity lists for the denom.

func (Keeper) SetDenomCapacity

func (k Keeper) SetDenomCapacity(
	ctx sdk.Context,
	denomCapacity types.DenomCapacity,
)

SetDenomCapacity sets `DenomCapacity` for the given denom.

func (Keeper) SetLimitParams

func (k Keeper) SetLimitParams(
	ctx sdk.Context,
	limitParams types.LimitParams,
)

SetLimitParams sets `LimitParams` for the given denom. Also overwrites the existing `DenomCapacity` object for the denom with a default `capacity_list` of the same length as the `limiters` list. Each `capacity` is initialized to the current baseline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL