People have always had their own point of view on future values. a third party in future disputes has been transferred to centralized organizations such as stock exchanges, bookmakers, banks, notaries and others. With the advent of oracles like ChainLink and smart contracts, it is possible to replace this third party.
What it does
When investors open a position long or short, they bet on the fact that the price will rise or fall in the future. Experts, analysts, traders and others predict the future price. But no one is responsible for the inaccuracy of the forecast with their money, only the investors who opened the position. This project allows investors to make money on the accuracy of the forecast for the price of the underlying asset during the derivative expiration period. The owner of the smart contract issues a derivative with the following parameters: the classification of the underlying asset, the price of 1 derivative, the block number of the Ethereum blockchain of the start of expiration, the duration of the expiration when the expiration price will be calculated. During the expiration period, purchases of derivatives will be stopped, prices are recorded from the Chainlink Oracle to the smart contract and the average price is calculated as the expiration price. After the block > expiration block + duration occurs, a calculation is made with the investors who made the price prediction closest to the obtained expiration price.
5% of the total amount of the bank is transferred to the owner of the contract, 95% of the bank is divided among the rest of the winners. The 10 prices that are closest to the expiry price are determined. The average size of the prizeAvg for payments is determined. Each winner receives: prizeInvestor = prizeAvg - ABS ((priceInvestor - priceExpiration) / priceExpiration)%.
The investor who most closely predicted the price receives prizeWinnerInvestor = bank - (prizeInvestor2 + ... prizeInvestor10).
Each investor takes a prize by calling a method from a smart contract. After the prizes have been awarded, the derivative is closed and the owner creates a new derivative for this underlying asset.
How I built it
It was awesome!
Challenges I ran into
I wanted to deploy the app to GitHub Pages, but I got memory leak error from GitHub Pages
Accomplishments that I'm proud of
I have developed smart contracts and DAPP DEFI with Oracle ChainLink for the prediction market
What I learned
I wanted to develop my own oracle, but I got acquainted with the reliable oracle ChainLink and now this issue is solved for me
What's next for Accurate prediction
The project involves working with various cryptocurrency assets, fiat currencies, commodity assets, the outcome of political, sports and other events provided by ChainLink. It is planned to improve the UX and UI design for these tasks. Work on advertising an application on the Internet, elaboration for SEO, deployment in the cloud for sustainable work. Test coverage of smart contracts and applications. Deploy in main net Ethereum.