get_quote
Retrieve a best-execution quote from the Ophis orderbook for swapping tokens on a given chain. Specify sell or buy amount in atoms, and get the quote including fees and validity.
Instructions
Fetch a best-execution quote from the chain's Ophis orderbook (use a chainId from list_chains' tradeable). Amounts are in atoms (smallest unit, uint256 decimal string). For kind='sell' the amount is the sell amount before fee; for kind='buy' it is the desired buy amount. Returns the orderbook quote (sellAmount/buyAmount/feeAmount/validTo). Before build_order, apply slippage to the limit side by kind: kind='sell' -> lower buyAmount (min out); kind='buy' -> raise sellAmount (max in).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | EVM chain id (use list_chains for supported chains). | |
| sellToken | Yes | Sell token address (0x...). | |
| buyToken | Yes | Buy token address (0x...). | |
| kind | Yes | 'sell' = you specify the sell amount; 'buy' = you specify the buy amount. | |
| amount | Yes | Amount in atoms (uint256 decimal string). | |
| from | Yes | The trading account address (quotes are account-aware). | |
| validForSeconds | No | Quote validity window in seconds (default 1200 = 20 min). |