It’s 2022, and the crypto community seems to concur with Bitcoin failing as peer-to-peer digital cash and Ethereum not becoming the world’s computer. Yet, trillions of dollars keep circulating in the crypto defi space. No wonder entrepreneurs rush to create a defi app and join this booming crypto economy.
In this blog, we’ll discuss all the intricacies of defi app deployment often overlooked by business owners and provide actionable tips to make your defi app a winner.
- Before building a defi app, you will need to decide at least on the blockchain and the product’s tokenomics. These decisions will drive all further choices of technologies, protocols, etc.
- A genuinely decentralized application cannot be changed once deployed on a blockchain. Therefore, a proper migration strategy for future releases should be considered beforehand. All defi apps with admin keys risk being hacked.
- The key to creating a top-performing defi app is using proven UX/UI tactics from the “web 2.0” niche and streamlining onboarding as much as possible.
Table of Contents:
- Sinking In: DeFi vs. Dapps
- The Future of Decentralized Finance
- Types of DeFi Apps
- Steps to Develop a DeFi App
- Cost to Build a DeFi Application
- Our Experience in DeFi Application Development
Sinking In: DeFi vs. Dapps
I think we should start by clarifying the key terms to confirm we are on the same page. I know the terms dapp and defi get confused quite often.
DeFi (or defi) simply means decentralized finance and describes any blockchain software that has to do with finances. As you know, blockchains thrive on transactions.
In fact, secure, anonymous, intermediary-free, and immutable transactions are the core of any blockchain. So no wonder many blockchain applications are defi by default.
Dapps (or dApps) are decentralized applications. Obviously, a very broad term describing any blockchain application at all, including defi apps and everything in between, like a blockchain app for gathering patient consent or an EHR system on a distributed ledger.
We should also mention CeFi — centralized finance — which in crypto means software like CoinBase. That’s a centralized business entity, a private company with physical headquarters and all other attributes commonly found in traditional off-chain businesses.
From the technical point of view, any CeFi application runs on proprietary servers and is fully controlled by its owners. Yes, such apps still connect to blockchains, but they don’t rely on them for their core features.
In this blog, we’ll be talking about defi application development specifically. So any decentralized software living on a blockchain dealing with cryptocurrencies and defi tokens.
Read more on how to build a dApp here.
The Future of Decentralized Finance
Defi is blossoming into a state-of-the-art digi-economy:
- decentralized protocols grew by 650% to $150 billion in 2021
- the total value locked (TLV) grew by 1,120%
- your friends start asking about crypto investing and NFTs
Defi apps are going mainstream en masse. People discover new ways to invest and earn money on crypto-powered applications: by farming, staking, trading, etc.
At the same time, crypto crime makes the space look spooky. According to blockchain analytics firm Chainalysis, defi protocols lost $2.3b in 2021 due to security issues.
Another threshold to broader adoption of defi applications is UX/UI. A great deal of defi software is designed and built by developers well-versed in crypto technologies. However, for newbies, the interfaces developers come up with often feel overwhelming: customers need to parse through new notions of tokenomics and then catch up with all the UI gear.
On top of that, many newcomers end up using centralized crypto apps like centralized crypto exchanges, looking for quick gains and enjoying intuitive interfaces.
Therefore, developing a successful defi app involves designing attractive retention mechanisms and following security best practices. The latter also includes educating customers on how they can protect their crypto assets.
Types of DeFi Apps
Please note that even though we list them here as different types of defi apps, these features can be successfully combined within a single defi application.
DEXs or simply swaps are by far the most popular defi applications right now. For instance, UniSwap hosts one-third of all transactions on the Ethereum blockchain at its peak times.
Apart from trading, customers can also participate in liquidity pools (aka field farming) when users can deposit and lock their crypto assets, making them available for trading.
We discuss how to develop a DeFi crypto exchange in a separate blog.
Minting, selling, and (lately even) trading digital objects of art have become the latest crypto craze.
Defi apps connecting to algorithmic protocols generate interest higher than in traditional banks. Defi banks offer all sorts of staking and other rewards programs.
The second most popular niche in crypto defi software, although reports indicate that there are not enough borrowers right now, with more customers looking to lend and generate income.
Defi crowdfunding platforms
Decentralized crowdfunding platforms allow founders to raise funds transparently while avoiding overfunding.
Decentralized autonomous organizations are self-governed entities with automated decision-making. Every holder of a DAO token (e.g., MakerDAO’s ERC20 tokens) gets to vote for the project development.
A simple way to represent ownership rights to different material objects on a blockchain.
Steps to Develop a DeFi App
How do we build a defi app that generates enough traction and remains financially viable in the long run? If we strip down any defi app to essentials, we’ll see software that:
- runs on a particular blockchain (or across multiple chains)
- has its business logic (tokenomics) codified in smart contracts
- provides the user interface (web/mobile/desktop applications)
- connects with crypto wallets or offers its own wallet
- might interact with off-chain data
When it comes to user-facing web or mobile apps, defi app development is pretty straightforward. We cover the required steps in various blogs at length (e.g., when talking about fintech app development services):
- discovery phase
- design and prototyping
- quality assurance (QA)
The outlined steps focus solely on creating sticky user experiences and adjusting the software feature set to changing market conditions. In essence, we still need to build a fintech app — only it will operate on a chain.
However, the blockchain-specific aspects of creating a defi application, such as network selection, tokenomics, and others, need a little more attention.
Please note that even though dev teams define most of the following specifics during the discovery step, the crypto space is so dynamic that additional adjustments may occur during product development.
Fortunately, the agile development methodology favors such a flexible approach, allowing for technical and UX changes mid-project, provided they guarantee better product-market fit.
Step #1: What blockchain to use?
Today, the Ethereum network is hands-down the largest defi platform. The chain’s total value locked (TVL) metric shadows the rest of the competition.
However, such popularity comes with a cost. As more and more people are joining the defi economy, whether to take their chances with NFTs or trading, along comes network congestion, and as a result lower transaction speeds and higher costs.
How can we explain to a newbie that a simple transaction in our decentralizedapp on Ethereum may cost them $60-$120 in network fees?
Not surprisingly, defi app development companies have started to look for alternatives. As you can see from the graph, 2021 was the year when other blockchains started making a noticeable dent in Ethereum’s defi monopoly.
So, how do you choose a blockchain to develop a defi app?
- support for smart contract
Smart contracts are the heart and soul of any defi app because it contains all the business logic of an application. Therefore, the chain must support them. Fortunately, most new blockchains do.
- user adoption
How many users does the chain have, and what is their economic power?
- network fees and speed of transactions
Of course, we are looking for a balance of minimal costs and max speeds.
- technology stack
What programming languages are required for writing native defi applications? Is this something entirely new with few developer resources available, or can we use Solidity (smart contracts) or Go like on Ethereum? What’s the development environment like?
Read more on how to create a smart contract here.
- developed ecosystem?
Finally, the choice will depend on the versatility of the defi apps already present on the chain. Have acclaimed Ethereum titles like Aave or UniSwap already migrated to this new chain? Does the blockchain have open defi protocols and bridges to other networks?
Finding answers to these and other similar questions will help you find the most appropriate chain to start a defi app. Other chains that often pose as candidates for creating a defi application include:
- Terra ($13,2b)
- Binance Smart Chain ($11,9b)
- Avalanche ($9,1b)
- Fantom ($8,7b)
- Solana ($7,6b)
- Polygon ($4,8b)
These chains also follow Ethereum in terms of TVL metrics. Of course, the choice will also depend on the nature of your product and whether or not it will need to integrate with other chains too.
Step #2: Define tokenomics
Tokenomics is the most crucial part of any decentralized application. Of course, certain types of defi software, like portfolio managers, don’t require creating a crypto token to set up a defi app.
However, most successful decentralized financial applications introduce new tokens and different mechanics for working with them, for example:
- donating to a liquidity pool
In addition, you will need to decide whether the token you create will be inflationary or deflationary, how it will be distributed/awarded to users, what consensus mechanism it will support, whether users holding the token will have any voting rights, if it will be a stablecoin or not, and many many other things.
All these logistics will live in smart contracts that work as immutable servers running on a blockchain. By the way, when it comes to decentralization, there’s something we need to discuss.
How much decentralization do you want?
One of the issues with blockchain apps is they are hard to update. I mean, the user-facing mobile and web apps are fine: they still run on the cloud, and you can update them as frequently as you need. In the background, they still talk to smart contracts.
But how do we update the smart contract with all the business logic? After we deploy a defi app, its smart contract remains completely immune to any changes, just like any data on a blockchain. Making changes would mean developing a new contract, deploying it to the chain, and connecting the front end pieces to this new contract.
At the same time, there are technologies allowing for more ingenious contract updates where we can use a proxy contract that can point to a newly deployed smart contract. We can use tools like OpenZeppelin for this purpose.
One thing to remember, though, is this method introduces an entry point for bad actors because the proxy contract is managed with admin keys. If the admin keys have been compromised, a hack will likely happen.
Step #3: Integrate crypto wallets
Since every defi deals with crypto, it stands to reason that users will need a crypto wallet. The usual practice is to allow customers to connect their own wallets that they have come to trust.
On the other hand, nothing prevents you from developing your own crypto wallet and offering private keys (usually in the form of a seed phrase) to users. Why do most decentralized applications advise users to bring their own crypto wallets?
- the trust issue
- focus on pro users
- faster time to market
That said, having your own crypto wallet integrated with your defi app, especially if it offers any extra functionality besides transactions, e.g., monitoring yields, is a benefit. I suggest using tools similar to Everchain, supporting multiple tokens and coins from different blockchains.
As for integrating with existing non-custodial wallets, we can use services like WalletConnect, which greatly simplify the integration process, and require minimum user input to connect.
Step #4: Working with oracles
Sometimes a defi needs to get off-chain data for correct execution. Let’s say we’re building a defi app for travel insurance. Our smart contract will need data on canceled flights and weather in order to trigger transactions to customers eligible for insurance payouts.
This off-chain data comes from oracles, aka data feeds. Ideally, we’d need to rely on solutions like ChainLink because their oracles essentially mimic blockchain operations with independent nodes reaching consensus before submitting the results to a blockchain.
Otherwise, a centralized oracle, which can be hacked, becomes a significant threat to our defi app.
Cost to Build a DeFi Application
The cost to make a defi app may vary significantly, e.g., from $60,000 to $300,000, depending on the scope. Development of a DEX for swapping tokens will naturally require way more effort than building, say, a mobile crypto wallet or other more straightforward defi projects.
One thing to note here is that when you are building a defi application that only works with on-chain data and doesn’t make any transactions on the blockchain, the cost tends to be lower. That’s because, in this case, you are building a web 2.0 application reading data from a chain(s), and no smart contract or blockchain development is necessary.
Our Experience in DeFi Application Development
The reality is only 1 percent of the Earth’s population takes part in the crypto revolution. I believe defi apps will be the next wave of adoption, offering intuitive user experiences like fintech apps built around traditional financial services.
One of the recent defi apps we built was Bury Finance which completely alleviates all crypto complexities from the user experience, introducing newcomers to the high yield crypto gains.
Even though the mobile app uses stablecoin-based protocols to invest customers’ funds in crypto, they still get the dollar-equivalent representation of their portfolio. We continue enhancing this product with even more powerful and promising integrations.
It’s an inspiring example of how to design a defi app that captivates customers’ attention and delivers actual value.
Frequently Asked Questions
Is there a way to combine defi with cefi?
I believe that will be the next big wave in the defi/cefi space once institutional investors start to massively join the crypto finances. If you represent an enterprise looking to merge defi and cefi in an attempt to create a compelling solution, reach out.
How do I guarantee the most security for my defi app?
The most glaring security holes include missing event emissions, incorrect input validation, the use of an unlocked compiler version, and reliance on unaudited third-party APIs.
Can you build a defi wallet?
Yes, if you have the vision for a killer feature.
How do I monetize a decentralized application?
Even though decentralized software often implies free participation (meaning no subscriptions or gated content), you can set up fees paid to developers’ addresses. Another option is to get value from proprietary tokens tied to your application.
How long does it take to build a defi app?
4-6 months for an MVP.