원클릭으로
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.