spectra_simulate_trade
Simulate a PT trade on Spectra to preview a wallet's portfolio before and after the trade.
Instructions
Preview what a wallet's Spectra portfolio would look like after a PT trade.
Fetches the wallet's current position (if any) and the PT pool data, computes a trade quote, then shows BEFORE / TRADE / AFTER with deltas.
Works even if the wallet has no existing position (simulates a new entry). Side: "buy" = acquire PT, "sell" = dispose PT.
Note: This simulates PT trades only, not YT. YT is acquired by minting (deposit IBT to get PT+YT) and sold via the Router's flash-redeem mechanism, not through the Curve pool directly. The wallet's YT balance is shown but not modified by this simulation.
Use spectra_get_portfolio to see current full positions. Use spectra_quote_trade for a standalone price quote without portfolio context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | The blockchain network | |
| pt_address | Yes | The PT contract address (0x...) | |
| address | Yes | The wallet address to simulate for (0x...) | |
| amount | Yes | Amount of input token (in human-readable units, not raw decimals) | |
| side | Yes | Trade direction: 'buy' = acquire PT (input underlying), 'sell' = dispose PT (input PT) | |
| slippage_tolerance | No | Slippage tolerance in % (default 0.5%). minOut = expectedOut * (1 - tolerance/100) |