ℹ️ Position Tuple Format The array p contains tuples with the following 8 values in order:
Unified & Portfolio Margin accounts: For unified account users, account_value includes spot collateral across all dexes. For Portfolio Margin users, account_value reflects the per-settlement-token equity and liquidation_price is recomputed using PM available margin. Use the accountValueSnapshots endpoint to get the full PM breakdown (pm_ratio, avail per branch).
Multiple Markets Response
Format: Custom binary format with length prefixes
Binary Structure:
ℹ️ Position Tuple Format The array p contains tuples with the following 8 values in order:
Unified & Portfolio Margin accounts: For unified account users, account_value includes spot collateral across all dexes. For Portfolio Margin users, account_value reflects the per-settlement-token equity and liquidation_price is recomputed using PM available margin. Use the accountValueSnapshots endpoint to get the full PM breakdown (pm_ratio, avail per branch).
Implementation examples
Note: Make sure to set HYDROMANCER_API_KEY in your .env file
{
"type": "perpSnapshots",
"market_names": ["BTC", "FARTCOIN"] // or ["ALL"] for all core markets
}
[
"20240915_state_123456789", // Snapshot ID
"BTC", // Market ID
[ // Positions array
[1.5, 1500.0, -2.5, 1000.0, 0.0, 5.0, 950.0, 10000.0],
[/* more position tuples */]
],
[ // Addresses array
"0x1234567890abcdef...",
"0xfedcba0987654321...",
/* more addresses */
]
}
size
notional_size
funding_pnl
entry_price
leverage_type_flag // 0 is cross and 1 is isolated
leverage_multiplier
liquidation_price // Adjusted for unified/PM cross-collateral
account_value // Reflects unified or PM total account value
size
notional_size
funding_pnl
entry_price
leverage_type_flag // 0 is cross and 1 is isolated
leverage_multiplier
liquidation_price // Adjusted for unified/PM cross-collateral
account_value // Reflects unified or PM total account value