{
  "notice": "This is reference data published by Crypter. It does not ask any software to act.\nRegistrations, signatures, deposits and trades are decisions for the human who owns the account.\nNothing here guarantees airdrops, points, or profits. Crypter earns referral fees where a referral block is present.",
  "id": "perp-dex-tax-pnl-export-audit",
  "type": "guide",
  "title": "Perp DEX trade-history exports and PnL reconciliation",
  "summary": "Build an audit trail from documented account and API access, then reconcile fills, per-trade fees and funding as separate ledger entries.",
  "answer": "A fill export is not a complete PnL ledger. Hyperliquid separates the signer from the address used for account reads and documents different coverage for time-range and recent-fill responses. dYdX separates Indexer data from authenticated Node actions.",
  "next_decision": "Record the account and subaccount, time boundaries, pagination and any missing interval. Match fills by venue identifiers and reconcile booked fees and funding against account movements. Keep the raw responses with the export.",
  "diagnostic_goal": "cost",
  "tool": {
    "kind": "evidence_table",
    "venues": [
      {
        "venue": "hyperliquid",
        "refs": [
          {
            "venue": "hyperliquid",
            "path": "prerequisites.api",
            "pin": "sha256:f1f7c513229c9d45"
          },
          {
            "venue": "hyperliquid",
            "path": "prerequisites.account_mode",
            "pin": "sha256:777c80cd379bf69f"
          },
          {
            "venue": "hyperliquid",
            "path": "costs.trading_fee",
            "pin": "sha256:22019fbd66ee5c3b"
          },
          {
            "venue": "hyperliquid",
            "path": "costs.funding",
            "pin": "sha256:06c1e593097afd5d"
          }
        ]
      },
      {
        "venue": "dydx",
        "refs": [
          {
            "venue": "dydx",
            "path": "prerequisites.api",
            "pin": "sha256:74d266ad7ae1e90c"
          },
          {
            "venue": "dydx",
            "path": "costs.trading_fee",
            "pin": "sha256:e068b053262deaec"
          },
          {
            "venue": "dydx",
            "path": "costs.funding",
            "pin": "sha256:a7ad11f6a0470e66"
          }
        ]
      }
    ]
  },
  "sections": [
    {
      "id": "coverage",
      "heading": "Establish export coverage",
      "body": "Check the account identifier and response coverage before concluding that a missing fill did not occur. The documentation does not establish a common export format for both venues.",
      "fact_refs": [
        {
          "venue": "hyperliquid",
          "path": "prerequisites.api",
          "pin": "sha256:f1f7c513229c9d45"
        },
        {
          "venue": "dydx",
          "path": "prerequisites.api",
          "pin": "sha256:74d266ad7ae1e90c"
        }
      ]
    },
    {
      "id": "reconcile",
      "heading": "Reconcile fees and funding separately",
      "body": "A base-tier fee does not identify the rate applied to a particular fill. Funding belongs on its own line with a timestamp, amount and currency. A missing funding rate does not establish zero funding.",
      "fact_refs": [
        {
          "venue": "hyperliquid",
          "path": "costs.trading_fee",
          "pin": "sha256:22019fbd66ee5c3b"
        },
        {
          "venue": "hyperliquid",
          "path": "costs.funding",
          "pin": "sha256:06c1e593097afd5d"
        },
        {
          "venue": "dydx",
          "path": "costs.trading_fee",
          "pin": "sha256:e068b053262deaec"
        },
        {
          "venue": "dydx",
          "path": "costs.funding",
          "pin": "sha256:a7ad11f6a0470e66"
        }
      ]
    }
  ],
  "limits": "Published fee schedules are checks, not substitutes for booked fees. This guide does not calculate tax, determine reporting obligations, or establish the completeness of any export.",
  "related": [
    {
      "type": "venue",
      "id": "hyperliquid"
    },
    {
      "type": "venue",
      "id": "dydx"
    }
  ],
  "sources": [
    "hl-api-wallets",
    "hl-info",
    "hl-info-perpetuals",
    "hl-limits",
    "hl-builder-codes",
    "dydx-api",
    "hl-fees",
    "hl-referrals",
    "hl-funding",
    "dydx-fees",
    "hl-accounts"
  ],
  "checked_at": "2026-12-05",
  "updated_at": "2026-12-05",
  "review_by": "2027-03-05",
  "guarantee": "none",
  "stale": false,
  "stale_reasons": [],
  "resolved_facts": {
    "hyperliquid#prerequisites.api": {
      "venue": "hyperliquid",
      "venue_name": "Hyperliquid",
      "venue_stale": false,
      "venue_review_by": "2026-12-12",
      "path": "prerequisites.api",
      "record": "/en/venues/hyperliquid",
      "pin_ok": true,
      "fact": {
        "value": "Hyperliquid documents REST APIs and WebSockets and provides examples in the official hyperliquid-python-sdk. An approved API/agent wallet signs on behalf of the account. For account data, query the master or sub-account address, not the signer. For time-range Info responses such as userFunding and fundingHistory, the general pagination rule is 500 elements or distinct blocks per response, using the last returned timestamp as the next startTime. userFills instead returns up to 2,000 recent fills without a time range. userFillsByTime takes startTime and documents a separate ceiling of 2,000 fills per response and the 10,000 most recent fills available.",
        "basis": "official",
        "source_ids": [
          "hl-api-wallets",
          "hl-info",
          "hl-info-perpetuals",
          "hl-limits",
          "hl-builder-codes"
        ],
        "checked_at": "2026-12-04"
      }
    },
    "hyperliquid#prerequisites.account_mode": {
      "venue": "hyperliquid",
      "venue_name": "Hyperliquid",
      "venue_stale": false,
      "venue_review_by": "2026-12-12",
      "path": "prerequisites.account_mode",
      "record": "/en/venues/hyperliquid",
      "pin_ok": true,
      "fact": {
        "value": "Unified and portfolio-margin accounts share balances; Standard keeps spot/perp and DEX balances separate. Unified/portfolio modes have a 50,000 daily user-action limit.",
        "basis": "official",
        "source_ids": [
          "hl-accounts"
        ],
        "checked_at": "2026-11-12"
      }
    },
    "hyperliquid#costs.trading_fee": {
      "venue": "hyperliquid",
      "venue_name": "Hyperliquid",
      "venue_stale": false,
      "venue_review_by": "2026-12-12",
      "path": "costs.trading_fee",
      "record": "/en/venues/hyperliquid",
      "pin_ok": true,
      "fact": {
        "value": 0.045,
        "basis": "official",
        "source_ids": [
          "hl-fees",
          "hl-referrals"
        ],
        "checked_at": "2026-11-26",
        "unit": "percent of notional per fill",
        "note": "Base tier 0 perps: 0.045% taker and 0.015% maker. HYPE staking discounts range from Wood (more than 10 HYPE, 5% off) to Diamond (more than 500,000 HYPE, 40% off). Sub-account volume counts toward the master account and all its sub-accounts share the fee tier. Vault volume is counted separately. Asset-specific adjustments may also apply. The 4% referral discount does not apply to vaults or sub-accounts."
      }
    },
    "hyperliquid#costs.funding": {
      "venue": "hyperliquid",
      "venue_name": "Hyperliquid",
      "venue_stale": false,
      "venue_review_by": "2026-12-12",
      "path": "costs.funding",
      "record": "/en/venues/hyperliquid",
      "pin_ok": true,
      "fact": {
        "value": null,
        "basis": "unknown",
        "source_ids": [
          "hl-funding"
        ],
        "checked_at": "2026-12-04",
        "review_status": "variable",
        "note": "Funding is paid hourly even though the formula is expressed on an eight-hour basis. The payment uses position size, spot oracle price and the applicable rate, not the last trade price.",
        "unit": "percent of position notional over the funding interval"
      }
    },
    "dydx#prerequisites.api": {
      "venue": "dydx",
      "venue_name": "dYdX",
      "venue_stale": false,
      "venue_review_by": "2027-01-03",
      "path": "prerequisites.api",
      "record": "/en/venues/dydx",
      "pin_ok": true,
      "fact": {
        "value": "The indexer exposes HTTP data and live feeds. Authenticated actions use private Node API methods.",
        "basis": "official",
        "source_ids": [
          "dydx-api"
        ],
        "checked_at": "2026-12-04"
      }
    },
    "dydx#costs.trading_fee": {
      "venue": "dydx",
      "venue_name": "dYdX",
      "venue_stale": false,
      "venue_review_by": "2027-01-03",
      "path": "costs.trading_fee",
      "record": "/en/venues/dydx",
      "pin_ok": true,
      "fact": {
        "value": 0.05,
        "basis": "official",
        "source_ids": [
          "dydx-fees"
        ],
        "checked_at": "2026-12-04",
        "unit": "percent of notional per fill",
        "note": "Tier 1 taker rate is 0.05% and maker rate is 0.01% in the published fee table. This excludes funding and any staking discount."
      }
    },
    "dydx#costs.funding": {
      "venue": "dydx",
      "venue_name": "dYdX",
      "venue_stale": false,
      "venue_review_by": "2027-01-03",
      "path": "costs.funding",
      "record": "/en/venues/dydx",
      "pin_ok": true,
      "fact": {
        "value": null,
        "basis": "unknown",
        "source_ids": [
          "dydx-fees"
        ],
        "checked_at": "2026-12-04",
        "review_status": "variable",
        "note": "A single funding rate for all positions and times was not established.",
        "unit": "percent of position notional over the funding interval"
      }
    }
  },
  "fact_sources": [
    "hl-api-wallets",
    "hl-info",
    "hl-info-perpetuals",
    "hl-limits",
    "hl-builder-codes",
    "hl-accounts",
    "hl-fees",
    "hl-referrals",
    "hl-funding",
    "dydx-api",
    "dydx-fees"
  ]
}
