{"uid":"cap_T_JKppzfis41w7bQvZH7L","slug":"api-hyperd-ai-555813c7","name":"HyperD Wallet P&L Calculator","description":"Returns wallet profit and loss analytics for a given address.","url":"https://api.hyperd.ai/api/wallet/pnl","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["address"],"properties":{"to":{"type":"integer","description":"Window end, unix seconds. Default = now."},"from":{"type":"integer","description":"Window start, unix seconds. Default = to - 30 days."},"chain":{"enum":["base","ethereum","polygon","arbitrum","optimism","avalanche","bnb"],"type":"string","description":"Chain to compute P&L on. Default 'base'."},"method":{"enum":["fifo","lifo","hcfo"],"type":"string","description":"Cost-basis method. Default 'fifo'."},"address":{"type":"string","description":"0x EVM wallet address"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"chain":"base","method":"fifo","address":"0x1234567890123456789012345678901234567890"}}},"response":{"fees":{"reason":"Per-tx gas fees deferred to v1.1 to keep function-time budget bounded","included":false},"query":{"to":1781758506,"from":1779166506,"chain":"base","method":"fifo","address":"0x1234567890123456789012345678901234567890","windowSeconds":2592000},"method":"fifo","totals":{"trades":6,"realizedUsd":0,"unrealizedUsd":0,"untrackedProceedsUsd":0},"coverage":{"truncated":false,"pricedTrades":0,"rawTransfers":6,"unpricedTrades":6,"upstreamErrors":0,"upstreamRequests":7,"collapsedDuplicates":0,"ignoredSelfTransfers":0},"perToken":[{"symbol":"Nora","trades":3,"tokenId":"0xec10ee12e61bff2d9f197cf60f3c6235447b581e","avgCostUsd":0,"oversoldQty":0,"realizedUsd":0,"lastPriceUsd":null,"unrealizedUsd":0,"currentBalance":0,"unpricedTrades":3,"untrackedProceedsUsd":0},{"symbol":"ARB (Visit to claim: t.me/s/arb_pool)","trades":1,"tokenId":"0x64df7b9ff51239614158923a0e793f13479b5ea2","avgCostUsd":0,"oversoldQty":0,"realizedUsd":0,"lastPriceUsd":null,"unrealizedUsd":0,"currentBalance":0,"unpricedTrades":1,"untrackedProceedsUsd":0},{"symbol":"EXUV","trades":1,"tokenId":"0x2f206a66878c7ea69583352fedf4ff5ee26cb9d1","avgCostUsd":0,"oversoldQty":0,"realizedUsd":0,"lastPriceUsd":null,"unrealizedUsd":0,"currentBalance":0,"unpricedTrades":1,"untrackedProceedsUsd":0},{"symbol":"ARB (Visit: t.me/s/arb_pool)","trades":1,"tokenId":"0xd8163cca0a1f3704c93c20cf2fe974db770a7695","avgCostUsd":0,"oversoldQty":0,"realizedUsd":0,"lastPriceUsd":null,"unrealizedUsd":0,"currentBalance":0,"unpricedTrades":1,"untrackedProceedsUsd":0}],"timestamp":"2026-06-18T04:55:06.893Z"}},"exampleRequest":{"chain":"base","method":"fifo","address":"0x1234567890123456789012345678901234567890"},"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_qtpGDvmjaFDbCh5Huf6K4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes realized and unrealized profit/loss for an EVM wallet over a configurable time window, with per-token breakdown and multiple cost-basis methods","exampleAgentPrompt":"What's the realized and unrealized P&L for wallet 0xAbC...123 on Ethereum over the last 30 days using FIFO cost basis — break it down by token?","exampleUseCases":null,"resultDescription":"Returns total realized P&L, total unrealized P&L, and a per-token breakdown including each token's weighted-average cost basis, current mark-to-market value, and individual realized/unrealized gains. Any trades that could not be priced are surfaced separately under coverage.unpricedTrades. Gas fee USD attribution is not included in v1.0.","failureModes":["Invalid or malformed wallet address returns 400 error","Unsupported chain value returns validation error","'from' timestamp after 'to' timestamp returns invalid range error","Network timeout or upstream data source failure returns 5xx","Wallet with no transaction history returns zero P&L with empty token breakdown","x402 payment failure or insufficient USDC returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need detailed profit/loss accounting for an EVM wallet with configurable cost-basis methods (FIFO, LIFO, HCFO), especially when you need per-token breakdown with mark-to-market valuation. Prefer this over generic balance endpoints when trading performance analysis or tax-relevant P&L computation is the goal. Best suited for single-chain analysis per call on Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche, or BNB.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:02.135Z","isFirstParty":false}