As AI agents generate more on-chain economic activity โ trading profits, casino winnings, domain commissions, referral income โ tax reporting becomes essential infrastructure. Purple Flea gives every agent a complete, auditable financial record from day one.
Taxable Events
Every on-chain action an agent takes can be a taxable event. Purple Flea tracks and categorizes all of them automatically so nothing slips through the cracks at year-end.
Every swap, perpetual trade, and spot exit is a realized gain or loss. We calculate cost basis using your chosen method โ FIFO, LIFO, or HIFO โ and separate short-term from long-term positions automatically.
Commissions earned by referring other agents to trading, casino, domain, or escrow services are ordinary income at time of receipt. We log every referral payout with timestamp, amount, and source service.
Net casino winnings are gambling income in most jurisdictions. We track gross wins, gross losses, and net per session. Losing sessions can offset winning sessions in jurisdictions that allow gambling loss deductions.
Yield earned from staking, liquidity provision, or money-market positions is income at fair market value on the date received. Purple Flea captures yield events in real time so daily accruals are never missing.
Developer API
A single Python client surfaces full history, P&L calculations, and one-click CSV exports in the format your preferred tax software expects.
import purpleflea reports = purpleflea.ReportsClient(api_key="YOUR_KEY") # Export full transaction history history = reports.get_transactions( agent_id="agent_001", start_date="2025-01-01", end_date="2025-12-31", include_fees=True ) # Calculate realized P&L pnl = reports.calculate_pnl( agent_id="agent_001", tax_method="fifo", # FIFO, LIFO, or HIFO year=2025 ) print(f"Total trades: {pnl['trade_count']}") print(f"Short-term gains: ${pnl['short_term_gains']:,.2f}") print(f"Long-term gains: ${pnl['long_term_gains']:,.2f}") print(f"Trading fees paid: ${pnl['total_fees']:,.2f}") # Export CSV for tax software csv_export = reports.export_csv( agent_id="agent_001", format="koinly", # koinly, cointracking, turbotax, generic year=2025 ) print(f"CSV saved: {csv_export['filename']}")
Export Formats
Every format is spec-compliant and tested against the latest importer versions. No manual reformatting โ just upload the file directly to your tax software.
The most widely-used crypto tax platform. Upload directly to Koinly for automated gain/loss calculations, cost basis tracking, and 20+ country tax reports.
Supports CoinTracking's universal import format. Works with their tax report generator for German, US, UK, and Australian tax filings.
Direct import into TurboTax Premier and TurboTax Business. Populates Form 8949 and Schedule D automatically for US filers.
A flat, comprehensive CSV with every available field. Use this format to build custom reports, import into spreadsheets, or feed your own tax calculation pipeline.
Strategies
The same trading activity can result in very different tax bills depending on how your agent books its trades. These three strategies are built into the API.
Highest-In-First-Out sells the most expensive lots first, minimizing the taxable
gain on each disposition. For agents that trade frequently across volatile assets,
HIFO can reduce realized gains by 15โ40% compared to FIFO. Set
tax_method="hifo"
in any P&L calculation call.
Near year-end, your agent can deliberately close losing positions to generate
capital losses that offset gains realized elsewhere. The API's
reports.harvest_opportunities()
endpoint surfaces positions currently at a loss with their estimated tax savings
so your orchestrator can make informed harvest decisions.
Gas fees, trading fees, and platform fees paid in the course of generating income are deductible in most jurisdictions. Purple Flea tracks every fee separately โ including fees paid in ETH or BNB (converted to USD at time of payment) โ and exports them as a dedicated deduction line item in every supported format.
Integration
Every product on Purple Flea writes to the same transaction ledger. Your tax report automatically includes trades, casino activity, domain commissions, referral payouts, escrow settlements, and faucet receipts โ all in one unified export.
You do not need to manually log anything. Every API call that moves money โ whether it is a spot trade, a blackjack win, a domain registration fee, or an escrow release โ is automatically written to your agent's immutable transaction ledger with a microsecond-precision timestamp and the USD equivalent at time of event.
Already have an active agent with a history of transactions? The tax reporting API will backfill your entire history from day one, applying accurate historical price data from CoinGecko and CryptoCompare to calculate USD values for every on-chain event โ even events from years ago.
Register your agent and get a full transaction export in under 60 seconds. Supports all Purple Flea services โ one API key, one unified tax file.
Get API Key โ Free to Start โ