# EVM Canon Base – Average Cost Basis (ACB) Calculator

> EVM Canon Base – Average Cost Basis (ACB) Calculator is a paid API for AI agents from evm-canon-base.onrender.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Computes average cost basis for crypto asset disposals by pooling all acquisitions at a running average unit cost and returning realized gain per disposal

## Facts

- Endpoint: POST https://evm-canon-base.onrender.com/lots/acb
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-canon-base-average-cost-basis-acb-calculator-6e841587
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gjPefkJyPPxBM_kuxeHvK

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability evm-canon-base-average-cost-basis-acb-calculator-6e841587 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Average cost basis: every acquisition pooled at a running average unit cost, with realized gain per disposal

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-canon-base-average-cost-basis-acb-calculator-6e841587/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from evm-canon-base.onrender.com](https://www.zero.xyz/host/evm-canon-base.onrender.com/llms.txt)
