CZK FX rate on chain - Radek Švarz | BeerFi#2
BeerFi Prague - Web3 Builders Meetup·Fri, Oct 7, 2022, 12:00 AM
Slides: https://github.com/gweicz/beerfi/blob/master/events/2022-07-26-beerfi2/slides/CZK%20FX%20rate%20on%20chain%20-%20Radek%20%C5%A0varz%20(revealjs).zip https://beerfi.gwei.cz/ #czk #oracles #stablecoin #smartcontracts #ethereum
Transcript
okay folks um i have a a little bit longer lighting talk um so this talk which i'll have i will expect some discussion afterwards uh on that um so let's start um i don't know if you have heard that on chain we do have um fx rates for the different currencies it's typically provided by oracles is there anyone who doesn't know what the oracle is please raise a hand yeah yeah you got it it's it's really from what we understood the oracles are that they are like forecasting the information you know trying to give you the information uh basically towards the public so that's we do have those articles uh one of the most known i would say ones is the chain link oracle which provides different kinds of data uh typically um we would think about the uh the tokens or the currencies they they provide forex and and also they provide a cryptocurrencies their value uh how it changes they collect it and then they've provided there uh for quite some time already for several months i've been in discussion with the chain link on actually setting up their uh check chrome ethics rate on chain for us for the developers to be able to consume it and to use it in the projects um and i've been also discussing with them already that it could be working for uh as as many chains as possible so not only for the ethereum but also for the other ones which are more legit or more mature i would say um this is the slide which i presented on the east prague on the quadratic funding um so the fact is that we would present uh the we would we would like to bring the c6k usd uh uh rate on the uh on to the chain so something similar the channeling has for the other currencies they already have it for euro they have it for the british pound they have it for the police lottie they have it for the swedish krona and for i don't know how many 20 or something like that for x currencies why do they use the usd the the reason is that um the usd is most commonly used currency uh like fight currency uh when referring to the cryptocurrencies so the usd in fact acts as some sort of the proxy again the proxies but this time like monetary proxy or pricing proxy for the forex towers the crypto uh we'll talk about a little bit later um and there is some budget related and so on so i present it there and here it's about the current status in fact once it is implemented uh it will look like this that we will have here cjk slash usd there will be about six oracles providing that information or from different sources that some topic which we are sticking this still discussing what are what would be the sources and these oracles uh the information from there that will be aggregated and somehow uh averaged and so on they have the whole process on that and as a result we will have like one price going out of this contract so the contracts literally on blockchain they will be able to use this um there are some aspects on how often it is being updated there are two um two uh let's say triggers one is this deviation threshold so the fact is that the chaining is like monitoring uh monitoring off chain the uh that rate and if that uh moves uh more than 0.3 percent higher or lower then it triggers the update towards the and trying to get the data and updated on chain the the second parameter for the update is heartbeat and typically for these forex currencies is 24 hours so the usd towards the crypto it's like updated very often and then the 4x towards the or or czk uh towards the usd by default it would be like 20 every day but if it uh deviates more than 0.3 or something it will update yeah so that's that's the way of how it will work uh besides well what the police lottie has we will have it on more target chains that's that was the request and now towards the code because we are here on the like coding session in solidity it it should be easy as this so you will just import some um some chaining contracts here and you we will need to know that that address for the aggregator this is something that's to be done by channeling but then we'll just say okay here's the price feed and let's have the uh price from the price feed so it will be as easy as that and then we will be able to work with that within the contracts um for the if we will want to get something else then c k slash usd uh we'll just have to consume two price fees and then manually work with that within our contract so well here's the example that we can consume see the cases usd uh secondary we will consume each slash usd and all of that just by the calculation we will be uh able to uh get to czech slash eth or anything else uh what is there provided um then the next topic is the historical data that's also quite important here are those uh triggers which i mentioned the problem with the historical data is that there are no time ticks we are we are often used to the fact that when you look on the charts you you think about in months weeks days hours minutes you know that's quite typical especially for the traders uh here in the under contract level or on this oracle level there are no time decks you you don't have like one minute and then plus four minutes plus four minutes no uh because only once when it is triggered you have a new uh new information on the chain so you need to work out somehow and translate your request on the specific time and transpose it into what or where you want to ask for so this is complicated but this is due to the fact how it is designed and not to blow the blockchain by you know the data of every second um so that was for the evm uh there are also channeling already provides documentation for solana basically it should be also quite easy that you have a structure which you get from some from some contract in the result the answer actually means the price so that supposedly it should be easy i'm not a solar programmer so i do not know exactly if there are if there is anyone here i would welcome here some discussion on that uh cardano and polkadot was also mentioned that it should be supported by the chain link not immediately but i mentioned like end of this year or something uh it's interesting there are no recommendations for that um we had the polkadot there were several statements on the integration using substrate i found the articles in 2020 but i could announce yeah yeah something like that announcements announcements and you cannot really find a code yeah let's discuss it later um so but in order to provide it there are some still open issues one is the forex statement if you go to the chairlink website they have this mentioned there it is not advised to use forex fees outside of market hours for a specific currency um basically what normally or in in the forex trading you would understand you have like a business hours then you close and it could like deviate somehow strangely um not sure how it is here oh i asked chandling to actually clarify this what it means because because normally any contracts are typically stable coins they really need to consume these fees and they do consume it during the weekend so this is quite a strange statement and we do know what happened right with luna and so on um second issue which we have been discussing for quite some time is those data sources how reliable are there you know can you know what was their credibility and so on um then and the key issue here is to understand those data sources for proper handling in booking in in booking uh you have a different approaches when you have it like from the from the general market from the you know from the forex markets and you have a very different approach and you know questions when you have it from the czech national bank you have very different approach when you have to apply it for uh the customs because the customs also is providing the uh the prices so uh we need to know how this is formed and that's after several sessions with chaining i asked them look we will have here like a template statements and please just choose the one which fits the most which i expect is this one that actually that that rate it's like daily 24 7 market rate from different markets and also like bloomberg so it is i used to work in a bank and i do know that banks are actually uh taking the the prices from from these agencies like the bloombergs and reuters the the second option is the uh that it is actually taken from the czech national bank which i believe it is not the case and the third option that it is provided from the european central bank which i also believe it's not the case but we need to have a statement from the chain link on this in order to to provide it to the accountants and the other uh people who would work with that the other issue uh to uh have this actually for the czechrona is a legal entity um uh while the chaining requires the contract now and i don't mean the uh the programmable contract but the regular contract to be signed with the legal entity so they are saying okay we will assure it but there has to be a counterparty who is like requesting this um and currently there is no legal entity established for this in fact it's a low cost relationship but it is there so i'm looking for the options uh how to solve this um the other issue is the budget uh i believe that we need to have like a runway budget for two years uh in order for the projects to really like jump on and start using it and actually prove that that it makes sense to have this um the the chaining is asking about 350 uh usd per month to cover the gas costs to actually bring it you know two words towards the chain and thanks to the east aquatic funding we have ensured some budget in fact for almost like one year it was a great experience from that and potentially we have been discussing within the people who are in bohemian dell that there will be also provided some partial budget to actually start this and currently a little bit less than 6 000 usd is yet to be insured to have it at least running for photos for those months so if you would know about the sources on how to at least budget it i have the idea that we would create um some page which would say look here is the way how to work with that and here are the sponsors who are actually sponsoring these years and the open question here towards you is uh whether you would know or you would think about any projects that could utilize or use this this feat and that's all yeah yeah the questions yeah i had the question i know a project is called japanese network and they like they create synthetics of fiat currencies and they have the czech corona and i thought they were using something like this you know because they say they use a oracle from chinese but you are saying that the jarvis network is already using the oracle 4chan and having the chacronaut yes and i was wondering like because would you explain this i was like thinking what they are using you know yeah that's that's confusing because if you look into the the data of the chain link it's the chakron eyes is not mentioned anywhere but let's check it that's a good point you know if it already exists then it's good okay anyone else ah come on would you use that who who who would who would use the czech krona in the project yeah one only one it's kind of hard to find real real life usage from this especially so what it's really hard to find any any usage of this i'm just thinking myself like who would really want that and i'm struggling to give an answer i can imagine wallets for instance why i would use a checkround to use the rates that lives inside the blockchain i mean i can it's really hard to understand why why it has to be on blockchain okay there are a few more questions then i will come back to this can you speak up there's not been many icos or idols depending on how they are called now raising parts for new projects but if we want to respond to this project through direct blockchain utilization you might need to raise it in the chatroom instead of other types of currencies and we will need this [Music] perhaps for new projects on boarding like like versus ether so you need to do that double level oracle usage which is very nice but i don't think we have enough data for czech in the market yeah regarding the stablecoin that's that's another approach about but that's what we can talk about for quite a long time but that's right yeah yeah this is prerequisite for a check stable coin yeah yeah i mean for stable that would make sense otherwise i don't know the fact that we don't have that this is not having any time kicks it's really i think problematic because it's in general whatever whatever chaining feat you would be using you don't have the time takes so you have to like recalculate towards that i don't think it's not that big of a vision not having tightness because usually we are most interested in like the recent most recent information so you know that you have to look at somebody or so the key benefit has understood is that you can reference this rate directly from the smart contracts right because of it already and we want to like misuse this information uh in the fact that since it's short on on the chain that that if it has like a statement of some sort of the credibility or reliability basically since it's on the chain it's immutable even those historical data and then it's like uh more valuable for the accountants to actually use that even if they have like accounting audits yeah i think it has really helped all this service to your change if some smart think company you just want to oracle to just send it to this like chain and chain doesn't use it like that's that's not like a reason for having well i'm saying that there is like more more uses not only for the contracts but also this one is there a way to use it in connection to station programs fundamentals taxation problems [Music] that's par for the accounting thing and that is that finally externally i mean check for ground so it's like your project is it really depends on the check flow i believe that you can just check lock and save use check bank quotes and whatever well no the problem is the czech national bank is that they do not have a they do not have a rates for the cryptocurrencies so you need to find some way of actually related to that and the current way how the accountants are doing that is that you come to learn and you say um i actually bought that on this centralized exchange and i was sending that i don't know for instance coinment or any coin and you say okay i i use the check crowns and you know that that's the rate which i used but that's definitely not a middle rate yeah you know so because normally you're accounting with the middle rates and uh so there will be like rate okay this is this is the rate which i with which i purchased that uh but only depending on that one exchange particle one the other person will use i don't know kraken or you know today it's more like finance for instance you know so there will be like uh two parties will have like different will be claiming with different sources if we have it like brought on on the chain then this can become more reliable for those accounting uh situations and definitely for the taxation so you would you would expand it to like the usd to eat and that way you would like to say okay yeah i will tell you something that's that's my decision for everyone finally i don't know but then you need to pay more taxes if you find some exchange that allows you to buy the lower price than average you're providing so i know it's challenging that's all i think it will be which will be any other thoughts yeah so i was actually thinking about something similar today there's this project called oracles and it's a new thing uh launched just this year and then from my oracles for a couple currencies and an old dollar again whatever i would love to see also check crown there and why is it because then you can make a contract like a hedging contract for your wallet then you have a button in your word that says log the value into crops the value of your holdings in the wallet are the same with respect to the check crowds so if the if the value of the bitcoin would go up it would get less bitcoin but it would still be the same check crown's value and vice versa if the period will become crash we will get more bitcoins of uh the same check around them and i think this is an interesting alternative to stable coins it's kind of more decentralized and i think i think this could boost the adoption a lot because all the times the the merchants that accept bitcoins and they say like okay now i accept it or the price goes down i don't want to do that right so if there was a button uh blocked early i think this could uh potentially be a huge thing for the for the adoption by the dimensions so i would definitely want to see some uh [Music] to use it as an index as an index for futures trading basically when you have um in future trading you have a motivation for the market to be closer to the real value so that your bitcoin cost 40 grams and your futures are also around 40 grams and not 60 not 60 degrees kind of unfair so usually exchanges have some sort of index basically aggregated data from other sources like bitmaps users coinbase kraken and something else they forget about it so they they are regarding this quote and providing index and then granting i believe either commissions or some general commissions uh basically for traders that are going against this so this quote and chain can be used for similar purposes if someone needs check promise using features great thanks [Applause]
Automatic transcript — names and jargon may be misspelled.