COVER ยท BASICS

Oracle

The place that tells the program what is going on outside

What is it?

A smart contract can only read what is onchain. What a token costs on an exchange is not there.

Yet many protocols need that figure constantly - to decide whether a loan is still sufficiently collateralised, at what rate to swap, when something has to be liquidated.

An oracle fetches the figure from outside and writes it into the blockchain. From then on the program treats it as fact. It has no way of doubting it.

An example

A loan is collateralised with crypto assets and is liquidated as soon as their value falls below a limit. Whether that is so is what the oracle tells the contract.

If it reports too low a price, the contract liquidates collateral that would in fact have been enough. If it reports too high a price, loans stay open that are long since uncovered. In both cases the contract works correctly - with a wrong figure.

Where does a risk come from?

The figure can be wrongThrough failure of the source, through an error in transmission - or because somebody briefly distorted the market it comes from.
The figure can be staleA price from twenty minutes ago tells you nothing in a fast market, but it looks exactly like a fresh one.
Many depend on the same sourceIf several protocols use the same oracle, one error takes effect in several places at once.

The last point is the underrated one: an oracle is a place where trust concentrates. What goes wrong there goes wrong everywhere at once.

Why this matters for cover

Because an oracle error produces a loss in which the contract itself is flawless.

A wording that covers only flaws “in the smart contract” may not capture this case - there was, after all, no flaw in the contract. Whether the oracle is covered too has to be stated expressly.

NEXT

Where this leads

  • Oracle risk

    What happens when the figure is wrong - and how that becomes a loss.

  • Stablecoin

    An asset whose price is queried particularly often.