0

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

Aadhavan G S
  • 87
  • 1
  • 2
  • 18

2 Answers2

1

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/

KotlinIsland
  • 799
  • 1
  • 6
  • 25
1

I have answered the question here: How to calculate Deposit Amounts for Adding Liquidity within Uniswap V3

The excel formulas can be found with the sheet: Excel File

TriCron
  • 141
  • 2
  • 11