EOS Rio Price Oracle is now avaliable \o/

in #eos5 years ago (edited)

eosriopriceoracle.jpg

We're happy to announce the EOS Rio Price Oracle, a service that can help EOS developers get information about exchange rates of different cryptocurrencies.

During our last hackathon, FamilyEOS, a cool project that aims to help poor families in Venezuela encountered a problem; they needed the EOS/USD exchange rate from a reliable source to finish one of theirs smart contracts. We helped to search the web, but we didn't find one. That's when we built the Oracle.

It is incredible to see how necessity drives innovation. By fostering new projects, we can see our ecosystem's gaps and work on solutions for it.

How does the EOS Rio Price Oracle work?

The service stores information of exchange rates in a Multi-Index Table on the EOS blockchain, where any developer can access the data.

To do that, the Oracle retrieves the exchange rates of a specific pair from different exchanges every 30 seconds, and then, update the information calling an action on the smart contract.

How do I use it ?

For now, only the EOS/USD ticker is available. You contract is deployed on eosriooracle
and you can access it using "cleos get table eosriooracle eosriooracle ticker".

If you are developing a smart contract you'll need to include the following structure in your code in order to have access to the data:

        struct exchange {
            string exchange_name;
            double exchange_price;
        };

        TABLE ticker {
            name ticker_name;
            vector<exchange> exchanges;
            double avg_price;
            string timestamp;

            uint64_t primary_key() const {return ticker_name.value;}
        };

typedef multi_index<"ticker"_n, ticker> ticker_value;



And then, create an instance like this:

ticker_value tickers("eosriooracle"_n, "eosriooracle"_n.value);   



Feel free to use it on your projects! If you need information about different exchange rates, please make sure to contact us, we'll be happy to help!

For more details, please visit https://github.com/eosrio/eos-price-oracle


Made with ❤ by EOS Rio

medium-14.png

We are Block Producers on the EOS Mainnet & WORBLI Network

Website
GitHub
Telegram
Twitter
Medium
Meetup

Sort:  

Extra excellent idea mate