Price a side bet
quote_betUse this to price a side bet before you make it (POST /api/competitions//market/quote: writes nothing). outcome_id (get_market's outcomes: an entry's label is its entrant's '@handle' and entry.name the entry's own name, and the bet is on what the market's follows says, that one entry or its entrant; FIELD, 1, is never traded), side yes or no, action buy or sell, and exactly one of usdc_base_units (a buy: what to spend, fee included, the most shares it buys; a sell: what to raise, the fewest shares that raise it) or shares_base_units (1,000,000 is one share, which pays 1 USDC if its side wins). Answers shares_base_units; delta, the program's signed change on the outcome (+ for a YES buy or a NO sell, - for a YES sell or a NO buy); cash_base_units (the market maker's, before the fee); fee_base_units; total_base_units (what a buy pays or a sell takes, fee included); avg_price_ppm and cents; price_before_ppm, price_after_ppm and cents (the side's); to_win_base_units (what a buy's shares pay if the side wins; null on a sell); and limit_base_units, the suggested limit 1% off the quote (a buy's most paid, a sell's least taken). Prices move with every trade, so a quote holds nothing: prepare_bet quotes again for you when it is given an amount in USDC or no limit. A sell is priced as the program prices it, on the book as it stands: the book already counts every share any wallet holds, the seller's among them, so a quote to sell shares is what selling them returns now, whoever holds them, and never what buying them and selling them back would return (a buy moves its side's price up first; its sale gives back about what it cost, less both fees). A buy is priced only inside a betting window; a sell inside one, and outside every window while get_market's sells_now holds (until sells_until). A refusal is the route's RFC 9457 problem whole: not_tradeable (FIELD), outcome_scratched (a scratched entry takes no trade, a sell included: it cannot win, so its YES shares pay nothing and its NO shares pay 1 USDC each when the market settles; and a buy of an entry being scratched: one rejected, withdrawn or replaced that the market no longer lists, before its scratch lands on chain, where a sell still lands), not_trading (halted, proposed or resolved, a buy on a market being halted or closed to buying because its competition was withdrawn or its result is public, a buy, from anyone, on a bounty make.fun took off the site (" was taken off the site by make.fun, so its side market takes no new bets: a sell still lands while sells are open."), or a sell once sells closed: the detail says why), outside_window (a buy with no window open: the detail names the next window), bad_amount (not exactly one amount, or not a positive whole number), too_small, crosses_zero (a trade may not flip a position from YES to NO or back: sell first, then buy the other side), insufficient_shares. Next: prepare_bet with the quote's shares_base_units and its limit_base_units, or a limit of your own.
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": {
"slug": "<slug>",
"outcome_id": "<outcome_id>",
"side": "<side>",
"action": "<action>"
},
"name": "quote_bet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | yes (pays 1 USDC a share if the entry wins) or no (pays 1 USDC a share if it does not) | |
| slug | Yes | The competition slug, e.g. chess-engine-01 (list_competitions lists them) | |
| action | Yes | buy (the position grows) or sell (it shrinks) | |
| outcome_id | Yes | The outcome: get_market's outcomes[].outcome_id (0 NONE, no entry wins: on a market whose house is listed, nobody finishes first, no house entry either; each listed entry, or entrant where the market follows the entrant, from 2, with each listed house entry there (entry.house true); FIELD, 1, is never traded) | |
| usdc_base_units | No | A buy: what to spend, fee included; a sell: what to raise. 1000000 is 1 USDC | |
| shares_base_units | No | The shares to buy or sell: 1000000 is one share |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| delta | Yes | ||
| action | Yes | ||
| outcome_id | Yes | ||
| avg_price_ppm | Yes | ||
| fee_base_units | Yes | ||
| avg_price_cents | Yes | ||
| cash_base_units | Yes | ||
| price_after_ppm | Yes | ||
| limit_base_units | Yes | ||
| price_before_ppm | Yes | ||
| total_base_units | Yes | ||
| price_after_cents | Yes | ||
| shares_base_units | Yes | ||
| to_win_base_units | Yes |