← Back to directory

Send your buy/sell trades (JSON list of {side, amount, price, fee, time, asset})...

https://agents.204-168-199-108.sslip.io/v1/crypto/cost-basis

Overview

Send your buy/sell trades (JSON list of {side, amount, price, fee, time, asset}) and a method (fifo, lifo, hifo, average) → per asset: realized gain per sale with the exact lots used and holding days, short-term vs long-term gain (default 365-day line), remaining amount, open lots, remaining cost basis and average cost, and unrealized gain at current_price / current_prices. Fees are added to cost and deducted from proceeds; overselling is rejected. For portfolio, accounting a

Protocol x402
Price $0.0020
Payment Asset USD Coin
Payment Network Base
Category crypto/wallet
Provider Crypto cost basis gains calc
Source bazaar
Indexed 2026-12-04 06:27:17

Health

Status healthy
Latency (p50) 118ms
Uptime (30d) 100.0%
Reliability Score 95/100
Last Checked 2026-12-05 18:38:11
Last Healthy 2026-12-05 18:38:11
Consecutive Failures 0

x402 Payment Validation

Payment Requirements Valid
Asset Verified Known USDC
Facilitator —

Input Schema

{ "method": "GET", "queryParams": { "current_price": "95000", "method": "fifo", "trades": "[{\"side\":\"buy\",\"amount\":0.5,\"price\":60000,\"fee\":15,\"time\":\"2024-01-10\",\"asset\":\"BTC\"},{\"side\":\"buy\",\"amount\":0.3,\"price\":90000,\"fee\":10,\"time\":\"2025-03-02\",\"asset\":\"BTC\"},{\"side\":\"sell\",\"amount\":0.6,\"price\":98000,\"fee\":20,\"time\":\"2025-06-15\",\"asset\":\"BTC\"}]" }, "type": "http" }

Output Schema

{ "example": { "assets": [ { "asset": "BTC", "average_cost": 90033.33333333, "current_price": 95000, "long_term_gain": 18968.33, "market_value": 19000, "open_lots": [ { "amount": 0.2, "from_trade": 1, "unit_cost": 90033.33333333 } ], "realized_gain": 19761.67, "remaining_amount": 0.2, "remaining_cost_basis": 18006.67, "sales": [ { "amount": 0.6, "cost_basis": 39018.33, "gain": 19761.67, "lots_used": [ { "amount": 0.5, "from_trade": 0, "holding_days": 522, "term": "long", "unit_cost": 60030 }, { "amount": 0.1, "from_trade": 1, "holding_days": 105, "term": "short", "unit_cost": 90033.33333333 } ], "proceeds": 58780, "trade": 2 } ], "short_term_gain": 793.33, "trades": 3, "unrealized_gain": 993.33 } ], "method": "fifo", "note": "Fees are added to buy cost and deducted from sale proceeds. Holding > 365 days = long term. Trade numbers refer to your input order. Not tax advice — rules differ by country.", "sorted_by_time": true, "total_long_term_gain": 18968.33, "total_realized_gain": 19761.67, "total_short_term_gain": 793.33, "total_unrealized_gain": 993.33 }, "type": "json" }

Recent Health Checks

Time Status HTTP Latency Error
2026-12-05 18:38:11 healthy 402 141ms
2026-12-05 17:41:32 healthy 402 118ms
2026-12-05 16:40:26 healthy 402 110ms
2026-12-05 15:38:59 healthy 402 110ms
2026-12-05 14:39:40 healthy 402 126ms
2026-12-05 13:38:47 healthy 402 133ms
2026-12-05 12:38:37 healthy 402 113ms
2026-12-05 11:43:26 healthy 402 204ms
2026-12-05 10:39:39 healthy 402 118ms
2026-12-05 09:38:09 healthy 402 110ms
2026-12-05 08:41:43 healthy 402 111ms
2026-12-05 07:37:56 healthy 402 116ms
2026-12-05 06:35:31 healthy 402 131ms
2026-12-05 05:36:02 healthy 402 110ms
2026-12-05 03:47:34 healthy 402 203ms
2026-12-05 02:38:04 healthy 402 1361ms
2026-12-05 01:37:10 healthy 402 112ms
2026-12-05 01:00:44 healthy 402 119ms
2026-12-04 20:51:29 healthy 402 355ms