Skip to main content

Chainlink Oracle

Web3 Sheets Demo: Chainlink

Example Explanation

This demonstration uses Chainlink Oracle (which tracks ETH/USDC pricing) and features functions outlined in Custom Functions relating to historical timestamps to track token pricing.

  • A2 =CALLCSTR("2",$A$3,"description()") - returns the name of the Chainlink oracle contract.

  • A5 =CALLINT("",$A$3,A4)*10^-8 - returns the last reported price.

  • A7 =CALLINT("",$A$3,A6) - returns the timestamp of the latest update.

tip

To convert a seconds timestamp to the date format enter the following: =[unix timestamp]/86400+Date(1970,1,1)

  • B2 =CURRENTBLOCK() - returns the current block

  • C10 =BLOCKTOTIMESTAMP(block number) - returns the timestamp in the date format for the requested block number.