I am trying to understand how the price impact and liquidity was calculated in uniswap through the router contract?
Router Contract: https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d
Is there is any direct method or what calculations need to do in my code? Pl. Guide me. Thanks in Advance
You could have a look at the contract source code at https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d#code
eg. in the "addLiquidity" functions.
Also that might help : https://uniswap.org/docs/v2/advanced-topics/understanding-returns/