DomFiDomFi

Vault

How the DomFi ERC-4626 vault works — share pricing, the counterparty model, epochs, and risks.

What is the Vault?

The DomFi vault is a single ERC-4626 pool that holds all LP liquidity. LPs deposit USDC and receive $dfUSDC shares. The vault acts as the collective counterparty to every trade on the platform. There's no individual matching: one shared pool absorbs the net PnL of all positions across all pairs.

$dfUSDC Shares

$dfUSDC follows the ERC-4626 tokenized vault standard. Shares are standard ERC-20 tokens, fully transferable and composable with other DeFi protocols.

Share price = total vault USDC / total $dfUSDC outstanding.

EXAMPLE: Share Price

The vault holds 1,000,000 USDC with 900,000 $dfUSDC shares outstanding. Each share is worth ~1.11 USDC. You deposit 10,000 USDC and receive ~9,000 $dfUSDC. When you withdraw later, your shares redeem at whatever the share price is at that time.

SHARE PRICE CALCULATOR
Vault USDC
1,000,000
$dfUSDC Outstanding
900,000
Share Price1.1111 USDC

Counterparty Model

When a trader opens a long on BTCDOM, the vault is effectively short. When a trader shorts ETHDOM, the vault is long. LP returns are inversely correlated with trader performance: traders lose, the vault grows; traders win, the vault pays out. No individual LP is matched to a specific trade. The vault absorbs net PnL across all pairs, which diversifies risk but means LP performance depends on aggregate trader behavior.

Share Price Dynamics

Two forces drive the $dfUSDC price:

  1. Trader PnL settlement. Trader losses grow the vault's USDC balance, pushing share price up. Trader wins shrink it, pushing share price down.
  2. Fee accrual. 50% of all trading fees flow into the vault continuously, increasing USDC backing per share.

Fee accrual provides recurring yield independent of trader performance. Even during net trader profitability, fees partially offset vault drawdown.

VAULT SCENARIO SIMULATOR
Vault USDC (starting)
1,000,000
$dfUSDC Outstanding
900,000
Net Trader PnL This Epoch
+$0
Negative = traders lost (vault gains) · Positive = traders won (vault pays out)
Fees Collected This Epoch
$5,000
Share Price Before
1.1111 USDC
Share Price After
1.1167 USDC
Share Price Change
+0.0056 USDC
Share Price Change %
+0.50%
New Vault USDC
$1,005,000
FEE FLOW
Fees are charged on both open and close

Epochs

The vault operates on epochs — periodic boundaries where unrealized PnL is committed to the $dfUSDC share price. Epochs prevent front-running: without them, an LP could deposit before a large liquidation, capture the windfall, and withdraw immediately.

Epoch transitions are event-driven, not fixed-interval. The DomfiOpenPnl contract samples open PnL at regular intervals, and after collecting enough samples, triggers a new epoch. The epoch start timestamp resets on each transition — there is no fixed UTC schedule.

Epochs also govern withdrawal cool-off periods. When an LP requests a withdrawal, their $dfUSDC locks for one or more epochs depending on vault collateralization.

Collateralization

The vault's collateralization ratio measures USDC held versus outstanding obligations to traders. Higher means healthy reserves. Lower means trader wins have eaten into the buffer. This ratio directly affects withdrawal cool-off duration: lower collateralization forces longer waits, giving the vault time to stabilize.

Circuit Breakers

The vault has two automated safety limits that halt payouts to protect LP capital. Both cause hard transaction reverts — there is no queuing mechanism. The trade close fails and must be retried after conditions improve.

Daily loss cap (maxDailyAccPnlDeltaPerToken): The vault can pay out at most 0.15 USDC per LP share per day in net trader profits. When this cap is reached, any profitable trade close reverts with MaxDailyPnlReached. The counter resets automatically every 24 hours.

Cumulative PnL cap (maxAccPnlPerToken): The vault cannot pay out more than its total accumulated fee rewards plus 1 USDC per share. This is a dynamic ceiling that grows as the vault earns fees. When hit, profitable trade closes revert with NotEnoughAssets.

Both caps are governance-configurable via the timelock. The daily cap has a floor of 0.00001 USDC per share (cannot be set lower). Neither cap is an insurance fund — they halt payouts to prevent vault insolvency but do not restore lost capital.

Additionally, individual trade profit is capped at 900% of collateral (hardcoded, not governance-configurable). This per-trade ceiling is enforced before vault circuit breakers are checked.

Risks

Counterparty risk. You're short all trader PnL. Sustained trader profitability reduces your deposit value. Fee accrual partially offsets this, but cannot guarantee net positive returns.

Vault depreciation. The $dfUSDC/USDC rate can drop below 1.0 and there is no guarantee of recovery. Your shares may be worth less USDC than you deposited.

Epoch timing. PnL settles at epoch boundaries. A single epoch with outsized trader gains can cause a sharp drop in share value. You cannot exit mid-epoch to avoid this.

No insurance fund. The vault has no external backstop, no insurance fund, and no auto-deleveraging mechanism. If traders consistently win, the vault absorbs all losses. Circuit breakers halt payouts but do not restore lost capital.

Locked deposit discount socialization. When locked deposits are unlocked, the discount cost is spread across all current LP holders, slightly reducing share value. This is a small but real dilution effect.

Withdrawal pricing. You receive the lower of two prices: the price when you requested withdrawal, or the price when you claim. You never benefit from a price increase during the cool-off period.

For a comprehensive breakdown of all protocol risks, see Risks.

SEE ALSO