Skip to content

Account margin information update (Beta)

SEND Server to Client on wss://api.valr.com/ws/account

(Beta) Receive periodic notifications of the account's current margin information, currently sent every 5 seconds. Requires explicit subscription. On subscription the latest update is sent immediately.

Authentication

This operation requires API key authentication (HMAC-SHA512 via query parameters or in-band AUTHENTICATE message).

Subscription

This event requires an explicit subscription. Send a SUBSCRIBE message after connecting:

json
{
    "type": "SUBSCRIBE",
    "subscriptions": [
        {
            "event": "MARGIN_INFO"
        }
    ]
}

Message

Event type: MARGIN_INFO

Payload Schema

PropertyTypeRequiredDescription
marginFractionstringYes-
collateralizedMarginFractionstringYes-
initialMarginFractionstringYes-
totalLeveragedExposureInReferencestringYes-
collateralizedBalancesInReferencestringYes-
referenceCurrencystringYes-
initialRequiredInReferencestringYes-
availableInReferencestringYes-
maintenanceMarginFractionstringYes-
autoCloseMarginFractionstringYes-
leverageMultiplenumber (double)Yes-
totalPositionsAtEntryInReferencestringYes-
totalUnrealisedFuturesPnlInReferencestringYes-
totalBorrowedInReferencestringYes-
tradeReservedInReferencestringYes-

Example

json
"{\n    \"type\": \"MARGIN_INFO\",\n    \"data\": {\n        \"marginFraction\": \"1.90363696\",\n        \"collateralizedMarginFraction\": \"0.09883855\",\n        \"initialMarginFraction\": \"0.098837526\",\n        \"totalLeveragedExposureInReference\": \"478.041761878\",\n        \"collateralizedBalancesInReference\": \"151.809292840675\",\n        \"referenceCurrency\": \"USDC\",\n        \"initialRequiredInReference\": \"151.808803678845\",\n        \"availableInReference\": \"862.76900859039\",\n        \"maintenanceMarginFraction\": \"0.047995245\",\n        \"autoCloseMarginFraction\": \"0.017056799\",\n        \"leverageMultiple\": 0.53,\n        \"totalPositionsAtEntryInReference\": \"373.48142334\",\n        \"totalUnrealisedFuturesPnlInReference\": \"-26.45828977\",\n        \"totalBorrowedInReference\": \"78.102048768\",\n        \"tradeReservedInReference\": \"0\"\n    }\n}"

Channel

Channel: account Address: wss://api.valr.com/ws/account