{"uid":"cap_wC2ISaJ52ng0XCGlXEugA","slug":"nansen-perp-positions-c496f569","name":"Nansen Perp Positions","description":"Get perpetual positions data for a user by calling the Hyperliquid API directly. This endpoint provides real-time position information including entry price, mark price, PnL, leverage, and other position details.\n\n**What it helps to answer:**\n\n1. **What are the current perpetual positions for a specific user address?**\n2. **What is the unrealized PnL and performance of each position?**\n3. **What are the leverage levels and margin requirements for each position?**\n4. **What are the liquidation prices and risk levels for each position?**","url":"https://api.nansen.ai/api/v1/profiler/perp-positions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","title":"PerpPositionsRequest","required":["address"],"properties":{"address":{"type":"string","title":"Address","examples":["0xa312114b5795dff9b8db50474dd57701aa78ad1e"],"maxLength":42,"minLength":42,"description":"User's Hyperliquid address in 42-character hexadecimal format"},"filters":{"anyOf":[{"type":"object","title":"PerpPositionsFilters","properties":{"token_symbol":{"anyOf":[{"type":"string"}],"title":"Token Symbol","examples":["BTC","ETH","SOL"],"description":"Filter by token symbol"},"position_type":{"anyOf":[{"type":"string"}],"title":"Position Type","examples":["oneWay"],"description":"Filter by position type"},"position_value_usd":{"anyOf":[{"type":"object","title":"NumericRangeFilter","properties":{"max":{"anyOf":[{"type":"number"}],"title":"Max","examples":[50000,10000000,100],"description":"Maximum value (inclusive)"},"min":{"anyOf":[{"type":"number"}],"title":"Min","examples":[1000,1000000,-50,0],"description":"Minimum value (inclusive)"}},"description":"Filter for numeric values (floats) with optional min/max bounds.\nUse for prices, volumes, ratios, and other decimal values. - Values between -10.5 and 100.75","additionalProperties":false}],"examples":[{"min":1000},{"max":100000},{"max":100000,"min":1000}],"description":"Filter by position value in USD"},"unrealized_pnl_usd":{"anyOf":[{"type":"object","title":"NumericRangeFilter","properties":{"max":{"anyOf":[{"type":"number"}],"title":"Max","examples":[50000,10000000,100],"description":"Maximum value (inclusive)"},"min":{"anyOf":[{"type":"number"}],"title":"Min","examples":[1000,1000000,-50,0],"description":"Minimum value (inclusive)"}},"description":"Filter for numeric values (floats) with optional min/max bounds.\nUse for prices, volumes, ratios, and other decimal values. - Values between -10.5 and 100.75","additionalProperties":false}],"examples":[{"min":-1000},{"max":0},{"max":1000,"min":-1000}],"description":"Filter by unrealized PnL in USD"}},"description":"Filters for perp positions endpoint.","additionalProperties":false}],"examples":[{"position_value_usd":{"min":1000},"unrealized_pnl_usd":{"max":0}}],"description":"Additional filters to apply to the query."},"order_by":{"anyOf":[{"type":"array","items":{"type":"object","title":"PerpPositionsSortOrder","required":["field","direction"],"properties":{"field":{"enum":["leverage_value","position_value_usd","entry_price_usd","liquidation_price_usd","unrealized_pnl_usd","size","token_symbol","position_type"],"type":"string","title":"PerpPositionsSortField","description":"Enum for perp positions sort fields."},"direction":{"enum":["ASC","DESC"],"type":"string","title":"SortDirection","description":"Enum for sort directions."}},"additionalProperties":false}}],"title":"Order By","examples":[[{"field":"position_value_usd","direction":"DESC"}]],"description":"Custom sort order to override the endpoint's default ordering.\n\nExamples:\n- [{\"field\": \"position_value_usd\", \"direction\": \"DESC\"}] - Sort by position value descending\n- [{\"field\": \"unrealized_pnl_usd\", \"direction\": \"ASC\"}] - Sort by unrealized PnL ascending\n\nIf not provided, positions are sorted by position value descending."}},"description":"Request model for Perp Positions endpoint.","additionalProperties":false},"responseSchema":{"type":"object","title":"PerpPositionsResponse","required":["data"],"properties":{"data":{"type":"object","title":"PerpPositionsData","properties":{"time":{"anyOf":[{"type":"integer"}],"title":"Time","examples":[1761283435707],"description":"Timestamp"},"account_mode":{"anyOf":[{"type":"string"}],"title":"Account Mode","examples":["default"],"description":"Hyperliquid account abstraction mode: one of default, disabled, dexAbstraction, unifiedAccount or portfolioMargin. Null when it could not be read."},"withdrawable":{"anyOf":[{"type":"string"}],"title":"Withdrawable","examples":["2933647.2403759998"],"description":"Withdrawable USD"},"assetPositions":{"anyOf":[{"type":"array","items":{"type":"object","title":"AssetPosition","properties":{"position":{"anyOf":[{"$ref":"#/components/schemas/Position"}],"description":"Position data"},"position_type":{"anyOf":[{"type":"string"}],"title":"Position Type","examples":["oneWay"],"description":"Position type"}},"description":"Asset position wrapper.","additionalProperties":false}}],"title":"Assetpositions","description":"List of asset positions"},"collateral_in_spot":{"anyOf":[{"type":"boolean"}],"title":"Collateral In Spot","examples":[false],"description":"True when the account keeps its perp collateral in the spot balance (unified account or portfolio margin mode). The perp account value, total raw USD and withdrawable fields are then null; read the spot balance for the collateral. False in DEX abstraction mode: USDC collateral stays in the perp balance, but other collateral tokens sit in spot (see other_collateral_summaries). Null when the summary is unknown."},"crossMaintenanceMarginUsed":{"anyOf":[{"type":"string"}],"title":"Crossmaintenancemarginused","examples":["722948.2832910001"],"description":"Cross maintenance margin used USD"},"other_collateral_summaries":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","title":"PerpCollateralSummary","properties":{"account_value":{"anyOf":[{"type":"string"}],"title":"Account Value","examples":["5000.0"],"description":"Account value in the collateral token. Null when this collateral sits in the spot balance: in unified account and portfolio margin modes (see collateral_in_spot), and in DEX abstraction mode, where only USDC stays in the perp balance."},"total_margin_used":{"anyOf":[{"type":"string"}],"title":"Total Margin Used","examples":["2500.0"],"description":"Total margin used in the collateral token"},"total_net_liquidation_position":{"anyOf":[{"type":"string"}],"title":"Total Net Liquidation Position","examples":["25000.0"],"description":"Total position notional in the collateral token"}},"description":"Account totals for the perp venues that use one non-USDC collateral token.\n\nValues are in that token, not in USD.","additionalProperties":false}}],"title":"Other Collateral Summaries","examples":[{}],"description":"Totals for venues whose collateral is not USDC, keyed by collateral token (for example USDH). Values are in that token and are not included in the USD summary fields. Only tokens with a non-zero total are listed. Null when the summary is unknown."},"margin_summary_total_raw_usd":{"anyOf":[{"type":"string"}],"title":"Margin Summary Total Raw Usd","examples":["13987445.0243870001"],"description":"Margin summary total raw USD"},"margin_summary_account_value_usd":{"anyOf":[{"type":"string"}],"title":"Margin Summary Account Value Usd","examples":["4643143.4382309997"],"description":"Margin summary account value USD"},"cross_margin_summary_total_raw_usd":{"anyOf":[{"type":"string"}],"title":"Cross Margin Summary Total Raw Usd","examples":["13987445.0243870001"],"description":"Cross margin summary total raw USD"},"margin_summary_total_margin_used_usd":{"anyOf":[{"type":"string"}],"title":"Margin Summary Total Margin Used Usd","examples":["1456365.231985"],"description":"Margin summary total margin used USD"},"cross_margin_summary_account_value_usd":{"anyOf":[{"type":"string"}],"title":"Cross Margin Summary Account Value Usd","examples":["4643143.4382309997"],"description":"Cross margin summary account value USD"},"cross_margin_summary_total_margin_used_usd":{"anyOf":[{"type":"string"}],"title":"Cross Margin Summary Total Margin Used Usd","examples":["1456365.231985"],"description":"Cross margin summary total margin used USD"},"margin_summary_total_net_liquidation_position_usd":{"anyOf":[{"type":"string"}],"title":"Margin Summary Total Net Liquidation Position Usd","examples":["13339928.690684"],"description":"Margin summary total net liquidation position USD"},"cross_margin_summary_total_net_liquidation_position_on_usd":{"anyOf":[{"type":"string"}],"title":"Cross Margin Summary Total Net Liquidation Position On Usd","examples":["13339928.690684"],"description":"Cross margin summary total net liquidation position on USD"}},"description":"Hyperliquid perp account state across all perp venues.\n\nPositions cover the main Hyperliquid perp venue and up to 20 HIP-3\nbuilder-deployed venues (coins prefixed like `xyz:`).\n\nThe `*_usd` summary fields (margin summaries, cross maintenance margin,\nwithdrawable) are the sum over the venues that use USDC as collateral.\nVenues with another collateral token (for example USDH or USDE) are not in\nthe USD totals; their totals are in `other_collateral_summaries`, per token.\n\nWhen the account keeps its collateral in the spot balance (unified account\nor portfolio margin mode, `collateral_in_spot` is true), the per-venue\nbalances are not meaningful: account value, total raw USD and withdrawable\nare null. Notional, margin used and maintenance margin are still given.\nIn DEX abstraction mode only non-USDC collateral sits in spot, so the\n`account_value` in `other_collateral_summaries` is null.\n\nAll summary fields are null when a venue, the venue collateral data or the\naccount mode could not be read, or when more than 20 HIP-3 venues exist; in\nthe last case positions on the venues past the limit are also omitted.","additionalProperties":false}},"description":"Response model for perp positions endpoint.","additionalProperties":false},"example":null,"exampleRequest":null,"tags":["blockchain","smart-money","wallet","tokens","defi","analytics","profiler","dex","pnl","onchain","prediction-market","data"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JHYyn-Jgno3RUDIVeVqxr","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"Nansen","brandSlug":"nansen","brandBaseUrl":"https://nansen.ai","brandDocsUrl":"https://docs.nansen.ai","whatItDoes":"Retrieves real-time perpetual futures position data for a Hyperliquid wallet address, including PnL, leverage, margin, and liquidation details.","exampleAgentPrompt":"Pull up the current perpetual positions on Hyperliquid for wallet 0xa312114b5795dff9b8db50474dd57701aa78ad1e — I want to see the unrealized PnL, leverage, and liquidation prices for each position, and filter to only show positions in BTC or ETH.","exampleUseCases":null,"resultDescription":"Returns a structured object containing all open perpetual positions for the address, including per-position entry price, mark price, unrealized PnL in USD, leverage, liquidation price, position size and value, margin used, position type, plus account-level summaries like total account value, withdrawable balance, and cross maintenance margin used.","failureModes":["Invalid address format (not 42-character hex) returns validation error","Address with no Hyperliquid perp positions returns empty assetPositions array","Hyperliquid API unavailability causes upstream timeout","Filter combination returns no matching positions","Payment of $0.01 USDC not provided results in 402 response"],"whenToPreferThis":"Use this endpoint when you need real-time perpetual futures position data for a specific Hyperliquid wallet address, especially for smart money tracking, risk assessment, or DeFi analytics. Prefer this over generic blockchain explorers when you need structured position-level detail including PnL, leverage, and margin data specifically from Hyperliquid's perp DEX.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-03T12:47:39.892Z","isFirstParty":false,"canonicalSlug":"nansen-perp-positions-c496f569"}