How It All Fits Together

In the last chapter we met the cast - the LPs, the traders, the Vault Manager, and the three robots. Now let's watch them work together, in order, as a single living loop.

Here's the thing to hold in your head: Own is split into two worlds that constantly hand work back and forth. There's the onchain world - a set of contracts on Base Sepolia (a testnet, for now) that hold money and settle trades; nobody can change what they do once a trade is in motion. And there's the offchain world - the three robots, ordinary programs running on servers, that watch prices, keep the contracts fed, and quote prices to traders.

Neither world can do the job alone. The contracts are trustworthy but blind - they can't go fetch Tesla's price off the internet. The robots can see everything but can't be trusted with your money on their own. So the design splits the work cleanly: the robots advise and prepare; the contracts decide and hold.

The whole loop, in one picture

Let's follow a single buy from click to confirmation. Maya wants eTSLA - a synthetic token that tracks Tesla's price.

                            OFFCHAIN (the robots)
   ┌─────────────────────────────────────────────────────────────┐
   │   THE ORACLE              THE KEEPER          THE MARKET MAKER│
   │  gathers prices,        keeps the onchain    quotes a firm    │
   │  agrees on one,    ───▶  price + risk marks   price, then     │
   │  signs it               fresh (heartbeat)     hedges fills    │
   └────────┬──────────────────────┬──────────────────┬───────────┘
            │ signed price          │ pushes price     │ firm quote
            │                       │ + refreshes      │ (good ~15s)
            ▼                       ▼   marks          │
   ┌──────────────────────────────────────────────────┼───────────┐
   │                  ONCHAIN (the contracts)          │           │
   │                                                   ▼           │
   │   Maya ── submits the quote ──▶  THE MARKET  ──▶ mints eTSLA  │
   │     ▲                            (settlement)    to Maya,     │
   │     │                                │           takes USDC   │
   │     │   tokens land in her wallet ◀──┘                        │
   │                                      │ checks the rules       │
   │                                      ▼                        │
   │                              THE COLLATERAL VAULT             │
   │                          (LPs' USDC backs every token)        │
   └──────────────────────────────────────────────────────────────┘
            │ the settlement is announced as an event
            └──────────────────────────────▶ the Market Maker reads it,
                                              then hedges on an outside venue

Read it top to bottom, then follow the arrows. Three things feed in from above; one trade settles in the middle; one announcement flows back out to the right.

Walking the loop

The Oracle speaks first. Long before Maya clicks anything, the price-teller is already working. It pulls Tesla's price from several independent sources, throws out anything that looks wrong, agrees on one number, and signs it - stamps it with a cryptographic signature that the contracts can later check. This signature is what lets a blind contract trust an outside price: it can verify the stamp came from the approved price-teller.

The Keeper keeps the lights on. The signed price is no good sitting on a server - the contracts need it. So the heartbeat robot pushes the latest signed price onchain and, just as importantly, refreshes the protocol's working prices - its marks - so they never go stale. This matters more than it sounds: the contracts refuse to let new risk build up against a stale price. If the Keeper ever stopped, trades would simply stall rather than settle on a bad number. It's a safety feature you'll only notice when it's missing.

The Market Maker quotes. When Maya asks to buy, the dealer doesn't post a price on a board and wait. Instead, Maya's app asks for a price - this is an RFQ, a request for quote - and the dealer answers with a firm quote: a specific price it commits to, signed and good for about fifteen seconds. The dealer prices off the Oracle's number and adds the small spread it earns. Maya sees the price and decides.

The Market settles. Maya submits that signed quote to the settlement contract - the Market. In one single transaction it checks the dealer's signature, confirms the price is sane (close to the current mark), takes Maya's USDC, and mints fresh eTSLA into her wallet. There's no waiting, no pending status, no second step. The transaction either completes the whole trade or does nothing at all.

The Vault stays honest. Before the Market lets that new token exist, it checks with the collateral vault - the pool of real USDC (and other collateral) that LPs deposited. Every eTSLA in existence has to stay fully backed, and the vault can't be lent or stretched past its safety limits. If a trade would break those rules, it's refused.

The announcement closes the loop. The moment the trade settles, the Market emits an event - a public announcement that this trade happened. The Market Maker is watching for exactly that. It now holds the other side of Maya's trade, so it goes to an outside venue and hedges: takes an offsetting position so it doesn't care whether Tesla rises or falls. It earned its spread and stayed neutral.

Why it's built this way

Notice the rhythm: every robot prepares something, and a contract decides with it. The Oracle prepares a price; the Market verifies the signature. The Market Maker prepares a quote; the Market verifies that too, and re-checks it against the vault's rules. The Keeper just keeps the inputs fresh. No single robot can move money on its own - the contracts are the final word, and they only act on signed, in-bounds instructions.

That's the entire system. Everything in the rest of this book is a closer look at one of these handoffs.

What just happened

  • Own runs in two halves: offchain robots that advise, and onchain contracts that hold money and decide.
  • The Oracle agrees on a price and signs it; the Keeper keeps that price and the risk marks fresh onchain so trades never stall.
  • The Market Maker answers an RFQ with a firm quote; Maya submits it to the Market, which settles the whole trade - taking USDC and minting eTSLA - in one transaction.
  • The Market only lets a trade through if the price is in-bounds and the collateral vault stays fully backed.
  • A settlement event announces the trade; the Market Maker reads it and hedges on an outside venue to stay neutral.

results matching ""

    No results matching ""