Assessment reports>Nibiru>Threat Models>Message: ExecuteMsg.CreateMarket

Message: ExecuteMsg.CreateMarket

This message can be sent via a CosmosWasm contract and allows a new pool to be created for a specific pair.

The contractAddr address is checked to ensure that it is contained within the set of sudo contracts defined in the x/sudo module.

The parameters that a user can control are

  • Pair — This is the pair of the market to be created. It is checked to ensure that it is valid and that there is no existing market for it.

  • PegMult — This is the peg multiplier to set for the market; it must be greater than zero.

  • SqrtDepth — This is the square root of the depth multiplier to set for the market; it must be greater than zero.

  • MarketParams

    • PriceFluctuationLimitRatio: This is the percentage that a single open or close position can alter the reserve amounts; it must be between 0 and 1.

    • MaintenanceMarginRatio: This is the minimum margin ratio that a user must maintain on this market,; it must be between 0 and 1.

    • MaxLeverage: This is the maximum leverage a user is able to be taken on this market; it must be greater than zero.

    • LatestCumulativePremiumFraction: This is the latest cumulative premium fraction for a given pair.

    • ExchangeFeeRatio: This is the percentage of the notional given to the exchange when trading; it must be between 0 and 1.

    • EcosystemFundFeeRatio: This is the percentage of the notional transferred to the ecosystem fund when trading; it must be between 0 and 1.

    • LiquidationFeeRatio: This is the percentage of liquidated position that will be given as a reward. Half of the liquidation fee is given to the liquidator, and the other half is given to the ecosystem fund, it must be between 0 and 1.

    • PartialLiquidationRatio: This is the portion of the position size we try to liquidate if the available margin is higher than the liquidation fee; it must be between 0 and 1.

    • FundingRateEpochId: This specifies the interval on which the funding rate is updated.

    • TwapLookbackWindow: This is the amount of time to look back for TWAP calculations.

Zellic © 2024Back to top ↑