Inverse quote — size a buy or sell to reach a target outcome price
problee_quote_to_priceInverse of get_quote: given a target marginal price for an outcome, returns the trade that reaches it — sized against the live automated pricing curve so you never reimplement pricing. Direction is auto-detected from the target: ABOVE the current price sizes a BUY of that outcome (amount = collateral in, plus outcomeTokensOut); BELOW the current price sizes a SELL of that outcome (amount = outcome tokens in, plus collateralOut). Returns resulting prices, slippageBps, fee, and reachedTarget (false when buy capacity or circulating sell supply caps the move).
Examples: Size a buy of outcome 1 to reach price 0.60 (above current → buy); Size a sell of outcome 1 to reach price 0.40 (below current → sell)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | `side` = which OUTCOME (0-indexed: 0=outcome1,1=outcome2,2=outcome3), NOT buy/sell. Buy/sell is the direction field (`type`/`tradeType`/`action`/`direction`). Encoded here as the outcome label string ('outcome1'|'outcome2'|'outcome3'), not the 0-indexed TradeSide int used on REST /trade/* bodies. | |
| chainId | No | ||
| targetPrice | Yes | ||
| marketAddress | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |