OX.FUN
TradeSupport
  • 🏠OX.FUN
  • OX.FUN DOCS
    • πŸ“ˆPerps
    • πŸ“ŠStrategies
    • πŸ‚OX Coin
    • πŸ‚Seasons
    • πŸ“©Referral
  • Page
  • API
    • βš™οΈOX FUN API
    • πŸ”‘API Key Management
    • ☁️Websocket API
      • Authentication
      • Session Keep Alive
      • Order Commands
        • Place Limit Order
        • Place Market Order
        • Place Stop Limit Order
        • Place Stop Market Order
        • Place Batch Market Order
        • Cancel Order
        • Cancel Batch Order
        • Modify Order
        • Modify Batch Orders
      • Subscriptions - Private
        • Balance Channel
        • Position Channel
        • Order Channel
          • Order Opened
          • Order Closed
          • Order Closed Failure
          • Order Modified
          • Order Modified Failure
          • Order Matched
      • Subscriptions - Public
        • Fixed Size Order Book
        • Full Order Book
        • Incremental Order Book
        • Best Bid/Ask
        • Trade
        • Ticker
        • Candles
        • Liquidation RFQ
        • Market
      • Other Responses
      • Error Codes
        • Curl Error Codes
    • πŸ”ŒREST API V3
      • Account & Wallet - Private
      • Deposits & Withdrawals - Private
      • Market Data - Public
      • Orders - Private
      • Trades - Private
  • πŸ”—External
    • πŸ’§Aerodrome Pool
    • πŸ”΅Trade on Uniswap (Base)
    • Trade on Solana
    • 🦎CoinGecko
    • API Code Examples
  • πŸ”—SOCIALS
    • πŸ‚OX.FUN
    • Discord
    • Twitter
Powered by GitBook
On this page
  1. API
  2. Websocket API

Session Keep Alive

To maintain an active WebSocket connection it is imperative to either be subscribed to a channel that pushes data at least once per minute (Depth) or periodically send a text β€œping” (without the quotation mark) to the server within an minute and then the server will reply text β€œpong” (without quotation mark) to you.

Self Trade Prevention Modes

Self trade prevention (STP) helps traders avoid costly self-matching within an account and between subaccounts. There are 4 STP modes available to traders NONE, EXPIRE_MAKER, EXPIRE_TAKER, EXPIRE_BOTH.

NONE - has no protection meaning self-matching is possible.

EXPIRE_MAKER - cancels the resting (would-be maker) order regardless of its STP mode, the aggressing order continues to match and/or is placed into the book.

EXPIRE_TAKER - cancels the aggressing order to avoid self-matching, acts similar to an IOC that is cancelled in the event of a self-match.

EXPIRE_BOTH - cancels both the agressing order and the resting (would-be maker) order regardless of the resting order's STP mode.

Note that the STP system uses the aggressing (would-be taker) order to decide which action to take, for example:

Placing an EXPIRE_TAKER order which collides with a resting EXPIRE_MAKER order causes the aggressing EXPIRE_TAKER order to be cancelled, while the EXPIRE_MAKER order will remain.

PreviousAuthenticationNextOrder Commands

Last updated 6 months ago

☁️