userPortfolioMargin
Enable or configure portfolio margin mode for an account. Portfolio margin considers the risk of the entire portfolio rather than individual positions, allowing more capital-efficient trading.
Sample Data#
{
"signature": {
"r": "0x7e5f71ded930d4524d19dc7d6f04b2cb268355ee3a71465365017d12fccac779",
"s": "0x16414434babfd4079bdedffd4c78644f66d95bee4287e4a375208b5ffe8893ea",
"v": 27
},
"action": {
"type": "userPortfolioMargin",
"signatureChainId": "0xa4b1",
"hyperliquidChain": "Mainnet",
"user": "0xb714f435b61a228aa82d28fd4d975b041a88f85d",
"enabled": true,
"nonce": 1768147316503
},
"nonce": 1768147316503
}
View this transaction on Hypurrscan →
Field Reference#
Action Fields#
| Field | Type | Description |
|---|---|---|
type | string | Always "userPortfolioMargin" |
signatureChainId | string | Chain ID for signing |
hyperliquidChain | string | Target chain |
user | string | User address to configure |
enabled | boolean | true to enable, false to disable |
nonce | number | Transaction nonce |
Use Cases#
Portfolio Margin Adoption#
Track portfolio margin usage:
def process_userPortfolioMargin_action(action):
user = action.get('user')
enabled = action.get('enabled')
status = 'enabled' if enabled else 'disabled'
print(f"Portfolio margin {status} for {user[:10]}...")
Related Action Types#
- updateLeverage - Leverage settings
- updateIsolatedMargin - Isolated margin adjustments