Read live pool state; plan a range and mint amounts from it
get_pool_stateRetrieves a Uniswap V3 pool's live state including tick, price, and suggested range parameters. Computes token amounts for minting a position, ensuring price slippage checks are met.
Instructions
READ-ONLY (builds no tx). Returns the pool's LIVE state: pool address, tick, sqrtPriceX96, price (token1 per token0, human units), tickSpacing. With rangePct: suggested tickLower/tickUpper within ±pct of spot, rounded INWARD to tick spacing. With balance0+balance1 (raw wei) + tickLower/tickUpper: amount0Desired/amount1Desired for build_mint computed from the live sqrtPrice ratio, plus which side limits. Errors if spot is outside the range. ALWAYS recompute amounts with this right before build_mint — stale ratios revert with 'Price slippage check'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fee | Yes | ||
| token0 | Yes | ||
| token1 | Yes | ||
| chainId | Yes | ||
| balance0 | No | ||
| balance1 | No | ||
| rangePct | No | ||
| tickLower | No | ||
| tickUpper | No |