Inspiration (Problem Statement)
Klade allows anyone, living anywhere, to trade weather derivatives and insurance. Say you own an ice cream shop on the coast and you are concerned that climate change may lead to flooding. Our application, Klade, allows you to get insurance for your shop on your terms using the power of Blockchain. Anyone in the world can buy and sell you insurance/derivatives via Klade. Opening up the market to the whole world allows more people to get protection from the increasingly volatile weather. A farmer in India can easily use Klade to get protection against prolonged droughts just as a businesswoman in Boston with a snow-plowing business can get protection against a low snowfall. (*as of right now, Klade only has integrated Earthquake and temperature APIs but precipitation and flooding is coming soon)
Often, the impacts of climate change disproportionately fall on lower income families/individuals. Part of what we hope to do with this project is give anyone, living anywhere, the ability to protect themselves effectively against a volatile and uncertain future.
Ethereum solves a lot of the security challenges of this project. We don’t keep custody of user’s money, but just provide a platform through which they can interact with Ethereum. Additionally, Ethereum allows our website to be global from the start as crypto is accessible anywhere. Blockchain allows the entire process to be decentralized. The only party the user must trust in the transaction is the API that is used to get weather data.
What it does
Klade is a platform where anyone can list and trade "Klade contracts", which are insurance or derivative smart contracts. A smart contract is computer code executed trustlessly on the blockchain. Our platform allows a businessperson or individual to open a contract and look for a counterparty. Additionally, investors and insurance companies can use the platform to find contracts they want to invest in. The platform also allows individuals to interact with contracts in other ways such as pay their premiums or claim the insurable event occurred. Anyone in the world can use the website; all they need is an Ethereum account. Klade is a platform both for investors looking to invest and trade weather derivatives/insurance and people looking for protection for their business or property.
We have written a standard form smart contract that can be used for a wide variety of "insurance-like" weather derivatives as well as a "stability" contract code that can be used for a variety of derivatives. These contracts use Provable, which is a smart contract library on Ethereum, to get API data into the contract and disperse returns accordingly.
How I built it
Klade is an application built on the MERN stack. The website uses Metamask to allow users to interact with Ethereum. When a user decides to open a new custom contract on Ethereum, the website sends a request to our server to add a contract with that address to our database. The database verifies the contract is a Klade contract, and then adds it to the database with the contract parameters. Then, it can be seen on the open contracts page. Our server has a cronjob running each minute that checks the Ethereum blockchain using the Infura API for changes to the contracts in our database and updates the database accordingly. For example, if someone takes the other side of a contract, it is not longer considered "open" and will not be listed on the open contracts page. But it can still be interacted with using the interact with custom contracts page.
Challenges We Ran into
The biggest challenge was finding suitable APIs for the smart contracts. We have integrated an earthquake API and temperature APIs, both sourced from U.S. government agencies, which enable users to deploy earthquake insurance contracts and heating and cooling index contracts. However, we are looking to integrate more APIs to allow users to trade other types of weather (most importantly a precipitation API that will be valuable for farmers).
Accomplishments that I'm proud of
I am proud that we persevered through many frustrating challenges with Metamask integration and more broadly working with the crypto ecosystem. Ethereum has changed a lot over the last three years and documentation isn’t fully caught up, so occasionally online resources had outdated information or incorrect information.
What I learned
We learned more about smart contract development and the process of testing with Remix/Metamask. We can definitely apply lessons from this project on connecting to Metamask and interacting with Ethereum in any other decentralized applications.
What's next for Klade
We can open it up to Beta testers on the Ropsten Testnet, a system functionally similar to Ethereum but with fake Ether which has no real-world monetary value). Hopefully we will be able to improve the product during this time and catch any further security bugs before we connect to “main-net” Ethereum and allow real transactions to start!
Some additional features we would like to add include:
- Having the contract call multiple APIs to get confirmation on the weather.
- After a user connects to Metamask, have a page that shows the users all the contracts of our format they are currently a party in. Additionally, provide info such as the overall risk and expected return of their entire portfolio of weather derivatives along with graphs.
Built With
- domain.com
- ethereum
- etherscan
- express.js
- mongodb
- node.js
- provable
- react
- solidity
Log in or sign up for Devpost to join the conversation.