{"uid":"cap_E4eh18797ra-jG7zDK5hO","slug":"u2a-portfolio-attribution-909fccb1","name":"U2A Portfolio Attribution","description":"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.","url":"https://www.u2a.com.au/api/mcp/portfolio-attribution?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"period":{"type":"object","required":["start","end"],"properties":{"end":{"type":"string","format":"date","description":"Last day of the measurement period (YYYY-MM-DD)."},"start":{"type":"string","format":"date","description":"First day of the measurement period (YYYY-MM-DD)."}},"description":"The measurement period."},"currency":{"type":"string","default":"USD","description":"Currency label for all values; no conversion is done."},"positions":{"type":"array","items":{"type":"object","required":["id","start_value","end_value"],"properties":{"id":{"type":"string","description":"Ticker, token symbol, contract address, or internal id."},"flows":{"type":"array","items":{"type":"object","required":["date","amount"],"properties":{"date":{"type":"string","format":"date","description":"Date the money moved (inside the period)."},"amount":{"type":"number","description":"Positive = bought / added capital; negative = sold / withdrew."},"source":{"type":"string","description":"Where the flow came from, e.g. a tx hash or statement."},"status":{"enum":["verified","derived","provided","estimated","assumed"],"type":"string","description":"How reliable this flow is. Default \"provided\"."}}},"maxItems":1000,"description":"Capital moved into (+) or out of (−) the position during the period. At most 1000 flows in total across all positions."},"income":{"type":["number","object"],"description":"Cash income taken out (staking, dividends). Default 0. Number, or object shaped like start_value."},"end_value":{"type":["number","object"],"description":"Market value at period end. Number, or object shaped like start_value."},"start_value":{"oneOf":[{"type":"number","minimum":0},{"type":"object","required":["value"],"properties":{"value":{"type":"number","minimum":0,"description":"The number."},"source":{"type":"string","maxLength":500,"description":"URL, tx hash, block, file or API."},"status":{"enum":["verified","derived","provided","estimated","assumed"],"type":"string","description":"How it was obtained. Default \"provided\"."},"observed_at":{"type":"string","format":"date-time","description":"When observed (ISO)."}}}],"description":"Market value at period start. A number, or {value, status, source, observed_at}."}}},"maxItems":500,"minItems":1,"description":"Holdings to analyse (max 500), each with start/end value and any money moved in or out."},"benchmarks":{"type":"array","items":{"type":"object","required":["id","start_price","end_price"],"properties":{"id":{"type":"string","description":"Benchmark name, e.g. BTC, ETH, stETH."},"end_price":{"type":["number","object"],"description":"Benchmark price at period end. Number, or object shaped like start_value."},"start_price":{"type":["number","object"],"description":"Benchmark price at period start. Number, or object shaped like start_value."},"income_return":{"type":["number","object"],"description":"Extra period return from yield, e.g. 0.022. Default 0. Number, or object shaped like start_value."}}},"maxItems":5,"minItems":1,"description":"Benchmarks to compare against (1-5), e.g. BTC, ETH, or stETH with staking yield."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_nfnsKn1jeGEuvycz0zEDs","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes deterministic Modified Dietz and XIRR portfolio returns with per-position alpha vs BTC, ETH, stETH, or any benchmark, plus a hashed audit trail","exampleAgentPrompt":"Run a portfolio attribution for my three positions — 1 BTC (start value $40,000, end value $65,000), 10 ETH (start value $20,000, end value $28,000), and 500 stETH (start value $950,000, end value $1,100,000) — from 2024-01-01 to 2024-12-31, benchmarked against ETH, and give me the Modified Dietz return, XIRR, per-position alpha, and a signed audit trail in USD.","exampleUseCases":[{"title":"Quarterly crypto fund performance review","prompt":"Calculate our fund's Q1 2024 portfolio performance (January 1 to March 31) in USD: we held 5 BTC starting at $42,000 each ending at $71,000 each, and had two capital inflows of $50,000 on January 15 and $30,000 on February 10. Benchmark it against BTC and give me Modified Dietz return, XIRR, and per-position alpha with an audit hash."},{"title":"DeFi staking yield vs stETH benchmark","prompt":"I have a staking portfolio — 2000 stETH starting value $4,200,000 ending $5,100,000 with $85,000 income received — for the period 2024-06-01 to 2024-09-30. Benchmark it against stETH and show me the money-weighted return, per-position contribution, and a hashed audit trail."},{"title":"Multi-asset attribution with mixed data quality","prompt":"Attribute performance across my four token positions for 2023-01-01 to 2023-12-31: ETH (start $8,000 verified, end $12,000 verified), ARB (start $500 estimated, end $1,200 provided), LINK (start $1,000, end $900, one flow of -$200 on March 15), and MATIC (start $300, end $250). Benchmark against ETH, flag each position's data status, and return per-position alpha plus a signed audit."}],"resultDescription":"Returns Modified Dietz time-weighted returns and XIRR money-weighted returns for the overall portfolio, per-position return contributions and alpha versus the chosen benchmark, field-level data status indicators (verified/derived/provided/estimated/assumed) for each input value, and a deterministic hash (optionally EIP-191 signed) forming an audit trail. No LLM inference is involved — all calculations are deterministic.","failureModes":["Missing required start_value, end_value, or period fields returns a validation error","More than 1000 total flows across all positions triggers a rejection","Flows dated outside the measurement period may cause calculation errors or be rejected","Invalid date format (not YYYY-MM-DD) returns a parsing error","Inconsistent currency labeling across positions may produce misleading aggregates (no FX conversion is performed)","Unrecognized benchmark symbol may return an error or require a custom benchmark price series"],"whenToPreferThis":"Choose this endpoint when you need deterministic, auditable portfolio performance attribution with verifiable calculations — not AI-estimated figures. It is ideal for fund reporting, compliance, or any scenario requiring a cryptographically hashed audit trail. Prefer it over generic analytics when you need Modified Dietz and XIRR side-by-side, per-position alpha versus crypto benchmarks (BTC, ETH, stETH), and data-quality status flags on each input field.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T12:34:38.714Z","isFirstParty":false,"canonicalSlug":"u2a-portfolio-attribution-909fccb1"}