81trust / 100

Portfolio Attribution

by U2A in Onchain & crypto

x402 APIPassing, checked 36 min ago

Deterministic portfolio performance attribution vs BTC, ETH, stETH or any benchmark. Returns Modified Dietz and money-weighted (XIRR) returns, per-position contribution and alpha, per-input source status and per-position data status with the reason, and a hashed (optionally EIP-191 signed) record of the calculation. No LLM.

POST https://www.u2a.com.au/api/mcp/portfolio-attribution

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
201 ms typical, 201 ms slowest 5%
Last check
36 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://www.u2a.com.au/api/mcp/portfolio-attribution" \
  -H "content-type: application/json" \
  -d '{"benchmarks":[{"end_price":112000,"id":"BTC","start_price":94000},{"end_price":3900,"id":"stETH","income_return":{"status":"estimated","value":0.022},"start_price":3300}],"currency":"USD","period":{"end":"2026-09-30","start":"2026-01-01"},"positions":[{"end_value":{"source":"coingecko close 2026-09-30","status":"verified","value":12600},"flows":[{"amount":2000,"date":"2026-04-01","source":"tx 0xdef…","status":"verified"}],"id":"ETH","start_value":{"source":"wallet 0xabc…, block 21500000","status":"verified","value":10000}},{"end_value":4200,"flows":[{"amount":-1000,"date":"2026-06-15","source":"article","status":"estimated"}],"id":"SOL","start_value":5000}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fwww.u2a.com.au%2Fapi%2Fmcp%2Fportfolio-attribution
const res = await pay("https://www.u2a.com.au/api/mcp/portfolio-attribution", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"benchmarks":[{"end_price":112000,"id":"BTC","start_price":94000},{"end_price":3900,"id":"stETH","income_return":{"status":"estimated","value":0.022},"start_price":3300}],"currency":"USD","period":{"end":"2026-09-30","start":"2026-01-01"},"positions":[{"end_value":{"source":"coingecko close 2026-09-30","status":"verified","value":12600},"flows":[{"amount":2000,"date":"2026-04-01","source":"tx 0xdef…","status":"verified"}],"id":"ETH","start_value":{"source":"wallet 0xabc…, block 21500000","status":"verified","value":10000}},{"end_value":4200,"flows":[{"amount":-1000,"date":"2026-06-15","source":"article","status":"estimated"}],"id":"SOL","start_value":5000}]}),
});
console.log(await res.json());

Example input

{
  "benchmarks": [
    {
      "end_price": 112000,
      "id": "BTC",
      "start_price": 94000
    },
    {
      "end_price": 3900,
      "id": "stETH",
      "income_return": {
        "status": "estimated",
        "value": 0.022
      },
      "start_price": 3300
    }
  ],
  "currency": "USD",
  "period": {
    "end": "2026-09-30",
    "start": "2026-01-01"
  },
  "positions": [
    {
      "end_value": {
        "source": "coingecko close 2026-09-30",
        "status": "verified",
        "value": 12600
      },
      "flows": [
        {
          "amount": 2000,
          "date": "2026-04-01",
          "source": "tx 0xdef…",
          "status": "verified"
        }
      ],
      "id": "ETH",
      "start_value": {
        "source": "wallet 0xabc…, block 21500000",
        "status": "verified",
        "value": 10000
      }
    },
    {
      "end_value": 4200,
      "flows": [
        {
          "amount": -1000,
          "date": "2026-06-15",
          "source": "article",
          "status": "estimated"
        }
      ],
      "id": "SOL",
      "start_value": 5000
    }
  ]
}

Example output

{
  "jsonrpc": "2.0",
  "result": {
    "benchmarks": [
      {
        "excess_return": -0.14131643,
        "id": "BTC",
        "return": 0.19148936,
        "top_alpha_detractors": [
          {
            "active_contribution": -0.09853659,
            "id": "ETH"
          }
        ]
      }
    ],
    "portfolio": {
      "data_status": "estimated",
      "data_status_reason": "Weakest input: SOL flow on 2026-06-15 is \"estimated\" (source: article).",
      "money_weighted_return_period": 0.05018879,
      "pnl": 800,
      "return": 0.05017293
    },
    "positions": [
      {
        "active_contribution": {
          "BTC": -0.09853659
        },
        "contribution": 0.0376297,
        "data_status": "verified",
        "id": "ETH",
        "weight": 0.71109062
      }
    ],
    "provenance": {
      "attests": "calculation",
      "result_hash": "0x…"
    },
    "reconciliation": {
      "portfolio_return": 0.05017293,
      "sum_of_contributions": 0.05017293
    }
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
36 min agoPassed402201 ms$0.01
4 h agoPassed402306 ms$0.01
9 h agoPassed402179 ms$0.01