Skip to content

Spec drift: hyperliquid — clearinghouseState response missing cumFunding, maxLeverage.rawUsd, and crossMaintenanceMarginUsed fields #910

@realfishsam

Description

@realfishsam

Exchange

hyperliquid

Drift Type

changed_response

Severity

LOW — missing fields are not currently read by the normalizer; impact is limited to future code that might need funding/leverage data

Their Docs

The live Hyperliquid clearinghouseState response includes these fields absent from PMXT's type definitions:

On each position object (assetPositions[].position):

  • cumFunding (object: { allTime: string, sinceChange: string, sinceOpen: string }) — cumulative funding payments
  • leverage.rawUsd (string) — the leverage object has three fields but PMXT models only type and value

At the top level of the clearinghouse state response:

  • crossMaintenanceMarginUsed (string) — total cross margin maintenance requirement
  • time (number, ms) — response timestamp

Source: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api (QuickNode/Chainstack schema references)

Our Cached Spec

core/src/exchanges/hyperliquid/fetcher.tsHyperliquidRawPosition interface lacks cumFunding and leverage.rawUsd. HyperliquidRawUserState lacks crossMaintenanceMarginUsed and time.

File: core/src/exchanges/hyperliquid/fetcher.ts (HyperliquidRawPosition and HyperliquidRawUserState interfaces)

callApi() References at Risk

None (direct POST calls, no callApi)

Hardcoded URL Bypasses

POST ${baseUrl}/info at fetcher.ts:163

Impact

Funding history and cross-margin maintenance data is not accessible through PMXT's typed interfaces even though it's present in the raw API response.

Fix: Add cumFunding, leverage.rawUsd, crossMaintenanceMarginUsed, and time to the respective type interfaces.


Found by automated spec drift audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions