Entropyfi Using Chainlink Price Feeds and Chainlink Keepers to Help Power Amplified Prediction Games
We’re excited to announce that Entropyfi is now using Chainlink Price Feeds for our Polygon Mainnet launch as our go-to oracle solution for price data within our amplified prediction games. We’re also using Chainlink Keepers to automate our smart contract workflow for starting/ending prediction markets and calculating users’ profits.
Entropyfi offers prediction games on crypto-assets, NFTs, DeFi indexes, and other on/off-chain assets which rewards users with amplified yields. Users have the opportunity to profit from market movements with zero loss to their wager by depositing assets into Entropyfi. Assets are then deposited into yield-generating platforms to generate interest. Winners of the prediction market will then receive the interest earned by the pool, while all users — regardless if they win or not — will get back their principal.
A key requirement for Entropyfi is the accurate retrieval of relevant prices at the start and settlement of the prediction round. Since Entropyfi provides prediction games on both crypto and non-crypto assets, a time-tested oracle solution that can fetch high-quality data from a range of asset types is key to our application.
Each lossless prediction game has a start date, contribution cut off date, and settlement date. The prediction index price (i.e., X in the market “will Bitcoin be higher than $X at the end of next week?”) is set at the start of the game. Users can only contribute funds between the start date and the contribution cutoff date. At the settlement date, the smart contract needs to be called to then calculate the profit for users. Chainlink Price Feeds provide the prices needed to establish an index price at the start date and calculate profits/losses at the settlement date, while Chainlink Keepers automate calls to the smart contracts in order to trigger the contribution cutoff date pause and trigger the settlement process to execute.
Technical integration of Chainlink in Entropyfi
The Entropyfi test app is deployed on Polygon and can be accessed from https://app.entropyfi.com/#/Prediction. The testnet token acquisition guide can be found on Entropyfi’s Gitbook (https://docs.entropyfi.com/user-guide/getting-testnet-tokens). As Chainlink launches its cross-chain solution, we will likely use it to bridge the governance token across different scaling solutions that we use.
For the integration of Chainlink Price Feeds, we imported the Chainlink aggregator interface for each prediction pool contract and pointed to the specific aggregator that supplies price information for the prediction pair (for example, the BTC/USD price). The first player who deposits assets into the prediction pool will trigger a call to the Chainlink aggregator contract, fetch the asset price, and store it as the round’s index price.
The prediction pool contract also imports the Chainlink Keepers interface. The keeper compliant function checkUpkeep wraps around the condition to check whether it is game start time, settlement time, or none. If the checkUpkeep function returns True, then the Chainlink Keepers trigger the performUpkeep function, which determines whether the start game routine or the settlement routine should be triggered. If the start game routine is triggered, the smart contract deposits everyone’s assets to a lending protocol and locks the pool, and users can’t deposit in the pool until settlement. If the settlement routine is triggered, the smart contract fetches the settlement price from the Chainlink aggregator and calculates the PnL for longs and shorts.
Being a lossless prediction game, Entropyfi relies on accurate, up-to-date price feeds to start prediction games and help ensure fair settlement in both a timely and tamper-proof manner. In addition, Entropyfi will be deployed on multiple scaling solutions as well, so we needed a blockchain-agnostic oracle solution that can accommodate these flexibility requirements.
After researching and comparing multiple oracle solutions, the Entropyfi team chose Chainlink Price Feeds due to its superior data quality and robust infrastructure, as well as its native support for numerous blockchains and L2s. For smart contract automation, we also compared alternative solutions, and found Chainlink Keepers to provide very clear documentation and thorough explanation on its pricing structure. Some of the unique benefits of integrating Chainlink’s decentralized services include:
- High-Quality Data — Chainlink Price Feeds source data from numerous premium data aggregators, leading to price data that’s aggregated from hundreds of exchanges, weighted by volume, and cleaned from outliers and suspicious volumes. Chainlink’s data aggregation model generates accurate global market prices that are resistant to API downtime, flash crash outliers, and data manipulation attacks like flash loans.
- Secure Node Operators — Chainlink Price Feeds and Keepers are secured by independent, Sybil-resistant nodes run by leading blockchain DevOps teams. Chainlink nodes have a strong track record for reliability, even during high gas prices and extreme network congestion.
- Decentralized Execution — Chainlink leverages a decentralized and transparent pool of nodes to provide strong guarantees around services, mitigating centralization risks by establishing high availability and tamper-resistance.
- Low Costs — Chainlink Keepers have several gas-optimizing features that lower the costs of automating maintenance tasks for users, including a rotating node selection process to prevent gas price auction wars and stabilize costs.
“In addition to providing stellar services, Chainlink also has a strong community around it, which is something we really appreciate. We’re excited to integrate these Chainlink solutions to enhance the accuracy and reliability of our prediction markets.” — DC, Product Lead at Entropyfi
“Chainlink infrastructure is proven to be robust and effective. The documentation for Chainlink solutions is comprehensive and easy to understand, which made our integration seamless.” — Daniel T, Tech Lead at Entropyfi
Chainlink is the industry standard oracle network for powering hybrid smart contracts. Chainlink Decentralized Oracle Networks provide developers with the largest collection of high-quality data sources and secure off-chain computations to expand the capabilities of smart contracts on any blockchain. Managed by a global, decentralized community, Chainlink currently secures billions of dollars in value for smart contracts across decentralized finance (DeFi), insurance, gaming, and other major industries.
Chainlink is trusted by hundreds of organizations, from global enterprises to projects at the forefront of the blockchain economy, to deliver definitive truth via secure, reliable oracle networks. To learn more about Chainlink, visit chain.link and subscribe to the Chainlink newsletter. To understand the full vision of the Chainlink Network, read the Chainlink 2.0 whitepaper. Want to discuss an integration? Talk to an expert.
If you are someone that is interested in speculation and don’t like to take risks, you’ve come to the right place 😎
Entropyfi offers prediction games on crypto-assets, NFTs, DeFi indexes, and other on/off-chain assets which rewards users with amplified yields. In other words, you can engage in market speculation without putting your principal at risk. Our platform features:
- Zero loss prediction games
- Permanent long or short position setting
- Roll over winnings week by week to amplify income passively
- Fair game design
Entropyfi is launching on Polygon Mainnet on November 3rd. To learn more about Entropyfi, visit our website and our Medium. Visit Entropyfi’s Gitbook for developer guide and user guide in our Gitbook Docs. For regular updates follow our Twitter and join our Telegram and Discord community.