Prepare an on-chain quote
prepare_quotePrepare an on-chain BlazePhoenix quote to run on YOUR OWN RPC. Returns the exact eth_call (Quoter address + calldata, as a ready JSON-RPC request and a curl line) plus a request object. Run the call on your node, then pass request and the result hex to decode_quote. This server performs no RPC.
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": {
"chain": "<chain>",
"in": "<in>",
"out": "<out>",
"amountIn": "<amountIn>"
},
"name": "prepare_quote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| in | Yes | input token — 0x address, or ETH / WETH / USDC | |
| out | Yes | output token — 0x address, or ETH / WETH / USDC | |
| usd | No | true → also `usd.in`: the eth_call valuing amountIn in USD (via USDC; USDG on Robinhood Chain), to decode with decode_usd_value; decode_quote then returns `usdOut`, the call valuing the output | |
| chain | Yes | base | eth | optimism | arbitrum | robinhood (or a chain id) | |
| exact | No | true → previewPlanExact: every leg dry-run on its pool in this block; with recipient + userMinOut also calldata (exact mode applies a safety margin: userMinOut at or under exactOut less 50 bps). No tokens move from a holder, so a token that blocks or taxes its own transfer still quotes; simulate the swap from the holder to test that | |
| version | No | protocol version: latest (default) | 1 | 2 | 2.0.0 | |
| amountIn | Yes | input amount in base units (wei-style integer string) | |
| blockHash | No | with usd: the hash of the block to pin usd.in at ({blockHash, requireCanonical: true}); read it with eth_getBlockByNumber and pass it to decode_usd_value too | |
| recipient | No | optional 0x address; with it (and userMinOut), decode_quote returns unsigned calldata that clears the swap math; simulate it as an eth_call to the Router from the payer before sending | |
| userMinOut | No | minimum output, base units, from a price you trust; required for calldata, which enforces the higher of it and the quoted net output less slippageBps (exact mode: exactly this value) | |
| deadlineSec | No | deadline horizon in seconds, 10–3600 (default 120) | |
| slippageBps | No | 0–5000 (default 50); the calldata minimum is never under the quoted net output less this (exact mode: how far under it userMinOut may sit) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false: see code, error | |
| usd | No | ||
| call | No | ||
| code | No | ||
| curl | No | ||
| mode | No | ||
| note | No | ||
| error | No | ||
| decode | No | ||
| chainId | No | ||
| request | No | ||
| contracts | No | ||
| rpcRequest | No | ||
| protocolVersion | No |