{
  "schema": "chainiq.workpaper-pricing.v2",
  "currency": "USDC",
  "network": "Base",
  "unit": "one CSV workpaper for one selected method",
  "input": "customer-supplied USD spot trade fills",
  "hummingbot": {
    "guide": "https://kcbsolutions.org/x402/hummingbot",
    "converter": "https://kcbsolutions.org/x402/hummingbot.py",
    "exampleWorkpaper": "https://kcbsolutions.org/x402/hummingbot-workpaper.csv"
  },
  "annualIngestionPilot": "https://kcbsolutions.org/x402/annual-pilot.json",
  "filingExport": {
    "format": "gain/loss statement PDF",
    "availability": "available-for-records-or-preparer-review",
    "checkoutAvailable": true,
    "checkout": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/api/v1/calculate-tax",
    "product": "2025 FIFO gain/loss statement",
    "taxYear": 2025, "method": "FIFO", "source": "authorized supplied spot fills",
    "client": "https://kcbsolutions.org/x402/bulk_upload.py",
    "agentGuide": "https://kcbsolutions.org/x402/statement-2025.json",
    "exampleInput": "https://kcbsolutions.org/x402/statement-2025-example.json",
    "prepare": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/api/v1/bulk/uploads/{upload}/statement",
    "premiumUSDC": "5.00", "minimumBundleUSDC": "5.05", "maximumBundleUSDC": "50.00",
    "priceRule": "One private PDF with the exact FIFO CSV attached costs the fill-count workpaper price plus 5 USDC. Present proof of purchase of the same CSV during its active upload to pay only 5 USDC.",
    "eligibility": {"maximumAllocations":1000,"maximumCsvBytes":2097152,"completeBasisRequired":true,"exactUSDCentsRequiredPerAllocation":true,"requiresFreePreparation":true},
    "instructions": "Prepare an original with bulk_upload.py prepare trades.json --statement-2025 INVENTORY --state pdf-order. Use a stable non-identifying inventory label and match inventoryRef when present. Sign the returned exact Base USDC offer, pay, then collect --state pdf-order --output statement.pdf.",
    "correction": "Prepare a fresh copy of the revised trade file with the same inventory label, a new state directory and --replaces PRIOR_PDF_STATE. Keep the original private state and receipt. Each purchased replacement identifies its predecessor. Corrections are separately priced.",
    "previouslyPaidCsv": "Pass --paid-csv PAID_FIFO_STATE for the exact same active upload and a separate PDF state. The client verifies the same input and the seller verifies prior settlement. If correcting, the same private recovery key must cover the prior statement and revised upload.",
    "incomplete": "Unresolved or out-of-scope trades cannot produce a payable statement. A fractional-cent allocation returns needs_review with the allocation ID and affected field. The verified CSV preserves exact fractions.",
    "recovery": "Unpaid uploads expire 24 hours after creation. Recover the same PDF for one hour after confirmed settlement. Keep local copies of your file and order state for future corrections.",
    "preview": "https://kcbsolutions.org/x402/example-2025-review-statement.pdf",
    "sample": "https://kcbsolutions.org/x402/example-2025-gain-loss.pdf",
    "correctedSample": "https://kcbsolutions.org/x402/example-2025-gain-loss-corrected.pdf",
    "actual2025Import": {"sales":3,"proceedsUSD":"520.00","originalBasisUSD":"425.00","originalGainUSD":"95.00","correctedBasisUSD":"440.00","correctedGainUSD":"80.00"},
    "taxYear2026": "Independent synthetic PDF fixture prepared. TurboTax 2026 import verification pending.",
    "testedDestination": "TurboTax Online Do It Yourself Premium, U.S. individual, tax year 2025",
    "verifiedIn": "2026-09",
    "priorYearSelfService": "Intuit directs new or unfinished DIY 2025 returns to Desktop. An already-filed return may offer an online amendment in the original account. ChainIQ has not verified PDF import in the amendment flow or Desktop.",
    "amendmentInstructions": "https://ttlc.intuit.com/turbotax-support/en-us/help-article/tax-return/amend-change-correct-return-already-filed/L4VjJ9BA2_US_en_US",
    "priorYearInstructions": "https://ttlc.intuit.com/turbotax-support/en-us/help-article/printers-printing/finish-prior-year-return-started-turbotax-online/L9Oe4M90A_US_en_US",
    "testedScope": "Two historical example PDFs with three fictional sale allocations. The personalized statement layout is for records or preparer review. Import of this layout, the 2026 edition and final tax forms remain unverified."
  },
  "minFills": 1,
  "maxFills": 200000,
  "lookup": {
    "method": "GET",
    "urlTemplate": "https://kcbsolutions.org/x402/pricing.json?fills={fills}",
    "methodUrlTemplate": "https://kcbsolutions.org/x402/pricing.json?fills={fills}&method={method}",
    "routeUrlTemplate": "https://kcbsolutions.org/x402/pricing.json?fills={fills}&method={method}&assetScope={assetScope}",
    "assetScopes": ["btc-eth-sol", "declared-assets"],
    "assetScopeFilter": "Use btc-eth-sol only when every fill uses the plain BTC, ETH or SOL symbol. Use declared-assets when any other instrument is present, or when you must preserve a venue instrument, network, contract or mint identity. Mixed books use declared-assets. These categories describe the input without sending asset identifiers.",
    "routing": "Supply all three parameters to receive purchaseRoute, firstRequest, tradeSchema and the exact amount. A quick order posts its trades directly, skipping upload staging. For a bulk order, first prepare the upload using the client. When checkoutAvailable is false, do not pay. All four methods use the same fill limit and price schedule.",
    "methodFilter": "Optionally specify FIFO, LIFO, HIFO or OPTIMIZED_HIFO with the fill count. Every method supports 1–200,000 eligible supplied fills. maxFillsForMethod gives its live limit.",
    "fills": "One whole-number count from 0 to 200000.",
    "instructions": "amountAtomic is the exact price in millionths of USDC. When bulkUpload is present, stage the selected method and POST its ready request to bulkCheckout. Eligible quick orders use checkout with the trade JSON directly. Only authorize an available quote for your chosen method."
  },
  "inputRequirements": {
    "tradeTypes": ["buy", "sell"],
    "priceCurrency": "USD",
    "feeCurrency": "USD",
    "schema": "chainiq.spot-trades.v2",
    "source": "Supply normalized spot fills for one inventory. Declare each fungible asset by venue and instrument code, native network asset, EVM ERC-20 contract, or Solana token mint. Give distinct asset IDs for distinct instruments and one known opening per asset.",
    "maxAssets": 256,
    "maxRequestBytes": 33554432,
    "maxResultBytes": 16777216,
    "eventScope": "Executed spot buys and sells with explicit USD unit prices and fees, acquisition history and supported precision. Wallet addresses alone, transfers, NFTs, derivatives and raw chain history are outside this workpaper."
  },
  "available": {
    "scope": "quick checkout",
    "schema": "chainiq.fifo-trades.v1",
    "supportedAssets": ["BTC", "ETH", "SOL"],
    "minFills": 1,
    "maxFills": 128,
    "amountUSDC": "0.05",
    "methods": ["FIFO", "LIFO", "HIFO", "OPTIMIZED_HIFO"],
    "checkout": "https://chainiq-fifo-59967844018.us-east1.run.app/checkout",
    "discovery": "https://chainiq-fifo-59967844018.us-east1.run.app/.well-known/chainiq-fifo.json",
    "agentCheckout": "https://chainiq-fifo-59967844018.us-east1.run.app/api/v1/calculate-tax"
  },
  "bulk": {
    "methods": ["FIFO", "LIFO", "HIFO", "OPTIMIZED_HIFO"],
    "filingMethod": "FIFO",
    "comparisonMethods": ["LIFO", "HIFO", "OPTIMIZED_HIFO"],
    "status": "available",
    "method": "FIFO",
    "minFills": 1,
    "maxFills": 200000,
    "upload": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/api/v1/bulk/uploads",
    "agentCheckout": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/api/v1/calculate-tax",
    "discovery": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/.well-known/chainiq-bulk.json",
    "openapi": "https://kcbsolutions.org/x402/bulk-openapi.json",
    "directoryOpenapi": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/openapi.json",
    "example": "https://bulk---chainiq-fifo-hpdt6vofhq-ue.a.run.app/example.json",
    "client": "https://kcbsolutions.org/x402/bulk_upload.py",
    "instructions": "Use --method FIFO, LIFO, HIFO or OPTIMIZED_HIFO with the public client’s prepare command. Then authorize, pay and collect. Preparing an upload is free. Before signing, approve the exact amount for the returned ready request. Resume unpaid uploads for 24 hours from creation. A confirmed paid result can be recovered for one hour.",
    "pricingRule": "Interpolate linearly between adjacent fill counts. Round the total once to the nearest 0.000001 USDC, with ties rounded up.",
    "examples": [
      {"fills": 129, "amountUSDC": "0.050516"},
      {"fills": 500, "amountUSDC": "0.241972"},
      {"fills": 999, "amountUSDC": "0.499484"}
    ],
    "pricePoints": [
      {"fills": 128, "amountUSDC": "0.05"},
      {"fills": 1000, "amountUSDC": "0.50"},
      {"fills": 10000, "amountUSDC": "2.50"},
      {"fills": 25000, "amountUSDC": "10.00"},
      {"fills": 100000, "amountUSDC": "25.00"},
      {"fills": 200000, "amountUSDC": "45.00"}
    ]
  }
}
