For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data Structures, Constants and Errors

Data and Event Structures

type Order struct {
	OrderIndex                  int64  `json:"i"`
	ClientOrderIndex            int64  `json:"u"`
	OwnerAccountId              int64  `json:"a"`
	InitialBaseAmount           int64  `json:"is"`
	Price                       uint32 `json:"p"`
	RemainingBaseAmount         int64  `json:"rs"`
	IsAsk                       uint8  `json:"ia"`
	Type                        uint8  `json:"ot"`
	TimeInForce                 uint8  `json:"f"`
	ReduceOnly                  uint8  `json:"ro"`
	TriggerPrice                uint32 `json:"tp"`
	Expiry                      int64  `json:"e"`
	Status                      uint8  `json:"st"`
	TriggerStatus               uint8  `json:"ts"`
	ToTriggerOrderIndex0        int64  `json:"t0"`
	ToTriggerOrderIndex1        int64  `json:"t1"`
	ToCancelOrderIndex0         int64  `json:"c0"`
	IntegratorFeeCollectorIndex int64  `json:"ifci"`
	IntegratorTakerFee          uint32 `json:"itf"`
	IntegratorMakerFee          uint32 `json:"imf"`
}

type OrderExecution struct {
	MarketId   int64  `json:"m"`
	Trade      *Trade `json:"t"`
	MakerOrder *Order `json:"mo"`
	TakerOrder *Order `json:"to"`
	AppError   string `json:"ae"`
}

type CancelOrder struct {
	AccountId        int64  `json:"a"`
	OrderIndex       int64  `json:"i"`
	ClientOrderIndex int64  `json:"u"`
	AppError         string `json:"ae"`
}

type ModifyOrder struct {
	MarketId int64  `json:"m"`
	OldOrder *Order `json:"oo"`
	NewOrder *Order `json:"no"`
	AppError string `json:"ae"`
}

type Trade struct {
	Price    uint32 `json:"p"`
	Size     int64  `json:"s"`
	TakerFee int32  `json:"tf"`
	MakerFee int32  `json:"mf"`
}

// Order Status
const (
	InProgressOrder                  = iota // In register
	PendingOrder                            // Pending to be triggered
	ActiveLimitOrder                        // Active limit order
	FilledOrder                             // 3
	CanceledOrder                           // 4
	CanceledOrder_PostOnly                  // 5
	CanceledOrder_ReduceOnly                // 6
	CanceledOrder_PositionNotAllowed        // 7
	CanceledOrder_MarginNotAllowed          // 8
	CanceledOrder_TooMuchSlippage           // 9
	CanceledOrder_NotEnoughLiquidity        // 10
	CanceledOrder_SelfTrade                 // 11
	CanceledOrder_Expired                   // 12
	CanceledOrder_OCO                       // 13
	CanceledOrder_Child                     // 14
	CanceledOrder_Liquidation               // 15
	CanceledOrder_InvalidBalance            // 16
)

Constants

Binary options values

These values are returned in REST and WebSocket market data; the field name determines which value to use.

Field
Binary options value

Market definition market_type

binary_options

Trade market_kind

bo

Order/trade query market_type

bo

Trade type

market-settlement for settlement records; trade for regular fills

Market status

inactive, active, waiting-for-settlement, in-settlement, settled

Market outcome

0: none/refund; 1: No/Down; 2: Yes/Up

Market settlement_type

0: discrete; 1: continuous

Transaction Status Mapping

Error Codes

Binary options errors

Code
Meaning
What to check

21618

Invalid order type for market

Use limit or market orders, with reduceOnly = 0 and triggerPrice = 0

21631

Market is outside its trading window

Create and modify requests must be between start_timestamp and end_timestamp

21632

Order price must be below the full payout

Require price < settlement_cap; Up/Down order prices are 1–99 ticks

21638

Order book is frozen

Create and modify requests are rejected while is_frozen = true

21752

Pools cannot trade binary options

Public pool and insurance fund accounts are not supported

See Binary options order rules for collateral and minimum-notional checks.

RFQ errors

Code
Message
Notes

64001

rfq not found

64002

invalid market_index

Unknown or inactive market

64003

base_amount must be a valid positive integer

64004

insufficient balance for rfq request

Non-positive perp collateral or spot funding-asset balance

64005

account is not whitelisted for rfq

respond only

64006

rfq is already closed

64007

invalid rfq status transition

64008

account is not the owner of this rfq

update only

64010

rfq is being processed, please try again

Another request on the same RFQ is in progress. Retry.

64011

quote_amount must be a valid positive integer

64012

either base_amount or quote_amount must be provided

64013

too many active rfqs already exist for this market

3 open per account per market

Full error list

The updated messages for codes 21133, 21134, 21149, 21150, 21152, 21520, 21751, 23100, and 62006 are confirmed on Lighter mainnet. On Robinhood Chain, match errors by numeric code; the message wording may differ.

Last updated

Was this helpful?