Skip to main content

Subscribe

Request Body

ParameterTypeDescription
method*stringMust be "subscribe"
subscription*objectSee below
subscription.type*stringMust be "userOrderRejections"
subscription.user*stringYour wallet address (lowercase), e.g., "0x742d35cc6634c0532925a3b844bc9e7595f0beb"

Response

Subscription Confirmation:
{
  "channel": "subscriptionResponse",
  "data": {
    "method": "subscribe",
    "subscription": {
      "type": "userOrderRejections",
      "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
    }
  }
}
Rejection Notification:
{
  "channel": "userOrderRejections",
  "data": {
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb",
    "rejections": [
      {
        "orderId": "0x1234...",
        "coin": "BTC",
        "reason": "Insufficient margin",
        "code": "INSUFFICIENT_MARGIN",
        "timestamp": 1701234567890
      }
    ]
  }
}

Rejection Fields

FieldTypeDescription
orderIdstringOrder ID that was rejected
coinstringAsset symbol (BTC, ETH, etc.)
reasonstringHuman-readable rejection reason
codestringMachine-readable error code
timestampnumberRejection time in milliseconds

Rejection Codes

CodeDescription
INSUFFICIENT_MARGINNot enough margin to open position
INVALID_PRICEPrice outside valid range for market
INVALID_SIZESize doesn’t meet minimum/maximum requirements
REDUCE_ONLY_VIOLATIONReduce-only order would increase position
MAX_LEVERAGE_EXCEEDEDOrder would exceed maximum leverage limit
DUPLICATE_ORDEROrder with same ID already exists
MARKET_CLOSEDMarket is not currently accepting orders
RATE_LIMITEDToo many orders submitted in short time
INVALID_SIGNATUREOrder signature verification failed

Unsubscribe

{
  "method": "unsubscribe",
  "subscription": {
    "type": "userOrderRejections",
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
  }
}

Notes

  • Rejections sent in real-time as they occur
  • User address must be lowercase
  • Rejection codes are standardized for programmatic handling