Agent skill

Trade Accounting

by agiprolabs in agiprolabs/claude-trading-skills

Double-entry bookkeeping for trading operations with ledger management, P&L statements, balance sheets, and cash flow reporting

MITAuto-check passedBusiness, Finance & HR

Install Trade Accounting

skills CLI
$ npx skills add agiprolabs/claude-trading-skills --skill trade-accounting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agiprolabs/claude-trading-skills trade-accounting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/trade-accounting .claude/skills/trade-accounting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trade-accounting
GitHub stars
410
Token cost
~3k tokens
SKILL.md length
1,021 words
Files
3 (incl. scripts, references)
Skills in repo
68
Repo updated
First seen
Licence
MIT

At a glance

Double-entry bookkeeping for trading operations with ledger management, P&L statements, balance sheets, and cash flow reporting

  • Works in 6 steps: Track real P&L — Know exactly how much… → Tax preparation — Hand your accountant a… → Fee analysis — Discover that gas and… → …
  • Tasks that involve Accounting and bookkeeping
  • SKILL.md covers Why Traders Need Accounting, Account Types, Double-Entry Bookkeeping and Transaction Types, plus 7 more sections
  • Runs Python scripts from its folder; calls python

What it does

Trade Accounting is an agent skill from agiprolabs/claude-trading-skills. Double-entry bookkeeping for trading operations with ledger management, P&L statements, balance sheets, and cash flow reporting

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/planned_features.md` and `scripts/trading_ledger.py`).

It sits in Business, Finance & HR, covering Accounting and bookkeeping and Financial analysis. The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.

When your agent uses it

  • Tasks that involve Accounting and bookkeeping
  • Tasks that involve Financial analysis

Example prompts

  • “/trade-accounting”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Track real P&L — Know exactly how much you made after all fees, not just entry/exit prices
  2. Tax preparation — Hand your accountant a clean ledger with cost basis and realized gains
  3. Fee analysis — Discover that gas and priority fees are eating 3% of your gross profits
  4. Strategy comparison — Compare net P&L across strategies, not just win rates
  5. Cash flow planning — Know if you have enough liquid SOL for the next trade
  6. Audit trail — Every number traces back to a dated, memo-tagged journal entry

What it can do on your machine

Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trade Accounting loads about 3k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 1,021 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 1,021 words, ~3,009 tokens.

Download SKILL.mdSave it as .claude/skills/trade-accounting/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
trade-accounting
description
Double-entry bookkeeping for trading operations with ledger management, P&L statements, balance sheets, and cash flow reporting
license
MIT
metadata.author
agipro
metadata.version
0.1.0
metadata.category
trading

Trade Accounting

Run your trading operation like a business. Every SOL spent, every token acquired, every fee paid, every gain realized — tracked with double-entry bookkeeping so your books always balance. Whether you trade through a personal wallet or an LLC, proper accounting turns chaos into clarity.

Core principle: Every transaction touches at least two accounts. Buy a token? Cash goes down, token holdings go up — by the same amount. This double-entry constraint catches errors automatically: if debits do not equal credits, something is wrong.

Why Traders Need Accounting

Most traders track P&L loosely — "I started with 50 SOL and now I have 62 SOL." That tells you nothing about:

  • How much came from realized trades vs unrealized positions
  • What you paid in cumulative fees (gas, priority fees, swap fees)
  • Whether your staking and LP income covers your operating costs
  • Your actual cost basis for each holding (critical for taxes)
  • Cash flow timing — are you profitable but illiquid?

Proper accounting answers all of these. It also separates trading P&L (mark-to-market, useful for strategy evaluation) from tax P&L (realized gains using a specific cost basis method, required for compliance).


Account Types

A trading operation uses four account categories following standard accounting:

CategoryNormal BalanceExamples
AssetsDebitCash (SOL/USDC), token holdings, LP positions, staking deposits, receivables
LiabilitiesCreditMargin borrowing, accrued taxes payable
IncomeCreditRealized trading gains, staking rewards, airdrop income, LP fee income
ExpensesDebitTrading fees, gas/priority fees, subscription costs, data feeds
EquityCreditOwner capital contributions, retained earnings, withdrawals (contra)
Chart of Accounts

See references/planned_features.md for a full chart of accounts. A minimal setup:

1000  Assets
  1010  Cash – SOL
  1020  Cash – USDC
  1100  Token Holdings (one sub-account per token)
  1200  LP Positions
  1300  Staking Deposits

3000  Income
  3010  Realized Trading Gains
  3020  Staking Rewards
  3030  Airdrop Income
  3040  LP Fee Income

4000  Expenses
  4010  Trading Fees (DEX swap fees)
  4020  Gas & Priority Fees
  4030  Slippage Cost

5000  Equity
  5010  Owner Capital
  5020  Retained Earnings
  5030  Owner Withdrawals (contra-equity)

Double-Entry Bookkeeping

Every transaction records equal debits and credits. Debits increase asset and expense accounts; credits increase liability, income, and equity accounts.

Entry Examples

Buy 1000 BONK for 0.5 SOL (0.001 SOL gas fee):

AccountDebitCredit
Token Holdings – BONK0.501 SOL
Cash – SOL0.501 SOL

Or with the fee broken out explicitly:

AccountDebitCredit
Token Holdings – BONK0.5 SOL
Gas & Priority Fees0.001 SOL
Cash – SOL0.501 SOL

Sell 1000 BONK for 0.8 SOL (cost basis was 0.5 SOL, 0.001 SOL gas):

AccountDebitCredit
Cash – SOL0.799 SOL
Gas & Priority Fees0.001 SOL
Token Holdings – BONK0.5 SOL
Realized Trading Gains0.3 SOL

Receive staking rewards of 0.05 SOL:

AccountDebitCredit
Cash – SOL0.05 SOL
Staking Rewards0.05 SOL

Receive airdrop of 5000 JUP (valued at 2.1 SOL at receipt):

AccountDebitCredit
Token Holdings – JUP2.1 SOL
Airdrop Income2.1 SOL

Collect LP fees of 0.03 SOL:

AccountDebitCredit
Cash – SOL0.03 SOL
LP Fee Income0.03 SOL

Partial close — sell half a position:

If you hold 2000 BONK at cost basis 1.0 SOL and sell 1000 for 0.7 SOL:

AccountDebitCredit
Cash – SOL0.699 SOL
Gas & Priority Fees0.001 SOL
Token Holdings – BONK0.5 SOL
Realized Trading Gains0.2 SOL

The cost basis of the sold portion (0.5 SOL = half of 1.0 SOL) is removed from the asset account.


Transaction Types

The ledger handles these trading flows:

FlowAccounts Touched
Fund accountCash (debit), Owner Capital (credit)
Withdraw fundsOwner Withdrawals (debit), Cash (credit)
Buy tokenToken Holdings (debit), Cash (credit), Gas Expense (debit)
Sell tokenCash (debit), Token Holdings (credit), Realized Gains (credit or debit for loss), Gas Expense (debit)
Partial closeSame as sell, pro-rated cost basis
Swap token for tokenToken B (debit), Token A (credit), fees
Staking depositStaking Deposits (debit), Cash (credit)
Staking rewardCash (debit), Staking Rewards (credit)
Airdrop receivedToken Holdings (debit), Airdrop Income (credit)
LP fee collectedCash (debit), LP Fee Income (credit)
Trading feeTrading Fees (debit), Cash (credit)
Gas/priority feeGas & Priority Fees (debit), Cash (credit)

Reports

Show full SKILL.md (410 more words)Show less
Profit & Loss Statement

Shows income minus expenses for a period:

═══════════════════════════════════════════
  P&L Statement: 2026-02-01 to 2026-02-28
═══════════════════════════════════════════
INCOME
  Realized Trading Gains ........  4.200 SOL
  Staking Rewards ...............  0.150 SOL
  Airdrop Income ................  2.100 SOL
  LP Fee Income .................  0.090 SOL
                                  ─────────
  Total Income                     6.540 SOL

EXPENSES
  Trading Fees ..................  0.120 SOL
  Gas & Priority Fees ...........  0.045 SOL
  Slippage Cost .................  0.030 SOL
                                  ─────────
  Total Expenses                   0.195 SOL

═══════════════════════════════════════════
  NET INCOME                       6.345 SOL
═══════════════════════════════════════════
Balance Sheet

Shows the accounting equation: Assets = Liabilities + Equity.

═══════════════════════════════════════════
  Balance Sheet: 2026-02-28
═══════════════════════════════════════════
ASSETS
  Cash – SOL ....................  32.450 SOL
  Cash – USDC ...................   0.000 SOL
  Token Holdings ................  12.300 SOL
  LP Positions ..................   5.000 SOL
  Staking Deposits ..............  10.000 SOL
                                  ─────────
  Total Assets                    59.750 SOL

EQUITY
  Owner Capital .................  50.000 SOL
  Retained Earnings .............   3.405 SOL
  Net Income (current period) ...   6.345 SOL
                                  ─────────
  Total Equity                    59.750 SOL

═══════════════════════════════════════════
  Assets - Equity = 0.000 SOL  ✓ Balanced
═══════════════════════════════════════════
Cash Flow Statement

Tracks where cash came from and where it went:

═══════════════════════════════════════════
  Cash Flow: 2026-02-01 to 2026-02-28
═══════════════════════════════════════════
OPERATING ACTIVITIES
  Trading proceeds ..............  8.500 SOL
  Token purchases ...............  (4.300) SOL
  Fees paid .....................  (0.195) SOL
  Staking rewards received ......  0.150 SOL
  LP fees received ..............  0.090 SOL
                                  ─────────
  Net Operating Cash Flow        4.245 SOL

INVESTING ACTIVITIES
  LP deposits ...................  (5.000) SOL
  Staking deposits ..............  (2.000) SOL
                                  ─────────
  Net Investing Cash Flow       (7.000) SOL

FINANCING ACTIVITIES
  Capital contributions .........  10.000 SOL
  Withdrawals ...................  (1.000) SOL
                                  ─────────
  Net Financing Cash Flow        9.000 SOL

═══════════════════════════════════════════
  Net Change in Cash              6.245 SOL
  Beginning Cash Balance         26.205 SOL
  Ending Cash Balance            32.450 SOL
═══════════════════════════════════════════

Trading P&L vs Tax P&L

These are different numbers and serve different purposes:

AspectTrading P&LTax P&L
PurposeStrategy evaluationCompliance, filing
Unrealized gainsIncluded (mark-to-market)Excluded (until realized)
Cost basis methodAverage cost (simple)FIFO, LIFO, or specific ID (jurisdiction-dependent)
TimingReal-timeAt disposal event
AirdropsValued at receiptOrdinary income at FMV on receipt
LP ILTracked as unrealized lossNot a taxable event until withdrawal

The ledger in scripts/trading_ledger.py tracks realized gains using FIFO by default. For trading P&L, you can overlay mark-to-market valuations on open positions.

See references/planned_features.md for detailed worked examples of how the same trades produce different P&L under FIFO vs average cost.


Entity Considerations

Traders operating through an LLC or S-Corp should track additional accounts:

  • Management fees — if the entity charges a management fee
  • Distributions — payments from entity to owner (not the same as withdrawals from a trading account)
  • Payroll expenses — S-Corp officer salary
  • Tax provisions — estimated quarterly tax payments

The accounting principles are identical; the chart of accounts simply expands. The scripts in this skill focus on the trading-level ledger, which is the foundation for entity-level reporting.


Quick Start

python
from trading_ledger import Ledger, Amount

ledger = Ledger(base_currency="SOL")

# Fund the account
ledger.record_funding(amount=50.0, memo="Initial capital")

# Buy a token
ledger.record_buy(
    token="BONK",
    quantity=100_000,
    cost_sol=0.5,
    fee_sol=0.001,
    memo="Entry on volume spike"
)

# Sell for profit
ledger.record_sell(
    token="BONK",
    quantity=100_000,
    proceeds_sol=0.8,
    fee_sol=0.001,
    memo="Target hit"
)

# Record staking reward
ledger.record_income(
    income_type="staking",
    amount_sol=0.05,
    memo="Epoch 580 rewards"
)

# Generate reports
ledger.print_pnl(start="2026-02-01", end="2026-02-28")
ledger.print_balance_sheet(as_of="2026-02-28")

Run the demo script to see a full month of trading activity with all report types:

bash
python scripts/trading_ledger.py --demo

Use Cases

  1. Track real P&L — Know exactly how much you made after all fees, not just entry/exit prices
  2. Tax preparation — Hand your accountant a clean ledger with cost basis and realized gains
  3. Fee analysis — Discover that gas and priority fees are eating 3% of your gross profits
  4. Strategy comparison — Compare net P&L across strategies, not just win rates
  5. Cash flow planning — Know if you have enough liquid SOL for the next trade
  6. Audit trail — Every number traces back to a dated, memo-tagged journal entry

Prerequisites

  • Python 3.10+
  • No external dependencies (the ledger uses only the standard library)

Files

FileDescription
references/planned_features.mdChart of accounts, double-entry examples, report formats, trading vs tax P&L
scripts/trading_ledger.pyDouble-entry ledger with P&L, balance sheet, and demo mode

Disclaimer: This skill provides accounting structure and calculations for informational and organizational purposes only. It is not tax advice, legal advice, or financial advice. Consult a qualified tax professional or CPA for guidance on your specific tax obligations. Cryptocurrency tax treatment varies by jurisdiction and changes frequently.

© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/trade-accounting of agiprolabs/claude-trading-skills.

  • SKILL.md
  • references/planned_features.md
  • scripts/trading_ledger.py

Open the folder on GitHubat commit 981e1d7

Compare with similar skills

Trade Accounting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trade Accounting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trade Accounting this skillagiprolabs/claude-trading-skills410—~3kAutomated safety check: PassMIT
ERPClaw ERP Controlleravansaber/erpclaw116—~18kAutomated safety check: PassGPL-3.0
Financial Analysisdamianvtran/local-operator217—~657Automated safety check: PassMIT
Research Financealirezarezvani/claude-skills28k—~2.7kAutomated safety check: PassMIT
Compte De ResultatWellApp-ai/Well345—~602Automated safety check: PassMIT
Stock Analysisalirezarezvani/claude-skills28k—~8.5kAutomated safety check: PassMIT

Similar skills

  • ERPClaw ERP Controller

    avansaber/erpclaw

    Operates the ERPClaw self-hosted ERP in plain language: accounting, invoicing, inventory, purchasing, tax, HR, payroll and reports, treating the ERP as the single source of truth.

    116 GitHub stars~18k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Financial Analysis

    damianvtran/local-operator

    Financial figures done carefully: periods and fiscal calendars, units and currencies, reconciliation, magnitude sanity checks, sourced assumptions.

    217 GitHub stars~657 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Research Finance

    alirezarezvani/claude-skills

    A skill your agent uses when managing the money for an internal R&D program or portfolio — building a multi-period program budget with the F&A (indirect) split, tracking burn rate and runway against…

    28k GitHub stars~2.7k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Compte De Resultat

    WellApp-ai/Well

    Build a profit & loss statement (compte de résultat / income statement) from a Well workspace.

    345 GitHub stars~602 tokensUpdated 3 days ago
    Business, Finance & HRAuto-check passed
  • Stock Analysis

    alirezarezvani/claude-skills

    Produce a rigorous, sector-relative, multi-factor fundamental analysis of a publicly listed company — Indian (NSE/BSE) or US/global.

    28k GitHub stars~8.5k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Datapack Builder

    w95/awesome-claude-corporate-skills

    Build professional financial services data packs from various sources including CIMs, offering memorandums, SEC filings, web search, or MCP servers.

    244 GitHub starsUsed in 1 repo~6k tokens
    Business, Finance & HRAuto-check passed

More from agiprolabs/claude-trading-skills

All 68 skills in this repo
  • Backtrader

    agiprolabs/claude-trading-skills

    Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Birdeye API

    agiprolabs/claude-trading-skills

    Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity

    410 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Coingecko API

    agiprolabs/claude-trading-skills

    Broad crypto market data from CoinGecko covering 13,000+ tokens.

    410 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Cointegration Analysis

    agiprolabs/claude-trading-skills

    Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis

    410 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Copy Trading

    agiprolabs/claude-trading-skills

    Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Correlation Analysis

    agiprolabs/claude-trading-skills

    Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Trade Accounting

What does Trade Accounting do?

Double-entry bookkeeping for trading operations with ledger management, P&L statements, balance sheets, and cash flow reporting. Trade Accounting is an agent skill from agiprolabs/claude-trading-skills.

When should I use Trade Accounting?

Trade Accounting fits situations like: tasks that involve Accounting and bookkeeping; tasks that involve Financial analysis.

How do I install Trade Accounting in Claude Code?

Run `npx skills add agiprolabs/claude-trading-skills --skill trade-accounting -a claude-code`. Or copy the skill folder (skills/trade-accounting in agiprolabs/claude-trading-skills) into .claude/skills/trade-accounting in your project. Claude Code loads it when a task matches its description.

How do I install Trade Accounting in Codex?

Run `npx skills add agiprolabs/claude-trading-skills --skill trade-accounting -a codex`. Or copy the skill folder (skills/trade-accounting in agiprolabs/claude-trading-skills) into .agents/skills/trade-accounting in your project. Codex loads it when a task matches its description.

Can I use Trade Accounting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill trade-accounting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trade-accounting, .gemini/skills/trade-accounting, .github/skills/trade-accounting and .opencode/skills/trade-accounting in your project.

What does Trade Accounting need to run?

Going by SKILL.md and its folder, Trade Accounting needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Trade Accounting access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trade Accounting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Trade Accounting use?

Trade Accounting is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trade Accounting use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Trade Accounting?

Skills that share tags, products or a category with Trade Accounting: ERPClaw ERP Controller (avansaber/erpclaw, 116 stars), Financial Analysis (damianvtran/local-operator, 217 stars), Research Finance (alirezarezvani/claude-skills, 28k stars) and Compte De Resultat (WellApp-ai/Well, 345 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trade Accounting?

agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.

Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.