Types & Errors
Primitive types
type ChainID = number; // uint64 - EIP-155 chain ID
type InstanceID = number; // uint32 - Protocol instance ID
type TokenID = number; // uint32 - Token ID
type MarketID = number; // uint32 - Market ID
type PerpetualID = number; // uint32 - Perpetual ID (smart contract)
type FeeLevelID = number; // uint32 - Fee level ID
type AccountID = number; // uint64 - Trading account ID
type OrderID = number; // uint64 - Order ID
type RequestID = number; // uint64 - Request ID (idempotency key)
type PositionID = number; // uint64 - Position ID
type Decimals = number; // uint8 - Decimal places
type Fraction = number; // uint32 - Fraction in hundredths
type Micros = number; // int64 - Value in 10^-6 fractions
type Amount = string; // Decimal string for large numbers
type Price = number; // uint64 - Scaled price
type SPrice = number; // int64 - Signed scaled price
type Size = number; // uint64 - Scaled sizeNumeric scaling
Concept
Type
Rule
Timestamps
Market IDs
Market
Mainnet ID
Testnet ID
Order enums
OrderType
Value
Name
Description
OrderFlags
Value
Name
Description
TriggerPriceCondition
Value
Name
Description
OrderStatus
Value
Name
OrderStatusReason
Value
Name
LiquiditySide
Value
Name
Position enums
PositionType
Value
Name
PositionStatus
Value
Name
PositionStatusReason
Value
Name
Trade & account enums
TradeSide
Value
Name
AccountEventType
Value
Name
API-key scope
Error model
HTTP status codes (REST)
Code
Meaning
Common cause
Enrollment status codes
Code
Meaning
WebSocket close code
Code
Meaning
Handling
Order-reject reasons
Rate limits
Channel
Limit
Scope
Related pages
Last updated