---
title: "Closed Trade Funding and Leverage"
method: GET
path: "/gateway/v1/hyperliquid/trades/context"
tags: ["Hyperliquid"]
---

# Closed Trade Funding and Leverage

`GET /gateway/v1/hyperliquid/trades/context`

Returns immutable funding and leverage context for one closed trade identified by the composite key from `/hyperliquid/trades`. Use this for a selected trade detail instead of enriching every history row. `funding_status=complete` distinguishes a real zero from unavailable historical data; leverage fields are omitted when the completed-trade source has no value.

## Query parameters

- `address` string, required — Wallet address: a 0x EVM address or an ENS name (e.g. vitalik.eth). Solana addresses are not supported.
- `symbol` string, required — Hyperliquid perpetual market id, including a builder prefix for HIP-3 markets (for example xyz:GOLD).
- `direction` 'long' | 'short', required — Opening direction of the episode.
- `open_time` integer, required — Episode open time, Unix seconds, copied from GET /hyperliquid/trades.
- `close_time` integer, required — Episode close time, Unix seconds, copied from GET /hyperliquid/trades.

## Response `200`

OK

- DataObjectResponseHyperliquidTradeContext
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `data` HyperliquidTradeContext, required
    - `funding_pnl` number, double — Funding paid/received during the episode, USD (positive = received). Omitted unless funding_status is complete.
    - `funding_status` 'complete' | 'partial' | 'unavailable', required — Whether funding_pnl is usable. complete includes a real zero; partial is reserved for incomplete attribution.
    - `leverage` integer — Opening leverage multiplier; omitted because completed-trade semantics do not prove the opening value.
    - `leverage_semantics` 'completed_trade_reported'
    - `leverage_type` 'cross' | 'isolated' — Opening margin mode; omitted unless opening-time semantics are proven.
    - `reported_leverage` integer — Leverage from the completed-trade record; not asserted to be the opening value.
    - `reported_leverage_type` 'cross' | 'isolated'
  - `meta` ObjectResponseMeta, required
    - `cached` boolean, required — Whether this response was served from cache
    - `credits_used` integer, required — Credits deducted for this request
    - `empty_reason` string — Hint explaining why the data array is empty, when applicable

## Other responses

- `default` — Error

---

[API](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api.md) · [All operations](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/asksurf/asksurf-public-rest-api/revisions/4153a9cb5145/schema)
