An efficient and user-friendly DEX natively built on B² network.
- There are three main contracts, Factory Contract, Pool contract and Router contract.
- Trader/liquidity provider interacts with Router contract not with main pool contract directly
- Approve periphery contract to use trader's tokens
- Trader uses router contract to swap tokens
- Sends tokenA to core contract
- Calculates tokenOut
- Then iterate over path array and swap tokens untill desired token come
- Then we sends the token to trader
- Update the reserves
- Approve periphery contract to use liquidity provider's tokens
- Liquidity provider uses router contract to add liquidity
- Sends assets of liquidity provider to core contract
- Calculate liquidity tokens to be minted
- Mint liquidity tokens for liquidity provider
- Update the reserves
- Approve periphery contract to use liquidity provider's tokens
- Liquidity provider uses router contract to withdraw liquidity
- Sends liquidity tokens of liquidity provider to core contract
- Burn liquidity tokens
- Send assets back to liquidity provider
- Update the reserves