Think of it like this
A factory, which creates and stores address of contracts which corresponds to each token pair
A router, while calling swap refers to this factory and selects correct pair contract
A pair contract, which basically have 3 functions
Mint - to mint lp tokens while liquidity is added
Swap - To make the actual swap and give token A/B to the caller
Burn - To accept lp token and send back corresponding token amounts
In general, a router routes the transaction to pick correct pair from a given factory and perform operations
Jun 8, 2021, 8:59 PM
Hope that makes sense. Its a very general overview😅
This is the concept behind every dex. Uniswap, sushi, pancake... all follows this
Jun 8, 2021, 9:01 PM
thank you:) So, will I create a contract for these transactions?
Jun 8, 2021, 9:01 PM
Well, Uniswap and its clones🙃
Go through the docs first. You'll get a better idea
Jun 8, 2021, 9:02 PM
ok thank you very much. 😊
Jun 8, 2021, 9:02 PM
Happy to help. We need these kinda questions rather than those lame safemoon fork bs
Jun 8, 2021, 9:06 PM