Satori Finance Docs
  • ✨About Satori Finance
  • 👉Beginner's Guide
    • Deposit & Withdrawal
    • Trading
  • 💸Perpetual Trading
    • Matchmaking
    • Margin
    • Isolated/Cross Margin
    • Funding Costs
    • Trading fees
    • Index Price
    • Mark Price
    • Liquidations
    • Insurance Funds
    • Automatic Deleveraging
  • 🌽Vaults
  • 📲Telegram Mini APP
  • 🚀Liquid Restaked Tokens (LRT)
  • 🔥Points
  • 🎉Trading Competition
    • Satori Season2 Trading Competition Backed by Hemi
  • 🎭Referrals
  • 🦄Ecosystem Partner Incentives
  • API DOCS
    • 👨‍💻OpenAPI
      • Introduce
      • Auth
      • URL
      • Response Code
      • Rest API
        • A complete example
        • Order Operation 【Private Operation】
          • Create order
          • Batch create orders
          • Cancel order
          • Batch Cancel orders
        • Position Operation 【private operation】
          • Add/reduce margin
        • 【Private Query】
          • [Account] Query account balance
          • [Order] Query current order list
          • [Trade] Query match result
          • [Position] Query position list
        • 【Public Query】
          • System time
          • Index price
          • Mark price
          • Last trade
          • Pair list
      • WebSocket
        • Events
        • Subscription
          • Basic parameters
          • Example
          • Account
          • Orders
          • Positions
          • Trades
Powered by GitBook
On this page
  1. API DOCS
  2. OpenAPI
  3. WebSocket
  4. Subscription

Orders

Request append param

name

type

required

detail

pair

String

√

{
  "pair": "ETH-USD",
  "method": "SUBSCRIBE",
  "apiKey": "?",
    "signType": 2,
  "signature": "?",
  "event": "api_entrust",
  "timestamp": 1657157345159
}

Receive data:

name

type

required

detail

data

Object

Entrust order info

event

String

api_entrust

success

Boolean

true,false

Data object:

name

type

required

detail

currentEntrustId

Long

order id

changeType

String

ENTRUST; NEW;TRADE; CANCELED

dealQuantity

String

direction

String

LONG/SHORT

lever

Integer

price

String

quantity

String

symbol

String

nowDealQuantity

String

isClose

Boolean

true/false

contractPairId

Long

dealAmount

String

matchType

Integer

1 GTC ;2 IOC;3 FOK ;4 POST_ONLY ;

clientOrderId

String

isMarket

Boolean

true/false

feeCoin

String

fee currency (when the changeType is TRADE)

feeAmt

String

fee amount (when the changeType is TRADE)

isTaker

Boolean

true/false (when the changeType is TRADE)

Example:

1 Get current timestamp(ms):

1725870671040

2 Sign the string format of the timestamp, result:

0x2c919fc2ad33889d524b61f5b5a4bc6f2b6d3f3b53505232c8f0e3e12c378dca6f35b217c8018d3da73794df3d428c1f1301c7cdb56b3c0944e0735417849f841c

3 Assembling parameters, including basic parameters for subscription and custom additional parameters for the interface.

{
    "pair": "ETH-USD",
    "method": "SUBSCRIBE",
    "event": "api_entrust",
    "apiKey": "st_fq6cvRF4fr5tnKiZfrIntRnLfrwxcXjcfr1y8FR7",
    "signature": "0x2c919fc2ad33889d524b61f5b5a4bc6f2b6d3f3b53505232c8f0e3e12c378dca6f35b217c8018d3da73794df3d428c1f1301c7cdb56b3c0944e0735417849f841c",
    "timestamp": 1725870671040,
    "signType": "2"
}

4 Returns after a successful subscription

{
    "event": "api_entrust_res",
    "method": "SUBSCRIBE",
    "msg": "subscribe success: api_entrust",
    "pair": "ETH-USD",
    "success": true
}

5 Server websocket push data.

{
    "data": {
        "changeType": "NEW",
        "clientOrderId": "1725870680532",
        "contractPairId": 1,
        "currentEntrustId": 180632923,
        "dealAmount": "0.00",
        "dealQuantity": "0",
        "direction": "LONG",
        "isClose": false,
        "isMarket": false,
        "lever": 1,
        "matchType": 1,
        "price": "2000",
        "quantity": "0.02",
        "symbol": "ETH-USD"
    },
    "event": "api_entrust",
    "success": true
}

PreviousAccountNextPositions

Last updated 7 months ago

👨‍💻