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

Positions

Request append param

name

type

required

detail

pair

String

√

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

Receive data:

name

type

required

detail

data

Object

position info

event

String

api_position

success

Boolean

true,false

data object:

name

type

required

detail

changeType

String

NEW/ INCREASE/ CLOSE/LIQUIDATE/ REDUCE;

currentQuantity

String

direction

String

LONG/SHORT

operateQuantity

String

positionId

Long

ID

symbol

String

canClosedQuantity

String

contractPairId

Long

positionType

Integer

3 one-way isloate 4 one-way cross

openingPrice

String

marginAmount

String

Initial margin amount

marginCallAmount

String

Example:

1 Get current timestamp(ms):

1725870816532

2 Sign the string format of the timestamp, result:

0xc2a5c5ac88017831c64176d3c0ab0c6275c5c51c7fe496925aa48c7c5c894c431e22d7d94adf7fc0215b8a636bd90f6b0909bc9923f425918740443af2e593b11b

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

{
    "pair": "ETH-USD",
    "method": "SUBSCRIBE",
    "event": "api_position",
    "apiKey": "st_fq6cvRF4fr5tnKiZfrIntRnLfrwxcXjcfr1y8FR7",
    "signature": "0xc2a5c5ac88017831c64176d3c0ab0c6275c5c51c7fe496925aa48c7c5c894c431e22d7d94adf7fc0215b8a636bd90f6b0909bc9923f425918740443af2e593b11b",
    "timestamp": 1725870816532,
    "signType": "2"
}

4 Returns after a successful subscription

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

5 Server websocket push data.

{
    "data": {
        "canClosedQuantity": "0.06",
        "changeType": "NEW",
        "contractPairId": 1,
        "currentQuantity": "0.06",
        "direction": "LONG",
        "marginAmount": "39.890168",
        "marginCallAmount": "7.5",
        "openingPrice": "2300.045",
        "operateQuantity": "0",
        "positionId": 4796701,
        "positionType": 3,
        "symbol": "ETH-USD"
    },
    "event": "api_position",
    "success": true
}

PreviousOrdersNextTrades

Last updated 7 months ago

👨‍💻