Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aegisintent.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Aegis includes a built in tax loss harvesting engine that scans an agent’s portfolio for unrealized losses, evaluates whether harvesting them would be profitable after gas costs, and optionally executes offsetting trades to realize tax deductible losses.

Audit Ledger

Generate a full tax compliance ledger for an agent’s transaction history:
curl -X GET https://api.aegisintent.xyz/v1/actions/audit/ledger \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Aegis-Email: agent@example.com"

Tax Loss Harvest

Run the harvesting engine in simulation or execution mode:
curl -X POST https://api.aegisintent.xyz/v1/actions/audit/harvest \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Aegis-Email: agent@example.com" \
  -H "Content-Type: application/json" \
  -d '{
    "executionMode": "SIMULATE",
    "taxBracket": 0.30
  }'

Parameters

FieldTypeRequiredDescription
executionModestringNo"SIMULATE" (default) or "HARVEST" for live execution
taxBracketnumberNoTax bracket rate for benefit calculation (default: 0.30)

How It Works

  1. Scans historical trades using FIFO cost basis accounting
  2. Identifies positions with unrealized losses
  3. Evaluates each candidate against gas drag (estimated ~$15 gas cost)
  4. In SIMULATE mode: returns what would happen without executing
  5. In HARVEST mode: executes offsetting trades and logs the results

Response

{
  "success": true,
  "report": {
    "agentId": "...",
    "executionMode": "SIMULATE",
    "candidatesAnalyzedCount": 3,
    "harvestedPositions": [...],
    "netRealizedLossCreatedUsdc": 45.20
  }
}