This V2 query returns per-DEX subaccount state. Each dexToClearinghouseState entry is a [DEX name, clearinghouse state] tuple; an empty DEX name represents the main DEX. See clearinghouseState for the account-state fields and spotClearinghouseState for spot balances.
An account with no returned subaccounts can return null instead of an array. For the original query, see subAccounts.
Parameters
- typestringREQUIRED
Info request type.
- userstringREQUIRED
User address in 42-character hexadecimal format.
Returns
- resultarray|null
Subaccounts with per-DEX account states, or null when no subaccounts are returned.
- namestring
Subaccount name.
- subAccountUserstring
Subaccount wallet address.
- masterstring
Master account wallet address.
- dexToClearinghouseStatearray
Array of [DEX name, clearinghouse state] tuples. The empty DEX name identifies the main DEX. Each state follows the clearinghouseState response schema.
- tuplearray
Each array element is a two-element tuple. The numbered entries below are array positions, not object keys.
- 0string
[0] dex. Perp DEX name. An empty string identifies the main perp DEX.
- 1object
[1] clearinghouseState. Clearinghouse state for this DEX.
- marginSummaryobject
Overall margin summary for the account
- accountValuestring
Total account value in USD
- totalNtlPosstring
Total notional position value
- totalRawUsdstring
Total raw USD value
- totalMarginUsedstring
Total margin currently used
- crossMarginSummaryobject
Cross margin summary for the account
- accountValuestring
Cross margin account value in USD
- totalNtlPosstring
Cross margin total notional position value
- totalRawUsdstring
Cross margin total raw USD value
- totalMarginUsedstring
Cross margin total margin used
- crossMaintenanceMarginUsedstring
Cross maintenance margin currently used
- withdrawablestring
Amount available for withdrawal
- assetPositionsarray
Open perpetual positions. Empty when no positions are held. Each position follows the clearinghouseState response schema.
- timeinteger
Clearinghouse state timestamp in milliseconds.
- spotStateobject
Spot account state.
- balancesarray
Spot token balances. Empty when no balances are returned.
1[2{3"name": "election",4"subAccountUser": "0x1cfd1eb11f24b7be73f3e334a60569a3fb2fafa3",5"master": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",6"dexToClearinghouseState": [7[8"",9{10"marginSummary": {11"accountValue": "0.003888",12"totalNtlPos": "0.0",13"totalRawUsd": "0.003888",14"totalMarginUsed": "0.0"15},16"crossMarginSummary": {17"accountValue": "0.003888",18"totalNtlPos": "0.0",19"totalRawUsd": "0.003888",20"totalMarginUsed": "0.0"21},22"crossMaintenanceMarginUsed": "0.0",23"withdrawable": "0.003888",24"assetPositions": [],25"time": 179423313146926}27]28],29"spotState": {30"balances": []31}32},33{34"name": "stonks",35"subAccountUser": "0x6dbd776da0a23368777d0648f01cccd6b3cb0f8e",36"master": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",37"dexToClearinghouseState": [38[39"",40{41"marginSummary": {42"accountValue": "0.000838",43"totalNtlPos": "0.0",44"totalRawUsd": "0.000838",45"totalMarginUsed": "0.0"46},47"crossMarginSummary": {48"accountValue": "0.000838",49"totalNtlPos": "0.0",50"totalRawUsd": "0.000838",51"totalMarginUsed": "0.0"52},53"crossMaintenanceMarginUsed": "0.0",54"withdrawable": "0.000838",55"assetPositions": [],56"time": 179423313146957}58]59],60"spotState": {61"balances": []62}63}64]
1[2{3"name": "election",4"subAccountUser": "0x1cfd1eb11f24b7be73f3e334a60569a3fb2fafa3",5"master": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",6"dexToClearinghouseState": [7[8"",9{10"marginSummary": {11"accountValue": "0.003888",12"totalNtlPos": "0.0",13"totalRawUsd": "0.003888",14"totalMarginUsed": "0.0"15},16"crossMarginSummary": {17"accountValue": "0.003888",18"totalNtlPos": "0.0",19"totalRawUsd": "0.003888",20"totalMarginUsed": "0.0"21},22"crossMaintenanceMarginUsed": "0.0",23"withdrawable": "0.003888",24"assetPositions": [],25"time": 179423313146926}27]28],29"spotState": {30"balances": []31}32},33{34"name": "stonks",35"subAccountUser": "0x6dbd776da0a23368777d0648f01cccd6b3cb0f8e",36"master": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",37"dexToClearinghouseState": [38[39"",40{41"marginSummary": {42"accountValue": "0.000838",43"totalNtlPos": "0.0",44"totalRawUsd": "0.000838",45"totalMarginUsed": "0.0"46},47"crossMarginSummary": {48"accountValue": "0.000838",49"totalNtlPos": "0.0",50"totalRawUsd": "0.000838",51"totalMarginUsed": "0.0"52},53"crossMaintenanceMarginUsed": "0.0",54"withdrawable": "0.000838",55"assetPositions": [],56"time": 179423313146957}58]59],60"spotState": {61"balances": []62}63}64]