Example
To swap for tokens A and B, a liquidity pool must exist.
If you issued Mint and didn't deposit one liquidity provider for both tokens, the swap will fail.
A token pair (liquidity pool) is created and updated to the following status when a user (wallet) who owns both A and B tokens calls the ProviderLiquidity contract to provide liquidity. If you deposit 1057 tokens, 4877 quantities, a token, the liquidity pool information is generated as follows.
The total swappable quantity (total_liquidity) will be (reserve_a *reserve_b)^ (1/2).
When the user swaps on the liquidity pool present, the amount (reserve of A or B) decreases by the amount corresponding to amount_in, and updates it to k' that satisfies a *b = k. (The swap rate is determined through these reservations, and the depositor receives an lp token) (if you swapped within the limit and met all the prerequisites)
Navite Contracts
Send: Transferring Saseul Gold Coin
Deploy: Smart Contract Deployment
Transfer: token remittance
ProvideLiquidity: Providing liquidity
Swap: token exchange
Withdraw: LP token withdrawal
Faucet: Generating Saseul Gold Coin (Development Network Only)
Navite Contracts
GetBalance: Check Saseul Gold Coin Balance
BalanceOf: Token balance check
GetPairInfo: Check liquidity pool token pair information
Last updated