---
title: Architecture
description: >-
  This page explains SV3's on-chain architecture, covering contract roles, the
  permissionless keeper's function, and how solvency checks secure every
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

SV3 settles pricing, issuance, redemption, reserve custody, floor accounting, fees, collateral, and debt on-chain.

```d2
keeper: Permissionless keeper {
  shape: person
}

chain: EVM chain {
  directory: Directory
  factory: Factory
  policy: Floor policy controller
  beacon: UpgradeableBeacon
  market: FloorMarket
  token: MarketToken
  reserve: Canonical USDC reserve {
    shape: cylinder
  }

  directory -> factory: configuration
  directory -> policy: floor policy
  directory -> beacon: implementation control
  factory -> market: create market
  factory -> token: create token
  beacon -> market: implementation
  policy -> market: validate floor raise
  market <-> token: mint and burn
  market <-> reserve: USDC in and out
}

keeper -> chain.policy: read valid plan
keeper -> chain.market: submit floor raise
```

## Contract roles

| Component             | Responsibility                                                                   |
| --------------------- | -------------------------------------------------------------------------------- |
| Directory             | Protocol configuration, global controls, caps, and implementation discovery      |
| Factory               | Permissionless market creation and deterministic market identity                 |
| FloorPolicyController | Recomputes the maximum valid area/surplus floor-raise plan                       |
| UpgradeableBeacon     | Shared `FloorMarket` implementation for the v1 market generation                 |
| FloorMarket           | Trading, reserve accounting, floor actions, positions, fees, and solvency checks |
| MarketToken           | 18-decimal ERC-20 Permit token minted and burned only through market rules       |

Curve math is compiled directly into `FloorMarket`. Each transaction calculates from current market state and validates its complete post-action solvency values before settlement.

## What the keeper does

The keeper supplies liveness only:

1. Read the controller's current eligibility result and deterministic plan.
2. Build a freshness-bound witness.
3. Submit `raiseIfEligible` to the market.
4. Let the contracts recompute and either accept or reject the same plan.

The controller recomputes the plan on-chain, so the submitted witness only proves freshness. The keeper has permission to submit the same call available to any address and earns no protocol bounty.

A keeper outage delays eligible raises. Existing reserve accounting, floor value, trading, positions, and solvency continue under the last completed state.

## Interfaces and indexed data

Web interfaces and indexed history present quotes and past activity. Before execution, a transaction refreshes authoritative contract state and must pass on-chain slippage, deadline, cap, pause, and solvency checks.

Upgrade and pause authority are separate trust assumptions described in [Risks & Controls](/trust/risks-and-controls).
