# Market

# Swap Rate

Terra.market.swap_rate(offer_coin, ask_denom)

Gets the Market's swap rate for a given coin to a requested denomination.

# Get swap rate for 1 LUNA for KRT
terra.market.swap_rate(
    offer_coin=Coin("uluna", 1000000),
    ask_denom="ukrw"
) # -> Coin("ukrw", 250000000)

# Parameters

Coin
offer_coin

Amount to be swapped (from).


Denom
ask_denom

Requested denomination for swap (to).


# Returns

Coin

Value representing the swap rate (how much you would receive for what you offered).

# Terra Pool Delta

Terra.market.terra_pool_delta()

Gets current value of the pool delta, which is used to determine Terra<>Luna swap rates.

# Returns

Dec

Current divergence from base_pool.

# Module Params

Terra.market.params(key=None)

Get the Market module's current parameters.

# Parameters

str
key
optional

One of "pool_recovery_period", "base_pool", "min_spread", "tobin_tax", or "illiquid_tobin_tax_list".


# Returns

JiguBox with the following keys:

int
pool_recovery_period

Number of blocks it takes for the Terra & Luna pools to naturally "reset" toward equilibrium δ→0 through automated pool replenishing.

int
base_pool

Initial starting size of both Terra and Luna liquidity pools.

Dec
min_spread

Minimum spread charged on Terra<>Luna swaps to prevent leaking value from front-running attacks.

Dec
tobin_tax

A fee added on for swap between Terra currencies (spot-trading).

JiguBox[Denom, Dec]
illiquid_tobin_tax_list

List of denominations in which to apply a higher Tobin Tax than normal to account for lack of liquidity.

Updated on: 2/28/2020, 2:46:57 PM