📚Common Types

The common types are the data structures that are used across the MANTRA DEX contracts.

StructDescriptionContains

Epoch

The epoch definition

  • id: u64 - Epoch identifier

  • start_time: Timestamp - Epoch start time

EpochConfig

The epoch configuration

  • duration: Uint64 - The duration of an epoch in nanoseconds.

  • genesis_epoch: Uint64 - Timestamp for the first epoch, in nanoseconds.

EpochResponse

The response for the current epoch query

  • epoch: Epoch - The epoch queried.

EpochChangedHookMsg

The hook msg for epoch changed

  • current_epoch: Epoch - The current epoch.

Fee

The definition of the fee, used on the pool and farm managers

  • share: Decimal - the fee.

PoolFee

Represents the fee structure for transactions within a pool

  • protocol_fee: Fee - Fee percentage charged on each transaction for the protocol's benefit.

  • swap_fee: Fee - Fee percentage allocated to liquidity providers on each swap.

  • burn_fee: Fee - Fee percentage that is burned on each transaction. Burning a portion of the transaction fee helps in reducing the overall token supply.

  • extra_fees: Vec<Fee> - A list of custom, additional fees that can be defined for specific use cases or additional functionalities.

FarmParams

Parameters for creating farm

  • lp_denom: String - The LP asset denom to create the farm for.

  • start_epoch: Option<u64> - The epoch at which the farm will start. If unspecified, it will start at the current epoch.

  • preliminary_end_epoch: Option<u64> - The epoch at which the farm should preliminarily end (if it's not expanded).

  • curve: Option<Curve> - The type of distribution curve. If unspecified, the distribution will be linear.

  • farm_asset: Coin - The asset to be distributed in this farm.

  • farm_identifier: Option<String> - If set, it will be used to identify the farm.

Farm

The definition of an farm

  • identifier: String - The ID of the farm.

  • owner: Addr - The account which opened the farm and can manage it.

  • lp_denom: String - The LP asset denom to create the farm for.

  • farm_asset: Coin - The asset the farm to be distributed.

  • claimed_amount: Uint128 - The amount of the farm_asset that has been claimed so far.

  • emission_rate: Uint128 - The amount of the farm_asset that is to be distributed every epoch.

  • curve: Curve - The type of curve the farm has.

  • start_epoch: u64 - The epoch at which the farm starts.

  • preliminary_end_epoch: u64 - The epoch at which the farm will preliminary end (in case it's not expanded).

  • last_epoch_claimed: u64 - The last epoch this farm was claimed.

Position

Represents an LP position on the farm manager

  • identifier: String - The identifier of the position.

  • lp_asset: Coin - The amount of LP tokens that are put up to earn farm rewards.

  • unlocking_duration: u64 - Represents the amount of time in seconds the user must wait after unlocking for the LP tokens to be released.

  • open: bool - If true, the position is open. If false, the position is closed.

  • expiring_at: Option<u64> - The block height at which the position, after being closed, can be withdrawn.

  • receiver: Addr - The owner of the position.

StableSwapParams

Params for the stable swap, used when changing the amplification factor

  • initial_amp: String - Initial amplification factor

  • future_amp: String - Future amplification factor, i.e. target

  • initial_amp_block: String - Block height when the initial amplification factor kicks in.

  • future_amp_block: String - Block height when the future amplification factor will be set.

EnumsDescriptionAlternatives

FarmsBy

Enum to filter farms by identifier, lp denom or the farm asset. Used in the Farms query.

  • Identifier(String)

  • LPDenom(String)

  • >

  • FarmAsset(String)

FarmAction

Actions to manage an farm

  • Fill { params: FarmParams } - Fills a farm

  • Close { farm_identifier: String }

  • >

  • FarmAsset(String) - Closes a farm

Curve

Dictates how the farms rewards are released

  • Linear - A linear curve that releases assets uniformly over time.

RewardsResponse

Rewards response used for calculating or querying farm rewards

  • RewardsResponse { rewards: Vec<Coin> } - Used when querying rewards on farms.

  • ClaimRewards { rewards: Vec<Coin>, modified_farms: HashMap<String, Uint128> } - Used when claiming rewards on farms.

RewardsResponse

Rewards response used for calculating or querying farm rewards

  • RewardsResponse { rewards: Vec<Coin> } - Used when querying rewards on farms.

  • ClaimRewards { rewards: Vec<Coin>, modified_farms: HashMap<String, Uint128> } - Used when claiming rewards on farms.

SwapOperation

The type of swap operation to perform

  • MantraSwap { token_in_denom: String, token_out_denom: String, pool_identifier: String } - A swap operation that uses the MantraSwap router

PoolType

Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool

  • StableSwap { amp: u64 } - A stable swap pool

  • ConstantProduct - xyk pool

Last updated