POST /markets/quote
Auth X-Hub-Key from API_HUB_KEYExecute
POST /run/myriad/markets/quoteCache executed live on every call — a read-only POST answer is never cachedCost free · weight 0 · standard rate classSource billing freeRead-only trade quote: expected shares, average price, fees and unsigned calldata.
Body forms: exactly one market selector (`market_id` + `network_id`, or `market_slug`), `outcome_id`, `action`, then for a buy only `value`; a sell takes exactly one of `value` or `shares`. Verified on open AMM markets (HTTP 200 with shares/price/calldata). Order-book markets currently answer provider errors instead: 400 `Market is not open for trading` for id+network and 500 `Market fees configuration is invalid` for slug, on 2026-11-18. Those upstream errors are surfaced verbatim rather than hidden.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
market_id | body | int | optional | On-chain market id (pair with network_id; exclusive with market_slug). example: 595 |
network_id | body | int | optional | Network id, required with market_id. example: 42220 |
outcome_id | body | int | required | On-chain outcome id. example: 0 |
action | body | strbuy | sell | required | Trade direction being priced. example: buy |
value | body | float | optional | Tokens to spend (buy) or receive (sell); exclusive with shares. example: 100 |
slippage | body | float | optional | Slippage tolerance as a decimal (0.005 = 0.5%). default: 0.005example: 0.01 |
Response
type: object
pagination: none
sample: {
"value": "int",
"shares": "float",
"shares_threshold": "float",
"price_average": "float",
"price_before": "float",
"price_after": "float",
"calldata": "str",
"net_amount": "int",
"fees": "object"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sX POST "https://openapihub.dev/run/myriad/markets/quote" \
-H "X-Hub-Key: $API_HUB_KEY" -H "Content-Type: application/json" \
-d '{"market_id": 595, "network_id": 42220, "outcome_id": 0, "action": "buy", "value": 100, "slippage": 0.01}'