Comment on page
Seil's concentrated liquidity pool can also be used as an oracle to give external developers or platforms access to the pool's liquidity data and historical price. This is a new option for the DeFi ecosystem, in addition to the traditional oracles based on off-chain data. The price and data offered by the chain-based oracle is a result naturally determined by actual buyers and sellers in the market.
The historical data is stored as an array of observations. The pool keeps track of a single observation and overwrites it as new blocks are confirmed. The transaction fees paid by users can determine how far back in time the historical data can be accessed.
By storing the price and historical data in the pool smart contract, both the risk of logical errors and the Oracle integration costs are dramatically reduced. It also makes any attempted Oracle price manipulation much more difficult.
Each time observe is called, the caller must provide an array containing an arbitrary number of seconds in the past, specifying the times from which observations are to be returned. Note that each of the given times must be more recent or as old as the oldest stored observation. time observe is called, the caller must specify an array containing any number of seconds ago, denoting the times from which observations are to be returned. Note that any given time must be newer than (or as old as) the oldest stored observation.