Security
What no key can do, what each key can do until an engine is unstoppable, and how the oracle defends its price.
What no key can do
- Take funds, or stop anyone from taking theirs out.
- Change the code of a deployed contract.
- Mint DCL, which is minted once at genesis and has no owner (on Robinhood Chain it is the canonical bridge's token).
- Change an engine's
Oracle, which is fixed when the engine is deployed. - Close anyone's position.
- Choose the block a market freezes at in a wind-down. The clock fixes that time in advance, at the deadline set at deployment or three days after a shutdown request, and the last trade before it, which anyone can make, sets each market's final price.
The keys
Until an engine is unstoppable it has two keys. The owner key is a Safe multisig, fixed for the life of the engine, and it cannot be transferred or renounced. The guardian key can do one thing, pause, so that a pause can land within minutes; the owner can replace it at any time.
| Lever | Who | What it does | Bounds |
|---|---|---|---|
| Pause | Guardian or owner | Closes every entry: new positions, deposits, new markets, new auctions and new bids. | Immediate. Exits, settlement and claims stay open. Cancels a pending change of the fees and unbond notice, or a pending ossification. |
| Unpause | Owner | Reopens entries. | Refused in the last three days of the beta, so a pause there is final. |
| Change the fees and unbond notice | Owner | Sets the base fee, the deposit fee and the unbond notice, which is how long bonded LP tokens wait after a request to unbond. | Announced three days ahead and applied only while not paused. The fees are never zero and never above the caps below. The unbond notice stays between 14 and 60 days, and a change never moves the date of a request already made. A later request restarts the whole queue at the unbond notice then in force. |
| Ossify | Owner | Makes the engine unstoppable: no key from then on, and the fees and the notice then in force fixed forever. | Announced three days ahead. A pause in those three days cancels it. Refused in the last three days of the beta. |
| Replace the guardian | Owner | Gives the pause to another key. | Immediate. The guardian never has any other power. |
| Shut down | Owner | Winds the engine down: entries close at once, and from three days later every holder and liquidity provider redeems their share in collateral, with no fee and no oracle. | Cannot be cancelled. The beta ends three days later, or at its deadline if that comes first. |
Only one change of the fees and unbond notice, or one ossification, can be pending at a time. Once it matures anyone can execute it within the next three days, after which it lapses and has to be announced again. A shutdown needs no execution and takes effect by itself when its three days run out.
The fee caps
The base fee sets the rate of every tier: the 1.25x pays a quarter of it, the 1.5x half, the 2x all of it and the 3x twice it. Each entry and each exit pays that rate, which comes to the share of the amount below. A fee change applies to every entry and exit after it, including the exit of a position opened before, which is what the three days' notice is for. The deposit fee is charged on the liquid part of an LP deposit and goes to protocol liquidity.
| Each entry and each exit | At deployment | The most the owner can set |
|---|---|---|
| 1.25x | 2.4% | 5.9% |
| 1.5x | 4.8% | 11.1% |
| 2x | 9.1% | 20% |
| 3x | 16.7% | 33.3% |
| Deposit fee | 4.9% | 20% |
The end of the beta
Each engine's beta ends at the latest three years after it is deployed, or sooner if the owner ossifies or shuts it down. If the engine is not paused at that moment, it becomes unstoppable and trades forever with no key. If it is paused, it is wound down and everyone redeems. No transaction is needed at the deadline, because the contracts read the outcome from the clock and the pause flag.
When something goes wrong
The keys exist for a disclosed bug, an attack that takes more than one block, a broken exit, and fee tuning. They cannot stop an attack that runs inside a single block. A bug that needs new code is fixed by winding the engine down and deploying a new one beside it; DCL and the art registry stay where they are.
The oracle
The Oracle reads a 30-minute time-weighted average price from the pair's most liquid Uniswap v3 pool on the same chain. It looks for a deeper pool every 23 hours, or sooner once the selected pool's depth falls by more than half (the check is coarse, so it can take a fall to a quarter), and switches only to a pool with a full 30 minutes of history and at least twice the liquidity.
The average moves at most one tick, about 0.01%, per second, and after any idle time a single update moves it at most 60 ticks, about 0.6%. Every entry and exit fills at the worse price, for the trader, of the average and the pool's price at the start of the current second. When the two differ, the trader pays the gap to the holders and liquidity providers already in the market.
Its limits
- The instant price is not capped, but it can only make a trader's own fill worse.
- A new market on a pair with no deep Uniswap pool starts with less than 30 minutes of history, and its first price is taken as found. A false first price corrects at one tick a second, in about half an hour.
The art registry
Each chain's art registry lets a liquidity provider wrap the DCL they earned into a piece of a collection. Its one key is the same Safe. Until the registry freezes, the Safe can register a new engine (one way, since none is ever removed), announce a new template for future collections three days ahead (collections already made are untouched), and open collection creation to everyone (one way). The registry freezes for good once any of its engines is unstoppable, and anyone can record that. Wrapping, creating and redeeming keep working after the freeze.
A creator supplies a collection's art and its mint rules and nothing else. The code that holds a piece's DCL is never the creator's, a mint fee is capped at 10% and fixed when the collection is made, and redeeming a piece for its DCL can never be blocked.