Skip to content

Introduction

Architecture

The contracts, a price service and a keeper, and how value moves between them.

AevumFi is a set of contracts plus two off-chain services. The contracts hold every balance and enforce every rule; the services only submit data and transactions that anyone could submit — plus, for ladder vaults whose owners chose it, re-centring. The oracle-priced core looks like this:

Off-chain service

Price service · /api/prices

  • 34 index quotes + ETH
  • one EIP-712 signed batch
signed batch · sent with each transaction
On-chain
Contract

AevumFiOracle.sol

  • signer threshold
  • freshness
  • latest price per feed
prices
ETH price
Contract

PerpEngine.sol

  • isolated USDG margin
  • funding
  • liquidations
  • limit & stop orders
fees & losses in · profits out
Contract

OmniVault.sol (afUSD)

  • ERC-4626 on USDG
  • counterparty to every perp
Contract

DarkPool.sol

  • commit → reveal → cross
  • WETH / USDG balances
permissionless calls
Off-chain service

Keeper · /api/keeper

  • liquidates positions
  • executes limit & stop orders
  • settles dark-pool batches
  • pushes prices

Contracts#

ContractRole
AevumFiOracle.solVerifies signed price batches (EIP-712, signer threshold, freshness) and stores the latest price per feed.
OmniVault.solERC-4626 vault on USDG (afUSD). Counterparty to the perp engine; optional external ERC-4626 yield venue for idle USDG.
PerpEngine.solIsolated-margin perps on 34 indices: positions, funding, orders, liquidations, open-interest caps.
DarkPool.solInternal WETH/USDG balances and sealed-order batch auctions crossed at the oracle mid.
LadderFactory.sol · LadderPool.solOne ladder pool per pair: price rungs on a geometric grid, per-rung fees, an on-chain EMA and volatility gauge.
LadderVaultFactory.sol · LadderVault.solA user-owned vault per ladder strategy (a minimal clone), re-centred by its restricted operator.
AevumLaunchpad.sol · AevumToken.solThe Aevum Engine: fixed-supply launches on a locked ladder, and the fee harvest.
AgentStreamRoute.sol · FloorBackstopRoute.sol · BuybackBurnRoute.solThe Autonomous Capital Routes a launch's creator fees flow through.
FloorBook.sol · FractionVault.solThe on-chain NFT listing book a floor backstop sweeps, and the fractions it mints for holders.

None of them is upgradeable. Those with admin settings use two-step ownership, and every numeric setting has hard bounds in the contract (see security & trust).

Ladders and launches#

Ladder pools price themselves from their own rungs, so they need no oracle:

Contract

Launchpad (Aevum Engine)

  • deploys a fixed-supply token
  • owns its locked 120-rung ladder
  • harvests the ladder's fees
launch
Contracts · one pair per launch

AevumToken + LadderPool

  • whole supply on the ladder
  • 1% fee on every fill
creator fees · harvested by anyone
20%
80%
Wallet

Creator

  • can point its share elsewhere
Route · fixed at launch

Autonomous Capital Route

  • AgentStreamRoute

    1. convert
    2. 7-day stream
    3. agent wallet
  • FloorBackstopRoute

    1. buy the floor on FloorBook
    2. FractionVault
    3. every holder
  • BuybackBurnRoute

    1. bid rungs under the price
    2. take the fills
    3. burn
Your contract

LadderVault

  • operator re-centres within your limits
  • kill switch: setOperator(0x0)
rungs
harvest
Contract

LadderPool

  • bids below the price
  • asks above it
swaps
Anyone

Traders

Contract

OmniVault.sol (afUSD)

  • fees deposited as afUSD for you
  • WETH fees sold for USDG first

How value moves#

  • Opening a position moves the trader's USDG margin into the engine. The open fee goes straight to the vault.
  • Closing pays the trader their margin plus PnL minus the close fee. A profit is paid by the vault; a loss is sent to it.
  • Funding flows between each position's margin and the vault. The side that makes the market's skew heavier pays, so the vault is paid for carrying the opposite side.
  • Liquidation pays the liquidator a fee out of the margin and sends the rest of the margin to the vault.
  • Dark-pool fills move tokens between traders' internal balances. The pool fee and rounding dust go to the treasury.

The vault's share price#

The vault marks itself against open positions, so its share price includes what traders are owed (or owe) right now:

afUSD price=USDG held+strategy assets−CafUSD supply\text{afUSD price} = \frac{\text{USDG held} + \text{strategy assets} - C}{\text{afUSD supply}}

where CC is the net unrealised trader PnL minus funding owed, summed over every market with open interest. The engine keeps exact per-market sums so CC is a closed form, not a loop over positions. Because this value depends on prices, the vault refuses deposits and withdrawals whenever open interest is priced on data older than five minutes — the keeper keeps it fresh.

Off-chain services#

  • Price service — /api/prices fetches quotes, rejects bad data, and signs a batch with the oracle signer key. Anyone can relay a signed batch; nobody can alter one.
  • Keeper — /api/keeper runs on a schedule. Every action it takes is permissionless — except re-centring the ladder vaults whose owners made it their operator — and each transaction is simulated before it is sent.