usdClassTransfer payload - Margin Mode Transfers
Decode Hyperliquid `usdClassTransfer` payloads for margin mode transfers, returned through Dwellir's read-only L1 gRPC API.
Read-only action reference
Dwellir's Hyperliquid gRPC API returns this decoded action payload through
StreamBlocks and
GetBlock. It does not submit or execute this action.
Submit supported user write actions through Hyperliquid's native
POST /exchange
endpoint.
The decoded usdClassTransfer payload records a USD-class asset transfer between perpetual and spot margin modes.
Sample Data
{
"signature": {
"r": "0xb6fb726ec034a9a8d5125cc9031012a58ba10f39c380a80566b56363a2a7cabf",
"s": "0x6d4bc0977c2a7cb99c5ae1a5a9fd54fd219598661c12a36e344f52b3bdb6bc6b",
"v": 28
},
"action": {
"type": "usdClassTransfer",
"signatureChainId": "0x66eee",
"hyperliquidChain": "Mainnet",
"amount": "55.00000001000001",
"toPerp": true,
"nonce": 1768146939642
},
"nonce": 1768146939642
}View this transaction on Hypurrscan
Field Reference
Action Fields
| Field | Type | Description |
|---|---|---|
type | string | Always "usdClassTransfer" |
signatureChainId | string | Chain ID for EIP-712 signing |
hyperliquidChain | string | Target chain: "Mainnet" or "Testnet" |
amount | string | Amount to transfer (human-readable USD) |
toPerp | boolean | true to transfer to perp margin, false to spot margin |
nonce | number | Transaction nonce |
Transfer Direction
toPerp Value | Direction |
|---|---|
true | Spot margin → Perp margin |
false | Perp margin → Spot margin |
Use Cases
Capital Flow Analysis
Track how traders allocate between perp and spot:
def process_usdClassTransfer_action(action):
amount = action.get('amount')
to_perp = action.get('toPerp')
direction = 'spot → perp' if to_perp else 'perp → spot'
print(f"Margin transfer: ${amount} ({direction})")Market Mode Preference
Monitor aggregate flows to understand market preferences between spot and perp trading.
Arbitrage Detection
Large transfers may indicate arbitrage opportunities between markets.
Related Action Payloads
- usdSend - USD transfers
- spotSend - Spot token transfers
- subAccountTransfer - Sub-account transfers