[Ethereum] Is it possible for a smart contract to be able to adjust it’s conditions based on the current value of Ethereum

contract-designcontract-developmentcontract-invocationlibrarysolidity

I ask this because I want to create a crowdfunding smart contract for a platform much like Kickstarter. At this point, the only crypto asset I want the contract to raise is Ether with the possibility of integrating other ERC20 tokens in the future. The issue I am trying to overcome right now is price volatility. For example, if a client wants to raise £10,000 worth of ETH during the 30 day period of crowdfunding and on the day of listing the project, the value of Ether is £100 each, then 100 ETH is needed for the contract to be successful. However, if toward the end of the crowdfunding duration, the price of Ether drops by 20%, then the client would only get £8,000 worth of Ether. Another issue is if the price goes up dramatically before the end of the project, potentially setting the milestone too high and sabotaging the project.

I would like a way for the contract to be updated every 5 minutes or so based on the current price of Ether to tackle the problem of volatility. So for example, if the price goes up by 20%, then each ETH will be worth £120 and that multiplied by 100 is £12,000 which may be too much. When this occurs, it would be ideal if the contract could somehow be updated and adjust the target goal based on some simple calculations (target goal in GBP / 1 ETH to GBP = target goal in ETH). I want to implement such a feature in order to add some stability to the target goal in ETH in relation to GBP (or other fiat currencies).

I have seen similar implementations that can update contracts based on the value of other crypto assets, such as: Oracilize, which is capable of checking the price of Kraken, but nothing that does so with fiat currency.

Best Answer

You can probably do that using an oracle (see e.g. www.oraclize.it , but others exist) to get ether price in the blockchain.

Note that it seems that you will have your client beeing paid in ether while the crowdfunders will pay in pounds. You want to fix the price in pound, but the volatility of ether could do that you client will either get too much ether (if ether price rises during the crowdfunding) or ot enough.

The only way to avoid that is converting back your client's ether to pounds immediately after getting it, but then there was no point converting pounds to ether in the first place.

Related Topic