{"uid":"cap_gjPefkJyPPxBM_kuxeHvK","slug":"evm-canon-base-average-cost-basis-acb-calculator-6e841587","name":"EVM Canon Base – Average Cost Basis (ACB) Calculator","description":"Average cost basis: every acquisition pooled at a running average unit cost, with realized gain per disposal","url":"https://evm-canon-base.onrender.com/lots/acb","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["trades"],"properties":{"trades":{"type":"array","items":{"type":"object","required":["side","asset","amount","price","time"],"properties":{"fee":{"type":"string"},"side":{"enum":["buy","sell"],"type":"string"},"time":{"description":"unix seconds/millis or ISO-8601"},"asset":{"type":"string"},"price":{"type":"string","description":"unit price in the quote currency"},"amount":{"type":"string","description":"decimal string, never a float"}}}}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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":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_y8-HHW0LFyu2QykaItgFj","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 average cost basis for crypto asset disposals by pooling all acquisitions at a running average unit cost and returning realized gain per disposal","exampleAgentPrompt":"Can you calculate my average cost basis and realized gains for my ETH trades? Here are my acquisitions and disposals — I need the ACB method where all purchases are pooled into a running average unit cost.","exampleUseCases":[{"title":"Crypto tax reporting for accountant","prompt":"I need to calculate my realized gains on all my USDC and ETH trades this year using the average cost basis method — can you pool all my buys together and tell me the gain or loss on each sale?"},{"title":"DeFi portfolio gain/loss tracking","prompt":"I've been swapping tokens on-chain all year. Can you run an ACB calculation on my trade history so I know my average cost per token and how much I've realized in gains each time I sold?"},{"title":"Automated cost basis for trading bot","prompt":"My trading bot just executed a disposal of 500 LINK. Using the average cost basis method with all my prior LINK acquisitions pooled, what is the realized gain on this disposal?"}],"resultDescription":"Returns a per-disposal breakdown showing the average unit cost computed from all pooled acquisitions up to that point, the quantity disposed, total cost basis for the disposal, proceeds, and the realized gain or loss. The running average unit cost updates with each new acquisition.","failureModes":["Missing or malformed trade records causing computation errors","Disposals exceeding total acquired quantity resulting in invalid state","Unsupported asset identifiers or missing decimals","Malformed request body returning 400 Bad Request","Service unavailability returning 503 after cold start on Render free tier","Payment failure or insufficient USDC returning 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need the Average Cost Basis (ACB) method — also called the pooled cost method — where all acquisitions of an asset are blended into a single running average unit cost rather than matched lot-by-lot. This is the required method in Canada and some other jurisdictions, and is simpler than FIFO or HIFO. Prefer this over the HIFO sibling endpoint when minimizing tax liability lot-by-lot is not the goal, and over the net-position endpoint when realized gain per disposal (not just net holdings) is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:48:35.783Z","isFirstParty":false}