Market

API

class terra_sdk.client.lcd.api.market.MarketAPI(c)[source]
parameters()[source]

Fetches the Market module’s parameters.

Returns

Market module parameters

Return type

dict

swap_rate(offer_coin, ask_denom)[source]

Simulates a swap given an amount offered and a target denom.

Parameters
  • offer_coin (Coin) – amount offered (swap from)

  • ask_denom (str) – target denom (swap to)

Returns

simulated amount received

Return type

Coin

terra_pool_delta()[source]

Fetches the Terra pool delta.

Returns

Terra pool delta

Return type

Dec

Messages

Market module message types.

class terra_sdk.core.market.msgs.MsgSwap(trader, offer_coin, ask_denom)[source]

Perform a native on-chain swap from offer_coin to ask_denom.

Parameters
  • trader (AccAddress) – account performing swap

  • offer_coin (Union[Coin, str, dict]) – coin offered for swap

  • ask_denom (str) – denom into which to swap

action = 'swap'
type: str = 'market/MsgSwap'
class terra_sdk.core.market.msgs.MsgSwapSend(from_address, to_address, offer_coin, ask_denom)[source]

Performs a swap and sends the resultant swapped amount to to_address.

Parameters
  • from_address (AccAddress) – account performing swap

  • to_address (AccAddress) – account which will received resultant funds from swap

  • offer_coin (Union[Coin, str, dict]) – coin offered for swap

  • ask_denom (str) – denom into which to swap

action = 'swapsend'
type: str = 'market/MsgSwapSend'