Smartlink

Searchâ€¦

Decentralized Exchange

Staking

Smart Contract Audits

Bug Bounty

Prices and fees

Prices

Prices are determined by the amount of each token in a pool. For a given liquidity pair, the smart contract maintains the above equation

`x * y = k`

. For example, if you bring

`âˆ†x`

tokens in order to swap for `âˆ†y`

XTZ then the following formula will be used $x * y = k = (x + âˆ†x) * (y - âˆ†y)$

Since the product must still be equal to k. It is equivalent to :

$âˆ†y = y * âˆ†x / (x + âˆ†x)$

Finally, we need to operate with integers only (Tezos doesnâ€™t manage floating numbers) and take a 0.28% fee, which means at the end of every transaction, the user receives

`97.2% = 9972 / 10000`

:$âˆ†y=9972âˆ—yâˆ—âˆ†x/10000âˆ—(x+âˆ†x)âˆ†y = 9972 * y * âˆ†x / 10 000 * (x + âˆ†x)âˆ†y\\ =9972âˆ—yâˆ—âˆ†x/10000âˆ—(x+âˆ†x)$

If you bring

$âˆ†x$

XTZ in order to swap for$âˆ†y$

tokens then the following formula will be used :$k = x*y = (x + 0.9972*Î”x)*(y âˆ’ Î”y)$

Hence

$Î”y = (\frac{0.9972*Î”x* y}{x + 0.9972*Î”x})$

Fees

The

**0.28%**

fee taken against each swap is allocated as per the following ratio:`0.25%`

will be given to the liquidity providers`0.01%`

will be sent to Smartlink Treasury`0.02%`

will be used to buy back and burn $SMAK tokens.