Code overview
The code below demonstrates one of the methods for retrieving the current price ratio of two tokens of an existing liquidity pool, which is needed to calculate the precise amounts required for each token when establishing a new liquidity position. The token ratio allows you to calculate the amount needed for the other token. No gas cost — read-only call.Hedera’s EVM chain ID can be retrieved from https://chainlist.org.
- JavaScript SDK
Next steps
New liquidity position (V2)
Mint a position using the computed amounts.
Fetch all pools (V2)
Get pool addresses, tokens, and fee tiers.