Trading overview
Trading is split by market family. The safest integration path is:
- Read
/v1/runtime-config. - Load market metadata.
- Check the active bucket or expiry state.
- Prepare the action if the flow uses agent signing.
- Sign exactly what the API returned.
- Submit the signed action.
- Read positions and open orders after submission.
Runtime config exposes waitlist and outcome feature flags. Probe scalar and binary market endpoints before enabling those market families in the client.
Scalar choices
Scalar markets support three entry styles:
| Flow | Best for |
|---|---|
/v1/predict | Simple temperature prediction UI |
/v1/orders | Direct wallet-signed order submission |
/v1/orders/prepare then /v1/orders/submit | Agent-wallet integrations |
Use /v1/close for explicit reduce-only closes.
Binary choices
Binary trading uses:
POST /v1/binary/setupPOST /v1/binary/predictPOST /v1/binary/close
Leverage must be set to 2. Entries are rejected near the bucket boundary and when the market is not in the right phase.
Outcome choices
Outcome trading uses prepare/submit pairs:
Check /v1/runtime-config before showing outcome flows. When outcomes are
disabled, outcome routes are unavailable. When outcome writes are enabled,
prepare routes require JWT authentication, RIPBET allowlist access, and an
active approved agent:
- Call
POST /v1/agent/approveif prepare returnsagent_not_approved. POST /v1/outcomes/orders/prepare- Sign the returned agent message.
POST /v1/outcomes/orders/submit
Cancels use the same pattern with /v1/outcomes/cancel/prepare and /v1/outcomes/cancel/submit.
Reduce-only and close-only states
Markets can enter states where new exposure is blocked but reducing exposure is allowed. Clients should:
- Set
reduce_only=truewhen closing scalar positions. - Use
/v1/binary/closefor binary exits. - Disable entry buttons when market status says paused, settled, or unavailable.
- Show the API error message instead of masking it with a generic failure.
After submit
Do not assume a successful HTTP response means final settlement. Check:
| Need | Endpoint |
|---|---|
| Positions | GET /v1/positions/{address} |
| Open orders | GET /v1/orders/open/{address} |
| Order history | GET /v1/orders/history/{address} |
| Trades | GET /v1/trades/{address} |
| Outcome order status | POST /v1/outcomes/order-status |