{"uid":"cap_x-yM5Zt18cQslqZBMwJXw","slug":"orcpin-holding-period-realized-gain-calculator-373667e4","name":"Orcpin Holding-Period & Realized-Gain Calculator","description":"Trade-lot holding-period and realized-gain calculator for trading agents: per-lot days held, the exact date each lot's gain character turns long-term, and FIFO / specific-identification allocation of a proposed sell with realized gain per lot and per-character totals. Deterministic arithmetic on caller-supplied lots with the published threshold cited (IRC §1222: held more than one year) — counts, dates, and dollars only, never advice. Nothing is stored.","url":"https://orcpin.dev/v1/holding-period?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"asOf":{"type":"string","description":"Evaluation date, YYYY-MM-DD (UTC calendar days; no server clock is used)."},"lots":{"type":"array","items":{"type":"object","required":["symbol","acquireDate","quantity"],"properties":{"symbol":{"type":"string"},"account":{"type":"string"},"quantity":{"type":"number"},"costBasis":{"type":"number"},"acquireDate":{"type":"string","description":"YYYY-MM-DD"}}},"description":"Tax lots to evaluate. costBasis (total USD for the lot) is optional — absent means gain math is omitted for that lot."},"sell":{"type":"object","required":["symbol","tradeDate","quantity"],"properties":{"price":{"type":"number"},"method":{"enum":["fifo","as_supplied"],"type":"string"},"symbol":{"type":"string"},"quantity":{"type":"number"},"tradeDate":{"type":"string","description":"YYYY-MM-DD"}},"description":"Optional proposed sell to allocate across the lots (FIFO or as_supplied). price (per share USD) optional."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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":{"p10Cents":"2.0000","medianCents":"2.0000","p90Cents":"2.0000","minCents":"2.0000","maxCents":"2.0000","p95Cents":"2.0000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kgBOCkHv_dyZOM4qtGslC","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates per-lot holding periods, long-term qualification dates, and FIFO/specific-ID realized gains for a proposed sell across supplied tax lots","exampleAgentPrompt":"I have three lots of AAPL — 100 shares acquired 2023-01-15, 50 shares acquired 2023-08-20, and 75 shares acquired 2024-03-10 — with cost bases of $15,000, $8,250, and $13,500 respectively. As of 2025-07-01, calculate how long I've held each lot, when each turns long-term, and if I sell 120 shares at $210 using FIFO, what are my realized gains broken out by short-term and long-term?","exampleUseCases":null,"resultDescription":"Returns a per-lot breakdown showing days held, whether each lot is short- or long-term as of the evaluation date, the exact calendar date each lot qualifies as long-term (IRC §1222: held more than one year), and — if a sell is specified — the lot allocation with realized gain per lot plus aggregated short-term and long-term gain totals. Includes a disclaimer and explanation field. Nothing is persisted.","failureModes":["Missing required 'asOf' date returns validation error","Missing required 'lots' array returns validation error","Invalid date format (non-YYYY-MM-DD) causes parse error","Sell quantity exceeds available lot quantity causes allocation error","Missing costBasis on lots when sell price is provided results in gain math omitted for those lots","Mismatched symbol between sell and lots may return empty allocation"],"whenToPreferThis":"Use this endpoint when you need deterministic, stateless tax-lot arithmetic — specifically holding-period day counts, long-term qualification dates, and realized gain breakdowns by character (short/long) for a proposed sell. Prefer this over generic financial APIs when you need IRC §1222-anchored FIFO or specific-identification lot allocation with no storage or advisory output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:41:15.570Z","isFirstParty":false,"canonicalSlug":"orcpin-holding-period-realized-gain-calculator-373667e4"}