defi-pnl
Installation
SKILL.md
DeFi Realized PnL — Wallet-Boundary Method
Computes realized stablecoin/LP yield via a two-stage wallet-boundary pipeline. Stage 1 builds a flat transfer ledger; Stage 2 computes boundary PnL from that ledger. Rotation bug fix: intra-wallet stable rotations (vault A → stable → vault B) net to zero because they stay inside the wallet boundary and never cross external counterparties.
Two-Stage Pipeline
Stage 1 — Build transfer ledger
bun yield_trace.ts <wallet> --ledger [--chains base,ethereum,arbitrum,optimism] --out <ledger.json>