Token swaps in Tokenik are a simple way to trade one ERC-20 token for another.
For end-users, swapping is intuitive: a user picks an input token and an output token. They specify an input amount, and the protocol calculates how much of the output token they’ll receive. They then execute the swap with one click, receiving the output token in their wallet immediately.
Swaps in Tokenik are different from trades on traditional platforms. Tokenik does not use an order book to represent liquidity or determine prices. Tokenik uses an automated market maker mechanism to provide instant feedback on rates and slippage.
Each pair on Tokenik is actually underpinned by a liquidity pool. Liquidity pools are smart contracts that hold balances of two unique tokens and enforces rules around depositing and withdrawing them.
This rule is the constant product formula. When either token is withdrawn (purchased), a proportional amount of the other must be deposited (sold), in order to maintain the constant.
The swap then goes through Tokenik’s proprietary price impact valuation that determines the final output amount.