DeFi accounting for positions and vaults
What it is
DeFi position and vault accounting is booking what a firm holds in DeFi protocols at period end: vault shares, lending deposits and debt, and rewards that have accrued but haven’t been claimed.
Asset managers and crypto banks do it at every close because these positions change value without any transfer in or out, so a wallet balance alone misstates them.
Goldsky decodes each protocol’s events into your warehouse and reads positions at the period-end block; your team sets the period, prices the positions and posts the journals.
Who it’s for
Asset managers, crypto funds and crypto-native banks that hold positions in DeFi vaults and lending markets, and the accounting teams that close their books.
How DeFi position accounting works at period end
The diagram follows one period close from the protocol activity that changes each position to the journal entries your accounting team posts, and shows who does each step. Your setup may differ.
Move positions onchain
Every deposit, withdrawal, borrow, repayment and reward claim changes what the firm holds in a protocol.
Each change is recorded as an event in a block. Some value builds up with no event at all, such as interest on a loan or rewards not yet claimed, so events alone never tell the whole story.
Decode every protocol event into your warehouse
Handled by Goldsky TurboAccountants need each position change as a readable row: what happened, how much and when.
Decode each protocol’s events with its contract definition, from the day each position was opened. Missing history breaks cost basis, because the cost of a position depends on every deposit and withdrawal before the close.
Goldsky’s Turbo Pipelines decodes each protocol’s raw logs with
Decode logs with an ABI (opens in a new tab)_gs_log_decode, and one decode can fan out into a table per event, such as deposits, borrows and reward claims, with history backfilled fromstart_at: earliest.Close the period
Everyone has to value the same moment, so finance fixes the cut-off before anything is read.
Finance sets the period-end time and the block that matches it on each chain. If different positions are read at different blocks, the books describe a portfolio that never existed at any one time.
Read positions at the period-end block
Handled by Goldsky EdgeVault shares, debt with interest and unclaimed rewards only exist in each contract’s current state, not in its events.
Call each contract for the firm’s shares, debt and accrued rewards as of the closing block. A read taken after the close includes interest and rewards that belong to the next period.
Edge RPC responds to
Read state at a block (opens in a new tab)eth_callat the block you name, so a call to a vault’s share balance or a lending market’s debt function returns the figure as it stood at the close.Calculate positions and PnL
Shares and token amounts become numbers for the books only once each has a price and is compared with its cost.
In your warehouse, convert shares to underlying tokens, price them, and work out gains, losses and income under your cost-basis rules. Totals and per-period sums are queries your team runs on the decoded rows, so the rules stay yours to change.
Book the entries
The close is done when the positions and income are in the general ledger.
Your accounting team posts the journals and keeps the reads and calculations behind each one. An entry nobody can trace back to its block and price is hard to defend at audit.
What you control
- Your team
- Close the period
- Calculate positions and PnL
- Book the entries
Security and deployment
- SOC 2 Type IIIndependently audited security controls.
- Dedicated infrastructureSingle-tenant options for production workloads.
- Data residencyCloud, on-premises or co-located.
More use cases that report on onchain activity
- Form 1099-DA data for brokersSupply the transfer history and USD values behind each customer’s Form 1099-DA.
- DAC8 and CARF reporting dataSupply the valued transfer history behind each user’s yearly DAC8 or CARF report.
- Onchain data for finance and BI reportingLoad onchain activity into the warehouse so finance and BI teams can report on it.
- Crypto fair-value pricing from DEX tradesFeed DEX trade prices into principal-market fair-value marks and the VWAPs used to check them.
- Digital asset audit evidenceGive auditors each wallet’s balance at the year-end cut-off block and the year’s transfers.
Use cases built the same way
- Daily stablecoin supply by chain for PS-01 reportsKeep the daily per-chain supply, issued, redeemed, issuer-held, frozen and lost figures that feed the weekly OCC PS-01 report.
- GENIUS Act stablecoin reporting dataFile the weekly OCC PS-01 report from daily per-chain supply, freeze and holder data.
- NCUA stablecoin reporting dataReport supply, mint and burn, and holder figures for a stablecoin issued by a credit union subsidiary under the NCUA’s proposed rules.
- Trading rewards and builder fee attributionCredit fills, fees and incentive rewards to the app, builder or trader that drove them.
Account for DeFi positions and vaults with Goldsky
We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.