This article is derived from a chapter in the free eBook explaining DeFi technologies:
DeFi Demystified | An Introduction To Decentralized Finance
Crypto oracles provide an essential bridge between off-chain and on-chain data. If a smart contract needs access to price feeds, random numbers or external data they will need to use an oracle because the smart contract can not make outgoing connections past the boundaries of on-chain data.
In traditional web development, an API (application programming interface) provides a web address for developers to connect to so they can gain access to data and execute functions programmatically. Centralized exchanges such as Binance will provide API access and API keys for their users so they can trade programmatically using trading bots and scripts for example.
Smart contracts can only read data provided to them via user transactions and can’t connect to anything externally posing a problem for developers that need external data. This problem is being solved by oracles who upload data such as price feeds to the blockchain.
Oracles take real world data and upload it to the blockchain so it can be used within smart contracts. The most famous oracle service is Chainlink which itself has a market cap of ten billion US dollars.
The market cap or capitalisation of a cryptocurrency is calculated by multiplying the circulating supply by the token price. This is usually a debatable issue with leading websites not including vested tokens and treasury wallets in the circulating supply.
Smart contracts can use price feeds supplied by oracles to help prevent smart contract attacks that manipulate prices such as flash loan attacks.
Flash loans enable the instant deployment of massive amounts of capital which can be used to manipulate the value of assets within a liquidity pool. Pools that use oracles price feeds can reject transactions which are out of line with the current off chain price provided by the oracle.
This article is part of a series DeFi Demystified | An Introduction To Decentralised Finance
This article is derived from a chapter in the free eBook explaining DeFi technologies:
DeFi Demystified | An Introduction To Decentralized Finance
.