一键导入
cost-basis
Track trade cost basis and compute P&L using FIFO. Record buys/sells, view unrealized/realized profit per token and portfolio-wide.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Track trade cost basis and compute P&L using FIFO. Record buys/sells, view unrealized/realized profit per token and portfolio-wide.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Check eligibility for and claim token airdrops
Scan, audit, and revoke ERC-20 token approvals to manage wallet spending permissions
Set up automated server-side trading strategies (limit buys/sells) that execute on Base via Bankr
Deploy tokens on Base (Uniswap V4) or Solana (Raydium) via Bankr gas-sponsored launch API
Open leveraged long/short positions via Avantis on Base with up to 10x leverage
Access Polymarket prediction markets to search, place bets, view positions, and redeem winnings
| name | cost-basis |
| description | Track trade cost basis and compute P&L using FIFO. Record buys/sells, view unrealized/realized profit per token and portfolio-wide. |
| metadata | {"openclaw":{"emoji":"📊"}} |
cost_basis| Action | Description |
|---|---|
record_trade | Manually record a buy or sell trade |
portfolio_pnl | Unrealized + realized P&L for all holdings |
token_pnl | Detailed P&L for a specific token with FIFO lot breakdown |
history | List recent trade records |
export | Full trade history as JSON (for tax/accounting) |
| Param | Required For | Description |
|---|---|---|
token | record_trade, token_pnl | Token contract address (0x...) |
symbol | record_trade | Token symbol (e.g., "USDC") |
type | record_trade | "buy" or "sell" |
amount | record_trade | Token amount (number) |
price_usd | record_trade | Price per token in USD at time of trade |
current_price | portfolio_pnl, token_pnl | Current price for P&L calc (optional — defaults to last trade price) |
tx_hash | record_trade | Transaction hash (optional) |
limit | history | Max records to return (default: 50) |
Record a trade after a swap:
action: record_trade, token: 0xa1F7..., symbol: CLAWNCH, type: buy, amount: 1000, price_usd: 0.05
Check portfolio P&L:
action: portfolio_pnl
Optionally pass current_price to override the last-known price.
Detailed P&L for one token:
action: token_pnl, token: 0xa1F7..., current_price: 0.08
Shows FIFO tax lots, realized gains from sells, unrealized gains on holdings.
View trade history:
action: history, limit: 20
Export for taxes:
action: export
Trades are matched First-In, First-Out:
The after_tool_call hook in the extension can auto-record trades when swaps complete via the recordSwapTrade() function. Manual recording is also supported for trades made outside the agent.
Trade records are stored at ~/.openclawnch/data/trade-history.json (or $OPENCLAWNCH_TX_DIR/trade-history.json). Data survives agent restarts and is volume-mounted in Docker deployments.