Portfolio Subscription

Subscribe to portfolio update notifications for a specific user address.

Subscribe Request

{
  "id": 4,
  "method": "SUBSCRIBE",
  "params": {
    "chainId": 143,
    "userAddress": "0xafdf17420b93db5b5badfd74cb503da099d18071",
    "type": "portfolio"
  }
}

Unsubscribe Request

{
  "id": 4,
  "method": "UNSUBSCRIBE",
  "params": {
    "chainId": 143,
    "userAddress": "0xafdf17420b93db5b5badfd74cb503da099d18071",
    "type": "portfolio"
  }
}

Parameter Description

  • chainId (required): Chain ID

  • userAddress (required): User address (lowercase)

  • type (required): Must be "portfolio"

Data Stream Message

Portfolio Update Description

  • This message is pushed when a user's orders, range orders, positions, or gates change

  • The type field indicates the change type:

    • order: Order change

    • range: Range order change

    • position: Position change

    • gate: Gate change

  • After receiving this message, clients should call the corresponding REST API to fetch the latest portfolio details

Important Notes

  • This subscription only sends notifications when changes occur

  • You must call the REST API endpoints to retrieve the actual updated data

  • The notification includes the instrument and expiry to help identify which instrument was affected

Last updated