spectra_quote_trade
Estimate output, price impact, and minimum output for a PT trade on Curve AMM. Uses on-chain quotes for accuracy or fallback math estimate.
Instructions
Estimate expected output, price impact, and minimum output for a PT trade. Automatically uses on-chain Curve get_dy() for exact quotes when a public RPC is available for the chain. Falls back to a conservative constant-product math estimate if on-chain quoting fails.
Side: "buy" = spend underlying/IBT to buy PT (e.g. spend USDC-worth to get PT) "sell" = sell PT to receive underlying/IBT
This tool only quotes PT trades on the Curve AMM pool. YT does not trade on the pool directly — YT is acquired by minting (deposit IBT to get PT+YT) or sold via flash-redeem. To estimate YT value: YT price = 1 - PT price in underlying terms.
Returns: expected output amount, spot & effective rates, price impact, and minOut at the specified slippage tolerance. Also includes pool context: IBT/PT reserves with ratio, and IBT APR composition (organic vs incentive yield). The output indicates whether the quote came from on-chain (exact) or math estimate.
On-chain quotes reflect the actual Curve StableSwap-NG amplification parameter and current pool state — significantly more accurate than the math estimate, especially for large trades.
Use spectra_simulate_trade to preview your full portfolio state after this trade (BEFORE / TRADE / AFTER with deltas). Use spectra_compare_yield to evaluate whether the trade makes sense relative to variable rates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | The blockchain network | |
| pt_address | Yes | The PT contract address (0x...) | |
| amount | Yes | Amount of input token (in human-readable units, not raw decimals) | |
| side | Yes | Trade direction: 'buy' = acquire PT, 'sell' = dispose PT | |
| slippage_tolerance | No | Slippage tolerance in % (default 0.5%). minOut = expectedOut * (1 - tolerance/100) |