expected_surplus
Estimate how much better Ophis quotes than the open market for a sell: fetches the Ophis orderbook sell-quote and a public all-DEX aggregator (KyberSwap) quote for the same input, and returns beatBps (+ = Ophis returns more of the buy token). Use before build_order to show the expected edge. The reference can reflect thin or manipulated liquidity, so treat beatBps as advisory, not a sole execution signal. Sell-side (exact-in) only. Read-only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chainId": "<chainId>",
"sellToken": "<sellToken>",
"buyToken": "<buyToken>",
"sellAmount": "<sellAmount>",
"from": "<from>"
},
"name": "expected_surplus"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The trading account address (quotes are account-aware). | |
| chainId | Yes | EVM chain id (use a chainId from list_chains `tradeable`). | |
| buyToken | Yes | Buy token address (0x...). | |
| sellToken | Yes | Sell token address (0x...). | |
| sellAmount | Yes | Exact sell amount in atoms (uint256 decimal string). |