avatarAlex Roan

Summary

The author describes the process of creating a decentralized finance (DeFi) application using existing blockchain tools and services, without spending any money.

Abstract

The author, inspired by the growth of DeFi on the Ethereum blockchain, set out to create a user-friendly DeFi application. They utilized existing platforms and services, such as Zerion, Ramp Network, and Compound, to build a savings account-like feature with an easy-to-use interface. The author also addressed the wallet problem by implementing multiple wallet options using Web3Modal. The application was then hosted for free using Github Pages. The author's goal was to create a simple and accessible DeFi application using blockchain lego, and they named their creation "Easy Ether."

Opinions

  • The author believes that DeFi has a promising future, with over $1 billion locked up in DeFi protocols on Ethereum.
  • The author acknowledges the complexity of existing DeFi platforms and aims to create a more user-friendly alternative.
  • The author sees the requirement for users to already own cryptocurrency as a roadblock and uses Ramp Network to simplify the onboarding process.
  • The author chooses to implement multiple wallet options to cater to a wider range of users, despite preferring a more streamlined approach.
  • The author emphasizes the importance of a minimalist interface to avoid overwhelming new users.
  • The author values the contributions of various blockchain products and services that facilitate the growth of the industry.
  • The author expresses their enthusiasm for the future of blockchain development and encourages more developers to get involved.

How to Create a DApp With Blockchain Lego

The story of how I created a Defi application without spending a penny.

Photo by Xavi Cabrera on Unsplash

I created a DApp in the simplest way I knew how to: by piecing together the work of others.

Access to DeFi

Decentralized Finance (DeFi) is huge in the blockchain world right now. With over $1Billion locked up in DeFi protocols on Ethereum alone, it has an interesting future ahead.

I don’t have the manpower to create my DeFi ecosystem, so how can I build something useful? To start, I needed to know what was out there already.

After some research, I stumbled upon a platform called Zerion. Zerion is essentially a dashboard that brings together all of the major DeFi protocols. It shows interest rates you could earn, exchange rates to take advantage of, liquidity pools, and borrowing rates.

A great tool, but a mainstream internet user will take one look at it and be terrified.

Figure 1: Zerion.io

Instead of being paralyzed by dashboards like this, what if there was a platform that was as easy to use as setting up a bank account and choosing the best interest rate?

How can I build that?

Entering the market

With Zerion, like most DeFi platforms, there are a lot of assumptions that are made regarding its users. The first being access to a wallet, and the second, a supply of ETH, since every transaction costs GAS (a fraction of ETH). To do anything, before landing on the DApp, the user needs to already own Crypto. Roadblock.

Can I build, or use, a product that makes this assumption less of a roadblock?

Enter Ramp Network.

Figure 2: Ramp Network instant purchasing tool

Ramp Network is a fairly new player in the space but makes crypto purchasing very easy. It boasts an extremely easy library to integrate with and has great code examples to help visualize. Figure 3 shows how easy it is to use.

Onboarding, done.

A savings account

Savings is something that every traditional bank user is familiar with. Whilst interest rates are at all-time lows across the western world, DeFi provides an alternative (if you can figure out how to be involved).

So, how can earning interest on Crypto be easy to understand and easy to use?

The myriad of competing DeFi protocols

Aave, Compound, UniSwap, Maker, etc, etc. So many big names are making big moves locking up huge swathes of Ether. I needed to find the easiest to integrate, and display it as a “Savings Account” with a “Current Interest Rate”.

After some digging, I found that Compound allows anyone to deposit a single asset into a liquidity pool, which then gives interest at a variable rate. The asset can be withdrawn at any point. This guide walks through how to supply an asset to the protocol from your code.

We have our savings account.

The wallet problem

We’re still assuming that each user knows what Metamask is and has it installed in their browser. This is a problem I envisage raging on for some time in the DApp space, at least until Google implements an Ethereum wallet in its Chrome Browser.

I’ve written about the pains of DApp wallets several times. Metamask was the first to market, so has dominated the space. However, there are now competitors that enable users to interact with DApps without any browser extensions. They’re not perfect, but they are a step in the right direction. Some enable access with social media accounts like Google or Facebook login, some allow access with phone numbers, some email. These are good products, but which should I implement?

The answer, for now, was as many as possible.

I’m not a fan of this answer. The idea of my DApp is to reduce choice and make the process simpler, not add more choice. However, it is temporary. Until a wallet breaks through as a frontrunner (which I’m hoping Google can provide, despite no whisperings of such a project even existing), enabling all options and seeing who wins out is better than implementing one, forcing users of others away.

What’s the best way to make all options available? Web3Modal.

Figure 5: Web3Modal example

Web3Modal provides a slick library for enabling as many leading wallet providers as possible inside your DApp.

Again, I’m not a huge fan of implementing this, since it goes against what I set out to achieve. However, weighing pros versus cons, implementing it adds more value than not.

The docs are pretty easy to follow, and so long as you have developer accounts for the implemented wallet platforms, you can make them available in your code.

Minimalist interface

As to not overwhelm uninitiated users, I needed to build an interface that had so little options it’s impossible to get lost. I needed at most, 2 operations available to users at any given time. I also wanted it to be kind on the eye. Figure 6 shows an early implementation.

Figure 6

I used React, Redux, and Bootstrap (react-bootstrap package) to get the app off the ground.

Hosting the DApp

Hosting costs money. Or does it?

So long as you build a DApp that is entirely front-end, and you’re not worried about the URL (which can be fixed later), you don’t need to spend any money on a hosting provider. Instead, you can use services like Heroku, or Github Pages to host for free.

I chose the latter since it’s where my code repo is housed anyway!

Following this article, integrating any front-end application with Github Pages is super easy.

And it’s live.

Introducing Easy Ether

So that’s it, my very own DeFi platform. Created using Blockchain lego, pieced together to make something usable (although whether or not it gets used remains to be seen).

I have so much appreciation for the people behind the products and services I’ve outlined in this article. Ramp, Compound, Web3Modal, Github Pages, and all the wallets. It’s companies, people, and products like these that facilitate the blockchain market to thrive by breaking the mould.

I can’t wait to see where this industry goes.

I’m going to continue developing this DApp over time. I’ve had some interest come through on twitter from some of the people behind the products described here, which is great to see on my part.

Also, I hope this article goes some way to show how easy it is to make products that have genuine use-cases and garner interest in the industry. The more developers that get involved in Blockchain, the better.

Further Reading

If you’re interested in blockchain development, I write tutorials, walkthroughs, hints, and tips on how to get started and build a portfolio. Check out some of these resources:

Blockchain
Programming
Cryptocurrency
Finance
Ethereum
Recommended from ReadMedium