Skip to content

DeFi Deep Dive: Pipeline, Positions & Derivatives

DeFi Deep Dive: Pipeline, Positions & Derivatives

Section titled “DeFi Deep Dive: Pipeline, Positions & Derivatives”

This page covers the full DeFi and derivatives suite in detail — from the accounting pipeline that classifies on-chain events, through position tracking and bridge resolution, to advanced instruments like margin trading, futures, options, restaking, and MEV analysis.

DeFi features are available on qualifying plans. Additional advanced features (restaking, governance, insurance, MEV) may require higher-tier plans.

The DeFi accounting pipeline under DeFi → Pipeline processes raw blockchain events into classified, posted journal entries.

DeFi transactions in the pipeline

PENDING → CLASSIFIED → POSTED
→ FAILED
→ MANUAL_REVIEW
→ SKIPPED
  • PENDING — Raw event ingested from chain, awaiting classification
  • CLASSIFIED — Engine has determined the transaction type and accounting treatment
  • POSTED — Journal entries created and posted to the ledger
  • FAILED — Classification or posting failed (check error details)
  • MANUAL_REVIEW — Engine flagged the event for human review (ambiguous classification)
  • SKIPPED — Explicitly skipped (e.g., spam, dust, or irrelevant contract interactions)

The pipeline view shows:

  • Status counts — Number of events in each stage
  • Pending queue — Events awaiting classification with protocol and type details
  • Review queue — Events requiring manual classification
  • Multi-leg groups — Complex transactions spanning multiple accounting legs
  • Hash chain status — Integrity of the journal hash chain

Events can be processed individually or in batch:

  1. Auto-classification — The engine applies accounting rules and transaction analysis
  2. Manual classification — For events in MANUAL_REVIEW, select the correct transaction type and GL accounts
  3. Batch processing — Select multiple pending events and process them together
  4. Expression validation — Test accounting expressions before posting

Rules under Settings → Rules automate classification:

  • Define conditions based on protocol, function signature, asset, or amount thresholds
  • Set the resulting transaction type, GL accounts, and economic intent
  • Test rules against sample events before activating
  • Rules are versioned — changes create new versions for audit trail

Track all open DeFi positions under DeFi → Positions.

DeFi positions dashboard

TypeDescriptionKey Metrics
LP PositionsLiquidity pool stakes (Uniswap, Curve, Balancer)Deposited value, current value, impermanent loss, fees earned
Lending DepositsAssets deposited in lending protocols (Aave, Compound)Principal, accrued interest, health factor
Lending BorrowsOutstanding borrowsPrincipal, accrued interest, liquidation threshold
StakingStaked assets in validators or protocolsStaked amount, rewards earned, unbonding status

Each position displays:

  • Protocol — The DeFi protocol (e.g., Aave v3, Uniswap v3, Lido)
  • Pool/Vault — Specific pool or vault identifier
  • Deposited assets — What was deposited and quantities
  • Current value — Mark-to-market value
  • P&L — Unrealized gain/loss vs. deposited value
  • Rewards — Accumulated but unclaimed rewards
  • Status — Active, pending withdrawal, or closed

For rebasing assets (stETH, aTokens), CryptaCount tracks:

  • The underlying balance changes due to rebasing
  • Rebasing income recognized at each rebase event
  • Accurate cost basis maintained through balance changes

Configure rebase token settings in the DeFi position settings panel.

Cross-chain bridges under DeFi → Bridges manage asset movements between chains.

Bridge transactions and resolution

When assets are bridged:

  1. A BRIDGE_OUT transaction is recorded on the source chain
  2. A BRIDGE_IN transaction is recorded on the destination chain
  3. CryptaCount attempts to auto-match the pair based on amount, asset, and timing

The bridge view highlights stale bridges — BRIDGE_OUT transactions without a matching BRIDGE_IN within the expected timeframe. Common causes:

  • Destination chain wallet not connected to CryptaCount
  • Bridge transaction still pending (slow finality)
  • Failed bridge that needs manual resolution

For unmatched bridges:

  1. Navigate to the stale bridge entry
  2. Click Resolve
  3. Select the matching BRIDGE_IN transaction from the destination chain
  4. CryptaCount links the pair and carries the cost basis across

Gas fee reporting under DeFi → Gas Fees provides detailed breakdown of transaction costs.

Gas fee analysis by chain and wallet

MetricDescription
Total gas spentAggregate gas fees across all wallets and chains
By chainGas fees broken down per blockchain
By walletGas fees per wallet address
By transaction typeGas fees by classification (swaps, transfers, staking, etc.)
TrendsGas fee spending over time (daily/weekly/monthly)
As % of transaction valueGas efficiency metric

Gas fees are recorded as expenses in the general ledger. The gas fee report feeds into:

  • Income statement under operating expenses
  • Transaction-level cost tracking (gas is added to the transaction cost where applicable)
  • Tax calculations where gas fees are deductible

The derivatives overview under Derivatives in the sidebar shows a summary of all derivative positions.

Derivatives positions overview

  • Total open positions — Count and notional value
  • P&L summary — Realized and unrealized P&L across all derivatives
  • Funding rate exposure — Net funding payments/receipts
  • Margin utilization — Collateral deployed vs. available

Manage margin positions under Derivatives → Margin.

Margin trading positions

EventAccounting Treatment
Open positionRecord position at notional value, lock collateral
Add collateralTransfer from available to margin account
Remove collateralTransfer from margin to available
Interest accrualRecognize as finance cost
Close positionRealize P&L, release collateral
LiquidationForce-close, realize loss, forfeit collateral

For each open position, CryptaCount tracks:

  • Entry price and current mark-to-market price
  • Collateral amount and margin ratio
  • Accrued interest (funding costs)
  • Unrealized P&L
  • Liquidation price threshold

Track futures and options positions under Derivatives → Futures & Options.

Futures and options tracking

EventAccounting Treatment
Open futuresRecord at contract price
Funding paymentRecognize as income or expense
Close futuresRealize P&L
SettlementFinal settlement of expired contracts

CryptaCount marks futures positions to market each period, recognizing unrealized gains and losses. Funding rate payments are tracked separately.

EventAccounting Treatment
Buy optionRecord premium paid as asset
Sell (write) optionRecord premium received as liability
ExerciseSettle at strike price, realize P&L
ExpireWrite off premium (buyer) or recognize income (writer)
AssignmentObligation fulfilled, settle at strike

Three dedicated reports available from the derivatives dashboard:

ReportDescription
P&L ReportRealized and unrealized P&L by instrument and period
Funding ReportFutures funding rate payments and receipts over time
Open PositionsCurrent derivative exposure with mark-to-market values

Track restaking positions under Restaking in the sidebar.

Restaking positions and rewards

FeatureDescription
PositionsTrack restaked ETH across operators and services
RewardsRewards earned from securing additional services
Withdrawal queueMonitor pending unstaking and withdrawal requests
SlashingRecord slashing events if an operator is penalized

Track governance locks and voting under Governance in the sidebar.

Governance token locks and voting

FeatureDescription
Lock positionsTokens locked for voting power (veCRV, veBAL, etc.)
Lock durationTime-weighted voting power based on lock period
RewardsGovernance rewards and bribes received
DelegationVoting power delegated to other addresses

Track DeFi insurance under Insurance in the sidebar.

DeFi insurance policy tracking

FeatureDescription
Active policiesCurrent coverage with protocols, amounts, and expiry
PremiumsPremium payments and accrual schedule
ClaimsFiled claims and their resolution status
Coverage tokensTokens received representing coverage

Analyze MEV events under MEV in the sidebar.

MEV event analysis

Maximal Extractable Value (MEV) affects transaction outcomes. CryptaCount identifies and classifies MEV events:

EventDescription
Flash loansAtomic borrow-and-repay within a single block
ArbitrageProfit from price discrepancies across venues
Sandwich attacksFront-running and back-running transactions
Victim lossesLoss incurred from being sandwiched

The MEV dashboard shows:

  • Total MEV profit/loss for the workspace
  • Events by category (flash loan, arbitrage, sandwich)
  • Transactions affected by MEV attacks
  • MEV as a percentage of total transaction value
  • Flash loan borrow/repay — No net balance change (atomic). Fee recorded as expense.
  • Arbitrage profit — Recognized as trading income
  • Sandwich front/back — Profit recognized as trading income for the MEV actor
  • Victim loss — Recorded as additional cost (slippage) on the affected transaction