clearinghouseState

Get the complete clearinghouse state for a single user.

Get the complete clearinghouse state for a single user.

POST Request

Field
Type
Description

type

string

Must be "clearinghouseState"

user

string

Ethereum address (0x-prefixed, 42 characters)

dex

string

Perp DEX name. Defaults to empty string (native DEX). Use "ALL_DEXES" to fetch clearinghouse state across all dexes (native + all HIP-3 dexes) in one request.

Usage

If ALL_DEXES is not passed one call will consume 1 point.

When passing ALL_DEXES as dex the points consumed is the number of dexes that are operational. Therefore, you should be mindful about if you really need to this.

curl -X POST https://api.hydromancer.xyz/info \
  -H "Authorization: Bearer $HYDROMANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "clearinghouseState",
    "user": "0x0000000000000000000000000000000000000000"
  }'
Response
{
  "marginSummary": {
    "accountValue": "50000.00",
    "totalMarginUsed": "10000.00",
    "totalNtlPos": "25000.00",
    "totalRawUsd": "45000.00",
    "withdrawable": "15000.00"
  },
  "crossMarginSummary": {
    "accountValue": "50000.00",
    "totalMarginUsed": "10000.00",
    "totalNtlPos": "25000.00",
    "totalRawUsd": "45000.00",
    "withdrawable": "15000.00"
  },
  "assetPositions": [
    {
      "position": {
        "coin": "BTC",
        "entryPx": "45000.00",
        "leverage": {
          "type": "cross",
          "value": 5
        },
        "liquidationPx": "40000.00",
        "marginUsed": "5000.00",
        "maxTradeSzs": ["100000.00", "100000.00"],
        "positionValue": "50000.00",
        "returnOnEquity": "0.10",
        "szi": "1.0",
        "unrealizedPnl": "500.00"
      },
      "type": "oneWay"
    }
  ],
  "time": 1234567890123
}
Response ALL_DEXES

Last updated