tanX Docupaper
AboutTrade
  • ABOUT
    • πŸ“’tanX Docupaper
  • TECH
    • πŸ‘©β€πŸ’»Tech Docupaper
      • 🏨High level architecture
      • πŸ€”Starkware logic
      • 🌊Transactional flow
        • Off-chain accounts
        • The deposit flow
        • The withdrawal flow
        • The trade flow
        • The transfer flow
        • Full withdrawal
    • πŸ”ŒAPI Documentation
      • πŸ˜‹Getting started
        • Test connectivity
      • πŸ“ˆMarket
        • 24hr Tickers Price
        • K-line/Candlestick data
        • Orderbook
        • Recent trades
      • ↔️Trading
        • Create order
        • Get order
        • List orders
        • Cancel order
        • Bulk Cancel
        • List trades
      • πŸ”Account
        • Generating L2 Key Pairs
        • Login
        • Deposit
        • Withdrawal
        • Profile Information
        • Balance details
        • Profit and loss details
      • 🌏Web-socket stream
        • πŸ—οΈPrivate web-socket connection
        • πŸ‘₯Public websocket connection
      • ✨Internal Transfer
        • Create Internal Transfer
        • Get Internal Transfer
        • Check User Existence
        • List Internal Transfers
      • πŸ§ͺSDK Reference
        • NodeJS SDK
        • Python SDK
  • LEGAL
    • ‼️tanX Disclaimer
Powered by GitBook
On this page
  • Endpoint
  • Request Headers

Was this helpful?

  1. TECH
  2. API Documentation
  3. Account

Profit and loss details

Get profit and loss details (Private πŸ”’)

PreviousBalance detailsNextWeb-socket stream

Was this helpful?

Retrieve details of a user’s portfolio i.e., the profit and loss incurred in the various markets. Please note that this is a Private πŸ”’ route which means it needs to be authorised by the account initiating this request.

Note: You will need to include the JWT Auth token to request headers to access this endpoint. To get the JWT Auth Token, refer the section of the documentation.

Endpoint

GET /sapi/v1/user/pnl/

Request Headers

{
  "Authorization": "JWT ***"
}

Example

{baseurl}/sapi/v1/user/pnl/

Response

{
  "status": "success",
  "message": "Retrieval Successful",
  "payload": [
    {
      "currency": "btc",
      "pnl_currency": "usdc",
      "total_credit": "30.2311686",
      "total_debit": "8.6779552",
      "total_credit_value": "951376.399690608",
      "total_debit_value": "263030.247889309",
      "average_buy_price": "31470.05040653995757213302",
      "average_sell_price": "30310.16429876349211851197",
      "average_balance_price": "31446.4028484392969497",
      "total_balance_value": "677771.031254780024102"
    },
    {
      "currency": "eth",
      "pnl_currency": "usdc",
      "total_credit": "30.2311686",
      "total_debit": "8.6779552",
      "total_credit_value": "951376.399690608",
      "total_debit_value": "263030.247889309",
      "average_buy_price": "31470.05040653995757213302",
      "average_sell_price": "30310.16429876349211851197",
      "average_balance_price": "31446.4028484392969497",
      "total_balance_value": "677771.031254780024102"
    }
  ]
}
πŸ”Œ
πŸ”
login