This repository provides various examples of sample code that uses Tellor. Note that there are different checks and best practices depending on the specific use case and user profile. The examples specified in this repo are:
- Price feeds
- Slow data (e.g. the CPI thats updated monthly)
- Prediction Markets
- Tellor as a fallback to a centralized oracle
- Reading from another EVM chain
- YOLO User - a baseline oracle user that just verifies the data is valid tellor data
For more in-depth information about Tellor, check out our documentation.
git clone https://github.com/tellor-io/SampleLayerUser.githardhat:
cd SampleLayerUser
npm iUsing tellor layer is simple:
- Have a bridge contract on the chain you want to use (TellorDataBridge). There should already be a live bridge for most users, but if you're working with a new chain, feel free to reach out if you want us to deploy it!
- Request data from the tellor chain (via a tip)
- a few seconds later, grab a proof of the verified data from the tellor layer chain. Can be found here explorer.tellor.io/oracle-bridge
- submit the data proof to your contract to update your contract with oracle data.
For more advanced users, if you have further questions or if you want to run a reporter yourself, please head to docs.tellor.io/layer-docs
Hardhat:
npx hardhat testConfigure your network in your hardhat.config with the correct network/gas settings.
Setup config variables relevant to your setup. The default variables are for INFURA_API_KEY, ETHERSCAN_API_KEY, TESTNET_PK, and MAINNET_PK:
npx hardhat vars set INFURA_API_KEYThen, in scripts/DeploySampleMVPUser.js, change the dataBridgeAddress to correspond to the correct address corresponding to your deployment network https://docs.tellor.io/tellor/the-basics/contracts-reference. Change the queryId to the correct queryId for the data you want to read. Change the NODE_URL to the correct value for your deployment network.
Next run:
npx hardhat run scripts/DeploySampleMVPUser.js --network <my_network>
Check out our issues log here on Github out in our Discord
This repository is maintained by the Tellor team - www.tellor.io
Tellor Inc. 2025