AutoTax is a secure, automated, on-chain accounting and tax logging system that tracks all taxable events for crypto users and DAOs. Using MetaMask Smart Accounts, Envio, and the Monad testnet,
AutoTax is a secure, automated, on-chain accounting and tax logging system that tracks all taxable events for crypto users and DAOs. Using MetaMask Smart Accounts, Envio, and the Monad testnet, it automatically indexes, categorizes, and exports all wallet activity โ including swaps, staking rewards, income, and transfers โ into audit-ready reports.
It allows users to delegate a smart agent to act on their behalf, eliminating the need to manually track taxable events while maintaining full security and control of funds.
Cryptocurrency taxation is complex and often manual. Users must:
Track trades, staking rewards, and income across multiple wallets and chains.
Calculate gains/losses per token for accurate filing.
Export reports to centralized software (or manually compute).
Manual tracking is error-prone, especially for high-frequency traders or users with multiple chains.
Existing solutions require sharing private keys or trusting centralized services, introducing security risks.
There is no fully decentralized, delegated, automated on-chain tax tracker currently.
AutoTax solves this by providing:
Delegated Smart Agent โ Users grant a MetaMask Smart Account delegation to a smart agent that can track transactions, classify them, and generate reports without accessing private keys.
Event-Driven Indexing with Envio โ Monitors wallet activity on-chain, including swaps, staking rewards, and income events. Emits triggers to the agent in real time.
Execution on Monad Testnet โ The delegated agent operates securely through Monad, logging events and storing reports on-chain or exporting to IPFS/Google Sheets.
Auto-Categorization & Reporting โ Classifies events into categories (income, capital gains, staking rewards, transfers) and automatically generates CSV/JSON reports ready for filing or accounting.
| Feature | Description | 
|---|---|
| Delegated Agent | Securely tracks wallet activity using scoped permissions via MetaMask Smart Accounts. | 
| Event Indexing | Envio monitors on-chain events like swaps, staking rewards, and transfers. | 
| Automated Categorization | Classifies transactions into taxable categories automatically. | 
| Cross-Chain Ready | Can monitor multiple chains if delegation allows. | 
| Report Export | CSV export to IPFS, Google Sheets, or backend for audit. | 
| Security | Users maintain full control; agent only reads and logs transactions, cannot spend funds. | 
Automatically logs every trade and swap on Monad testnet, categorizes capital gains/losses, and exports a CSV ready for filing.
Logs staking rewards received on multiple protocols and calculates taxable income automatically.
Tracks payouts, payroll, and treasury transfers automatically and generates compliance-ready reports.
[User Dashboard / UI]
        โ
        โโโ (1) Create MetaMask Smart Account
        โ
        โโโ (2) Grant delegation to AutoTax Agent (read-only for tax events)
        โ
        โผ
[MetaMask Smart Account + Delegation]
        โ
        โโโ Stores delegation policy โ authorizes Agent to track events
                         โ
[Envio Indexer] โ Monitors on-chain events
                         โ
                         โโโ Transaction events: swap, reward, transfer
                         โ
                         โโโ Pushes triggers / proofs โ AutoTax Agent
                                     โ
                                     โโโ Validates delegation & event proof
                                     โ
                                     โโโ Categorizes transaction: income, capital gain, reward
                                     โ
                                     โโโ Stores in Monad smart contract OR exports CSV to IPFS/Google Sheets
MSA is used as a secure wallet abstraction.
Delegates read-only permission to AutoTax Agent for tracking wallet activity.
Delegation is scoped, revocable, and time-limited.
Example Delegation JSON:
{
  "delegate": "0xAgentAddress",
  "allowed_actions": ["readTransactions", "logEvents", "exportReports"],
  "chains": ["MonadTestnet"],
  "expires_at": 1750000000,
  "require_envio_proof": true
}
Receives Envio events.
Validates event proofs and delegation policies.
Categorizes events automatically into:
Swaps โ capital gains/losses
Staking rewards โ income
Transfers โ non-taxable or internal
Generates CSV/JSON reports.
Optionally uploads reports to IPFS or pushes to Google Sheets API.
Monitors:
Token swaps (DEX, AMM)
Staking reward distributions
Incoming/outgoing transfers
Sends signed event proofs to AutoTax Agent for validation.
Example Event Payload:
{
  "type": "SWAP",
  "wallet": "0xUserWallet",
  "from_token": "ETH",
  "to_token": "USDC",
  "amount": "1.5",
  "price_usd": "3000",
  "chain": "Monad",
  "timestamp": 1750001234,
  "proof": "0xEnvioSignedProof"
}
TransactionLog.sol โ logs all categorized taxable events on-chain.
ReportExport.sol โ optional contract storing CSV hashes for audit or IPFS link storage.
Example Solidity logging function:
function logTransaction(
    address user,
    string calldata category,
    string calldata txHash,
    uint256 amountUSD
) external onlyDelegatedAgent {
    transactions[user].push(TxRecord(category, txHash, amountUSD));
    emit TransactionLogged(user, category, txHash, amountUSD);
}
Scenario: User wants AutoTax to track swaps and staking rewards.
Delegation: User grants AutoTax Agent permission to read transactions from MSA.
Envio: Indexer detects swap of 2 ETH โ USDC.
Envio pushes event proof to AutoTax Agent.
Agent validates proof and delegation policy.
Categorization: Agent classifies as "Capital Gain."
Log & Export: Stored on-chain on Monad + exported to CSV on IPFS.
Repeat: Agent continuously tracks and categorizes all events automatically.
Fully delegated and secure โ no private key exposure.
Automated and continuous โ no manual tracking needed.
Audit-ready reporting โ logs stored on-chain and IPFS for proof of accuracy.
Cross-chain ready โ can extend to Polygon, Arbitrum, or Ethereum Mainnet with Envio indexing.
User-friendly dashboard โ easy CSV export, Google Sheets sync, or PDF reporting.
Frontend: Next.js dashboard to create MSA, grant delegation, and view categorized events.
Envio Integration: Subscribes to wallet activity for swaps, rewards, and transfers.
AutoTax Agent: Receives events, validates delegation, categorizes transactions.
Logging: Logs categorized events to Monad smart contract or local DB/IPFS.
Export: Generates CSV/JSON report for user download.
# Clone repo
git clone https://github.com/yourusername/autotax
cd autotax
npm install
# Deploy contracts to Monad Testnet
npx hardhat run scripts/deploy.js --network monadTestnet
# Start AutoTax Agent
npm run agent
# Run Frontend Dashboard
npm run dev
Create MetaMask Smart Account and grant delegation.
Trigger test swap on Monad.
Envio detects event and pushes proof to AutoTax Agent.
Agent categorizes transaction and logs on-chain.
Export CSV/JSON and show audit-ready report.
Optional: show staking reward event being tracked automatically.
Delegation: Scoped, time-limited, read-only permissions.
Event Validation: Only Envio-signed events are acted upon.
Immutable Logs: On-chain transaction logs provide tamper-proof audit trail.
Emergency Revocation: User can revoke delegation at any time.
| Layer | Technology | 
|---|---|
| Smart Wallet & Delegation | MetaMask Smart Accounts | 
| Event Indexing | Envio | 
| Execution Layer | Monad Testnet | 
| Backend / Agent | Node.js / Express / Serverless Functions | 
| Smart Contracts | Solidity + Hardhat | 
| Frontend | Next.js + React + Tailwind | 
| Data Storage | IPFS / Google Sheets / MongoDB (optional) | 
Solves a real-world crypto problem: Tax tracking and reporting automation.
Secure and delegated: No private keys shared.
End-to-end automated pipeline: Event indexing โ delegation โ classification โ report export.
Cross-chain potential: Can track assets across multiple chains for full automation.
MIT License ยฉ 2025 AutoTax: On-Chain Tax Logger
na
na