How do smart contracts know off-chain prices?
Prices are generally updated on-chain when the deviation reaches a set threshold or a specified heartbeat interval elapses. Lending and derivatives protocols use prices provided by oracles to calculate collateral value and execute liquidations.
If an oracle is manipulated, contracts that rely on its price may liquidate incorrectly, so it’s important to diversify data sources and sufficiently decentralize the nodes.
$LINK is the token of the decentralized oracle Chainlink.