Dex Overview (Terra Classic)

Loop DEX was the first AMM (Automatic Market Maker) on Terra.

Decentralized Exchange

Loop DEX is an automatic market maker for token pairs called liquidity pools, which enable users to exchange one asset for another via smart contracts. Users can provide liquidity in exchange for reward-bearing liquidity pool (LP) tokens.

Mechanism

Constant Product

Exchange prices set by liquidity pools are based on a constant product invariant.

X = amount of source asset in liquidity pool (token offered by user)

Y = amount of target asset in liquidity pool (token received by user)

k = constant product invariant

The product of the number of tokens on each side of the pool remains constant across trading operations (buying / selling).

Pricing

Market, price is the number of the pool’s target tokens, Y, divided by the source asset, X (also called the pool ratio), Y/X.

When a pool has large balances of tokens on both sides, the spread becomes smaller and helps the pool execute closer to its reported price of Y/X.

Last updated