Defi flourishes on the Ethereum platform, but it comes with limitations that eth has not been able to overcome: transaction validation time and transaction fees are too high. The peak times of transaction costs on Uniswap went up to $ 50 just to transfer $ 10. Harmony has improved on those two and could be the perfect place for building Defi applications. Therefore we want to build a new Defi application on Harmony platform with a completely new concept inheriting the idea of lending and borrowing.
What it does
Cashback is an e-commerce platform that allows users to purchase items for a refund in the form of HRC20. Each product will have a corresponding refund rate. After being reimbursed in HRC20 form, users can staking that amount of HRC20 to be able to Yield Farming to generate a corresponding ONE, after each day 2% of the HRC20 is converted to ONE. Therefore it will stimulate the user to buy so that it can increase the rate of pay normally. Users can withdraw the converted ONE at any time they want, however when withdrawing the HRC20 amount will be burned corresponding to the percentage of ONE withdrawn. This will stimulate users to staking the HRC20 amount to be rewarded with more ONE.
- Aiming at the converting needs of buyers. We have integrated Chainlink blockchain technology to fetch the price of ONE and convert the price of the product from ONE to USD. This makes it easy for people to know how much the product is worth in USD.
Users will have 2 main streams to interact with Cashback
- Buy item activity :
- Withdraw interest activity:
Market - Where you can choose product to buy:
- Select item:
- You must sign in before buying and sign transaction:
- Transaction successful:
Show purchased products:
Interest will be increased daily based on the amount of Sun coin you hold:
- You can withdraw the interest at any time but the sun coin will be burned:
How I built it
Cashback is built on 2 smart contracts, Market and Point. Market is used to coordinate activities on exchanges such as buying, selling, withdrawing money, ... Contract Point is a temporarily customized HRC20 contract that cannot be transferred between accounts, but will only play the role is staking and to calculate the amount of daily ONE that a user will be paid for by staking.
On the client side, we use vuejs to build, combined with harmony-sdk to help users interact with the application through MathWallet.Users buy and sell as well as keep Hrc20 cash back through mathWallet
Challenges I ran into
The first is the construction of smart contracts, unlike eth, we can test directly on remixes, to build contracts on harmony we mostly use unit tests to be able to audit our contracts. In addition, the way to interact with the extension wallet is not really perfect.
Accomplishments that I'm proud of
What makes us proud is our idea, although it is inherited from Defi lending, it has not been applied on any real product. If this idea is deployed we think it will have great applicability. To solve the problem of user compensation, we are also building a cross-chain using cosmos to switch between native tokens, which could open up new doors for the Cashback:
- Products can be purchased on the app with many different tokens
- The exchange fee between the tokens will be used to pay for the staking HRC20 cash back on the Cashback e-commerce platform as well as for the liquidity providers for the cross-chain bridge.
What I learned
We learned how to come up with an idea together and step-by-step completed it. Learn how to divide your work properly. On the technical side, we learned more about a blockchain platform - Harmony, how to build smart contracts and interact with them.We learned how to deal with moving parts and stay on top of constantly changing dependencies and protocols
What's next for Cashback
First, as mentioned above, we are building a cross-chain protocol with cosmos, however the hackathon time is limited so it is not enough time to submit this product - this product will be like a the bridge between Harmony and ETH - from which users can buy and sell products on the Cashback floor with existing tokens.
Next we want to make Cashback a marketplace where people can sell their products at their own rates of return (the competition benefits the buyers). Successful transactions will be charged and this fee will be used to pay bonuses to those who are staking HRC20 cash back when buying items.