Functions§

  • Accumulate token prices for the assets in the pool. Note that this function shifts block_time when any of the token prices is zero in order to not fill an accumulator with a null price for that period.
  • If belief_price and max_spread are both specified, we compute a new spread, otherwise we just use the swap spread to check max_spread.
  • This is an internal function that enforces slippage tolerance for swaps.
  • Calculates the amount of fees the Maker contract gets according to specified pair parameters. Returns a None if the Maker fee is zero, otherwise returns a Asset struct with the specified attributes.
  • Returns an amount of offer assets for a specified amount of ask assets.
  • Returns the result of a swap.
  • Exposes all the execute functions available in the contract.
  • Returns the amount of pool assets that correspond to an amount of LP tokens.
  • Creates a new contract with the specified parameters in the InstantiateMsg.
  • Manages the contract migration.
  • Returns the total amount of assets in the pool as well as the total amount of LP tokens currently minted.
  • Provides liquidity in the pair with the specified input parameters.
  • Exposes all the queries available in the contract.
  • Returns the balance of the specified asset that was in the pool just preceeding the moment of the specified block height creation. It will return None (null) if the balance was not tracked up to the specified block height
  • Returns the pair contract configuration in a ConfigResponse object.
  • Returns information about cumulative prices for the assets in the pool using a CumulativePricesResponse object.
  • Returns the amounts of assets in the pair contract as well as the amount of LP tokens currently minted in an object of type PoolResponse.
  • Returns information about a reverse swap simulation in a ReverseSimulationResponse object.
  • Returns the amount of assets that could be withdrawn from the pool using a specific amount of LP tokens. The result is returned in a vector that contains objects of type Asset.
  • Returns information about a swap simulation in a SimulationResponse object.
  • Receives a message of type Cw20ReceiveMsg and processes it depending on the received template.
  • The entry point to the contract for processing replies from submessages.
  • Performs an swap operation with the specified parameters. The trader must approve the pool contract to transfer offer assets from their wallet.
  • Updates the pool configuration with the specified parameters in the params variable.
  • Withdraw liquidity from the pool.