Binary markets
Binary markets are up/down contracts with a fixed two-sided outcome.
Current examples use:
| Asset | Direction |
|---|---|
GBETA | One side of the active binary pair |
GBETB | Partner side |
Always read /v1/binary/markets; do not assume the pair is live in every environment.
Status
curl -s "{API_BASE_URL}/v1/binary/status" \
-H "Authorization: Bearer $JWT"
Use status to decide whether the market is paused, which asset is active, and how much time remains before entry cutoff.
Bucket
curl -s "{API_BASE_URL}/v1/binary/bucket" \
-H "Authorization: Bearer $JWT"
The response includes the active asset, bucket start/end timestamps, phase, and time remaining. During a migration or pause, the API may return a state that should be shown as unavailable rather than tradable.
Setup leverage
Binary trading requires leverage 2.
Call setup without submit to get unsigned leverage actions:
curl -s -X POST "{API_BASE_URL}/v1/binary/setup" \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{}'
After the user signs the returned actions, submit them back to the same endpoint in the submit array.
Predict
curl -s -X POST "{API_BASE_URL}/v1/binary/predict" \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{
"asset": "GBETA",
"direction": "UP",
"amount_usdc": 50,
"slippage_pct": 1.0
}'
Directions:
| Direction | Meaning |
|---|---|
UP | Buy; long side |
DOWN | Sell; short side |
The API computes the executable price from current market state. Entries can fail if the market is paused, not trading, too close to the boundary, or outside price guards.
Close
curl -s -X POST "{API_BASE_URL}/v1/binary/close" \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{
"asset": "GBETA",
"direction": "UP",
"contracts": 25,
"slippage_pct": 1.0
}'
direction is the direction of the position being closed.
Common binary errors
| Error | What to do |
|---|---|
BINARY_ENTRY_CUTOFF | Stop accepting entries for this bucket |
BINARY_NOT_TRADING_ASSET | Refresh /v1/binary/bucket |
BINARY_MARKET_PAUSED | Show paused state |
BINARY_ORACLE_UNHEALTHY | Disable trading until status recovers |
BINARY_LEVERAGE_MUST_BE_2 | Run setup again |