Gross vs Net Exposure in DeFi Portfolios
Calculate portfolio exposure without hiding debt, collateral restrictions or duplicate representations of the same underlying claim.

Overview
When translating these concepts into an integration, keep the scope described by the wallet history api with the result. The examples in wallet transaction history and smart contract event logs show how the same distinction affects neighbouring data questions.
A portfolio can hold collateral, debt, vault shares and liquid assets at once. Gross asset value and net exposure are different views. Reporting only a single total can hide both leverage and double counting.
Keep claims and obligations distinct
Store each position’s assets and liabilities with units, valuation method and block context. A deposited token represented by a receipt token should not automatically be counted once as underlying and again as an independent full-value asset. Decide whether the view uses direct holdings or look-through exposure and make that choice explicit.
Worked example: collateral and borrowing
A wallet has collateral valued at 200 and debt valued at eighty under aligned prices. Gross collateral exposure is 200; simplified net value is 120 before other costs or positions. Calling 200 the wallet’s unencumbered wealth ignores the debt and the restrictions on withdrawing collateral.
Reconcile aggregation layers
Retain links from summary values to positions and underlying assets. Test nested vaults, borrowed assets still held in the wallet and prices from different times. Unknown liabilities should not be treated as zero. Show gross assets, liabilities and net value separately so users can inspect the calculation instead of relying on an unexplained aggregate.
A practical acceptance test
Use collateral value 200 and debt eighty, with a receipt token representing the same collateral claim. Assert gross collateral 200 and simplified net 120 without adding the receipt as another full-value asset. Remove the debt valuation and ensure net value becomes partial rather than assuming the liability disappeared.
Questions about the topic
Frequently asked questions
Is collateral value freely spendable?
Not necessarily; it can be restricted by an open position.
Can receipt tokens and underlying assets both be counted?
Only if the aggregation prevents representing the same claim twice.
Standards & technical documentation
