NDAX
  • Introduction
    • About NDAX
    • Purpose
  • General Information
  • FIX
    • FIX Straight Through Processing
    • Supported Message Type
    • Resources
    • Sequence Diagram
    • Header & Trailer
    • Administrative Message
      • Logon (35=A)
      • Heartbeat (35=0)
      • TestRequest (35=1)
      • ResendRequest (35=2)
      • Reject (35=3)
      • SequenceReset (35=4)
      • Logout (35=5)
    • Application Message
      • TradeCaptureReport (35=AE)
      • TradeCaptureReportAck (35=AR)
    • Message Component
      • RootParties
      • TrdCapRptSideGrp
      • Parties
  • Web API
    • Endpoints
    • Time
  • Private Endpoints
    • Authentication
    • Index
    • Trades
      • GET Trade
      • POST Trade
      • Batch Trades
    • Positions
      • GET Position
      • GET Platform Position
    • Accounts
      • GET Status
      • Delivery
      • Account
      • History
      • Movement
    • Deposits
      • GET
      • GET: Digital Asset Address
      • POST: Digital Asset Address
      • GET: Fiat Deposit
      • GET: Withdrawal
        • GET: Withdrawal by ID
        • GET: Digital Asset
        • Digital Asset by ID
        • Fiat
        • Fiat by ID
      • Gas Fees
      • POST: Withdrawal
      • Delete: Withdrawal
    • Transfers
      • POST: Transfer
      • GET: Transfer by ID
    • Participants
      • GET
      • GET by Email
      • POST New
      • Region
      • Patch
      • Relation
      • Documents
    • Liquidity
      • GET
      • POST
    • Convert
    • Withdraw
    • Payments
      • POST
      • GET
      • GET Status
    • Rewards & Loyalty
    • Awards
  • Private Socket Feed
    • Overiew
    • Authentication
    • Basic Setup
    • Balances
    • Prices
    • Subscription
  • Security
    • Don't
    • Bounty
  • Contact
Powered by GitBook
On this page
  1. Private Endpoints
  2. Positions

GET Position

GET /positions

const getPositions = () => {
  const timestamp = Math.round(Date.now() / 1000)
  const payload = timestamp + 'GET' + '/positions' + '{}'
  const decodedSecret = Buffer.from(apiSecret, 'base64')
  const hmac = crypto.createHmac('sha256', decodedSecret)
  const signedPayload = hmac.update(payload).digest('base64')

  // SET HEADERS
  const headers = {
    'X-NDAX-API-KEY': 'public_key',
    'X-NDAX-SIGNED': signedPayload,
    'X-NDAX-TIMESTAMP': timestamp,
    'X-NDAX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    body,
    json: true
  }
  return request.get(`https://api.ndax.in/positions`, options)
}

Sample Response

{
  "message": [
    {
      "platform_code": "PLAT01",
      "participant_code": "CUST01",
      "asset": "BTC",
      "position_all_open_trades": "10.02",
      "position_all_accepted_trades_only": "10.02",
      "position_all_active_trades_only": "0"
    },
    {
      "platform_code": "PLAT01",
      "participant_code": "CUST01",
      "asset": "e₹",
      "position_all_open_trades": "-100200",
      "position_all_accepted_trades_only": "-100200",
      "position_all_active_trades_only": "0"
    },
    {
      "platform_code": "PLAT02",
      "participant_code": "CUST01",
      "asset": "USDC",
      "position_all_open_trades": "-110000",
      "position_all_accepted_trades_only": "0",
      "position_all_active_trades_only": "-110000"
    },
    {
      "platform_code": "PLAT02",
      "participant_code": "CUST01",
      "asset": "e₹",
      "position_all_open_trades": "109670",
      "position_accepted_trades_only": "0",
      "position_active_trades_only": "109670"
    }
  ]
}

Returns an array of all positions maintained at NDAX for the participant issuing the query. The response will include positions for all platforms for which the participant is active. Response parameters listed below.

Query parameters include:

  • platform_code (optional) the platform_codes to filter the response by (e.g ?platform_code=PLAT01&platform_code=PLAT02)

Response:

Parameter
Description
Type

platform_code

The code of the platform for the position

string

participant_code

The code of the participant that holds the position

string

asset

The asset code for the for the position, e.g. e₹

string

position_all_open_trades

The net position of all open trades in the asset, i.e. trades with a trade_state of accepted or active

string

position_accepted_trades_only

The net position of all trades in the asset with a trade_state of accepted, i.e. trades where settlement has not yet been attempted

string

position_active_trades_only

The net position of all trades in the asset with a trade_state of active, i.e. trades where settlement has been attempted but was unsuccessful

PreviousPositionsNextGET Platform Position

Last updated 2 years ago