11 / 14 · docs

Architecture

how the bell is built.

The planned contracts and the flow of one night, from deposit to settlement.

simulation Simulation only. The protocol is not live. No transaction is ever sent.

This page describes the planned system. No contract is deployed and none has been written or audited. Names, boundaries and interfaces can change.

Contracts overview#

Five contracts, each with one job.

Planned contracts (none deployed)
ContractRoleAddress
EvePoolERC-4626 style USDC vault. Pays advances, receives sale proceeds, holds depositor shares, parks idle USDC on Morpho.not deployed todo
EveSettlementReads Chainlink after the open, averages the fresh price, runs the TWAP sale, computes each balance.not deployed todo
EveGuardNight-time checks: market closed, earnings calendar, corporate actions, per-ticker volume cap.not deployed todo
EveReserveHolds the reserve share of fees. Pays the pool when a gap exceeds the haircut.not deployed todo
EveStakingStaked $EVE and the stakers' share of fees.not deployed todo

They rely on three external systems:

SystemUsed for
Chainlink price feedsThe reference price at night and the fresh price at the open. See Oracles.
A decentralized exchange on BaseSelling the night's stocks over the TWAP window.
MorphoHolding idle USDC between sessions.

One night, from deposit to settlement#

A night: the seller is paid an advance after the close; at the open the pool sells, the price is fixed, and the balance is paid.

The same night in words:

  1. Deposit. After the close, the seller deposits tokenized stock into the pool.
  2. Checks. The guard confirms the market is closed, the ticker is not blocked (earnings, corporate action) and tonight's volume cap has room.
  3. Reference price. The pool reads the Chainlink feed, which is frozen at the closing price.
  4. Advance. The pool pays the seller 90% of the reference value in USDC.
  5. Night. Nothing happens until the next open.
  6. Fresh price. After the bell, the settlement contract waits for the first fresh Chainlink round and averages the rounds in the window.
  7. Sale. The pool sells the stock on a DEX in equal slices over 30 minutes.
  8. Settlement. The settlement price is the lower of the oracle average and the realized TWAP. The balance is the settled value, minus the fee, minus the advance.
  9. Distribution. The seller receives the balance. The fee is split between depositors, the reserve, stakers and buybacks.
  10. Backstop. If the gap was larger than the haircut, the reserve pays the pool's shortfall.

The life of a sale#

States of one sale.

Off-chain parts#

Not everything can live in a contract.

PartWhat it doesStatus
KeeperStarts settlement after the open and executes the TWAP slices.not decided todo
Events calendarSupplies earnings dates and corporate actions to the guard.not decided todo
Market calendarNYSE holidays and early closes. Computed by rule, with unscheduled closures added by hand.Implemented in this site's code
GovernanceChanges parameters and upgrades contracts.not decided todo

Each off-chain part is a point of trust or failure, and is listed as such in Risk and safeguards.

Parameters the contracts will hold#

ParameterValue
Advance rate90%
Earnings advance rate75%
Fee per night0.25%
Oracle window10 min todo
TWAP window30 min
Staleness limit120 s todo
Volume cap5% of depth todo
Pool utilization ceilingnot decided todo

How this site models it#

The site has no contracts to call, so it models the protocol in TypeScript. The model is a small, pure module with no dependency on React, the network or the system clock:

src/lib/protocol/
  time.ts         New York wall-clock time, daylight saving by rule
  calendar.ts     NYSE holidays, early closes, sessions
  clock.ts        market status, nights, bells, the countdown
  fees.ts         the per-night fee and the fee split
  settlement.ts   the sell quote, oracle averaging, TWAP, settlement
  prices.ts       seeded simulated opens (not market data)
  sim.ts          the simulator: a reducer and a ledger
  examples.ts     the worked examples in these docs

The simulator, the countdown and every worked example on these pages call this module. It is covered by unit tests, which are the closest thing to a specification the protocol has today.

npm test

All parameters are read from one file, src/eve.config.ts.