Decentralized Finance (DeFi) solves many problems with the current financial system. DeFi can do everything that the traditional financial system does (and even more) but in a more efficient, trustless, and cheaper way. It achieves this by relying on distributed ledger technologies (DLTs), like Radix, that remove the need for intermediaries when transacting and give asset control to the users.
If you were involved in the crypto industry during the summer of 2020, you will remember it being dubbed the “DeFi summer.” During that summer, there was a surge in the development of decentralized apps (dApps) and services that offered financial services like exchanges, collateralized lending, overcollateralized stablecoins, and more! These protocols were built using smart contracts. Likewise, the amount of users and the total value locked on the Ethereum ecosystem sky-rocketed to all-time highs attracting even more developers. This was just the beginning of DeFi. We saw so many innovations from that period, and we can expect the same thing to happen in the next one.
Just like the lending challenge we did last summer, we are partnering up with Devpost again for this challenge. This time, we have even bigger prizes to win for selected submissions. The prize pool contains $50K worth of XRD and will be split between 8 submissions.
Continue reading for more information on the challenge and the prizes.
Starting today, you have five weeks to come up with a Scrypto blueprint with DeFi functionality. All previous Scrypto challenges had a very specific subject - like decentralized exchanges, lending, and DAOs, to name a few. This time around, the subject is broader. We are simply asking you to build a Scrypto blueprint borrowing features from the traditional financial system or a blueprint implementing novel ideas that are not even possible in tradfi. Also, you can team up with others or work independently. Whatever your preference is, we encourage you to participate.
$50,000 in XRD worth of prizes will be awarded to the eight submissions that are of the highest quality and that surprise us the most. The top three submissions will split 28 500$. The first place will receive $11,500 in XRD. The second place will receive $9,500 in XRD, and the third place will receive $7,500 worth of XRD.
On top of that, we are going to select three submissions that we consider “honorable.” Each will receive a prize of $3,500 in XRD. They may be showing original solutions to certain problems, apps that are innovative, or that we simply find cool. We don’t have specific criteria for this category. Just impress us!
We are also going to give $5,500 worth of XRD for the best submission showcasing a dApp that works with perpetual futures. This dApp must include a way for people to buy derivative contracts and sell them at a later time of their choosing. If you plan on going that route, we suggest reading this Binance article, and this one from Coindesk that outline what perpetuals are and how they can be used in crypto. Finally, $5,500 worth of XRD will also be given for the best submission of a lending protocol. The lending protocol must include a way for people to borrow assets and repay their debt afterward. We give a couple of decentralized lending protocol examples below if this is something you want to build.
Examples of DeFi apps
DeFi is a very broad field. To help spur your ideas, here are some examples of DeFi protocols that already exist:
Decentralized Exchanges (DEXs) are probably the most widely known category of Defi products. They are on-chain applications allowing people to exchange tokens in a decentralized manner. Unlike centralized exchanges, they allow access to everyone at any time, and they offer full transparency on their liquidity and on everything happening on the platform. Also, on some platforms, anyone can contribute to the liquidity and receive a reward.
Some popular examples of decentralized examples are Uniswap, dYdX, and Curve. Back in February 2022, we ran a Scrypto challenge around decentralized exchanges. We suggest looking at the submissions for inspiration.
Lending is also a very important aspect of DeFi. You might be wondering how it is possible for lending to work on a decentralized network where it’s hard and sometimes impossible for projects to identify their users. How can they make sure the users don’t just run away with the money? Some very smart people thought about this and found different solutions. For example, many projects only offer overcollateralized lending. This means that people have to lock in an amount of another token with a higher total value than the tokens they are getting lent. Since the price of the token used as collateral is constantly changing, it means that the total value of the collateral could become less than the amount lent. In that case, people are able to trigger a liquidation to pay the loan back. This incentivizes people with active loans to keep topping up their collateral.
Some popular examples of lending protocols are Aave, MakerDAO, and Compound. Back in June 2022, we launched a Scrypto challenge around lending. You can find more information about it here and find the submissions for inspiration here. Note that RDX Works will be looking for lending dApps for the next cohort of the grants program. This challenge is thus a good way for you to build your project prototype!
Some say that stablecoins are the heart of DeFi. They are very important for any DeFi ecosystem to be successful. Stablecoins are tokens whose price follows that of a fiat currency or another asset. Popular ones are USDC, DAI, and Binance USD (BUSD), which all follow the price of USD. USDC and BUSD rely mostly on off-ledger processes to keep the price constant and might not be the most interesting examples for this competition. Another interesting category of stablecoins is algorithmic stablecoins, which rely on on-chain processes to keep the token price constant. Maker DAO’s DAI is an example of this.
Yield Aggregator Platforms
Most decentralized applications rely on liquidity provided by the people from the community. To entice them to lock in some liquidity, they often offer a reward issued as another token. This allows people to gain yield on their assets that they would not otherwise have if they simply kept the tokens in their wallet. This encourages people to constantly be on the lookout for the protocols offering the highest yield at the current moment. This can be time-consuming and tedious. People have thus started building yield aggregators. This allows liquidity providers to lock their liquidity on a single platform that then invests it on the projects offering the best yield.
Option and Derivatives
Derivative contracts are contracts that derive their value from an underlying asset. The person who sells these derivative contracts holds the underlying asset and may choose to write and sell a derivative contract, providing the prospective buyer an option to buy or sell the underlying asset at a specified time in the future. The contract writer will want to write and sell derivative contracts to receive immediate income in hopes the contract expires and becomes worthless, preventing the buyer from exercising the contract in which the contract writer will still hold on to the underlying asset yet receive an income for selling the contract. On the other hand, one reason the buyer wishes to purchase these derivative contracts is that it allows for cost savings. The underlying assets of the contract are often sold at a discount compared to if the underlying asset was purchased directly. We’ll provide more resources on how to understand option and derivative contracts in the resources section, but the underlying technical mechanics that can allow for derivative contracts to exist in decentralized ledgers are through the representation of NFTs, particularly “Financial NFTs” (FNFTs). FNFTs can be used to represent control over an underlying asset by using it as a badge that provides access to an asset held inside a Vault. Like a derivative contract, a FNFT can be transferable and derives its value from an underlying asset.
Here are a couple of examples:
Revest Protocol features using NFTs (formerly Financial NFTs) to secure and grant access to a vault that holds the underlying set of tokens. There are two conditions to have access to the contents of the vault:
- Having possession of the FNFT itself.
- One of the three possible locking mechanisms based on time, value, or the identity of the caller.
The FNFT itself can be freely transferred (traded), but the tokens contained within the vault remain locked. Additionally, while the FNFT can accrue value, the value of the FNFT does not affect the value of the underlying tokens contained within the vault.
Resonate Finance applies a similar concept around FNFTs. The FNFTs are used to secure and grant access to a vault that contains tokens. However, it also composes with Yearn Finance such that users can lock their tokens into a yield-bearing vault and receive upfront payment on the present value of the future yield they could have earned. The rights to the token’s future yield can then be sold at a discount to the expected value of the interest to another party. This approach unlocks liquidity for many token holders. For example, if a user has 100 USDC they can earn a yield of 10% on by depositing it into Yearn Finance, they'll have to wait for a year before they will be able to withdraw 110 USDC. This financial product allows the user to earn a fraction of that yield upfront while a counterparty can purchase the right to the remaining future yield.
The Judging Criteria
When the challenge is closed for submissions, the Developer Ecosystem team at RDX Works will review the submissions and decide on the winners based on these criteria:
- Quality and asset-oriented-ness of your code.
- Did the developer follow asset-oriented design patterns, such as identifying users with badges and letting the user withdraw instead of sending tokens directly to an address?
- Breadth of functionality.
- The more the user of the blueprint and component can do, the more points the developer gets.
- Creativity of the concept.
- Did the developer implement something that we didn’t think about or found original solutions to attack a specific problem?
- Quality of the documentation and comments in the code.
- Did the developer write documentation explaining how the blueprint worked and how to test it? Did they write comments in their code to help people understand it?
- Quality of the frontend code and interaction with the mobile wallet
- Did the developer provide frontend code that interacts with their Scrypto blueprint on Betanet using the demo Radix mobile wallet? How is the quality and documentation of the frontend code? Learn how to build a frontend here. You don’t have to publicly host your frontend. As long as we are able to run it locally you are going to get your points.
With the release of the Betanet and the developer version of the mobile wallet, we changed the last criteria from previous competitions to give more points to participants who provide a working frontend interacting with the wallet that we can test locally. For a quick guide on how to work on the live Betanet test network, visit the GumballMachine on Betanet v2 example.
How to Participate
To participate in this Scrypto competition, please do the following:
- Read the competition’s DevPost page for more details on the challenge.
- Install the Scrypto toolchain and make sure you are on version 0.8 with “scrypto --version.”
- Fork the challenges repository.
- Clone the forked repository on your local environment.
- Start a new scrypto project with the command “scrypto new-package [name]” inside the “7-defi-devpost” directory.
- Before the deadline on March 24th, 2023, at 10:00 pm UTC, commit and push your project folder and create a pull request here.
- Send us your submission through DevPost.
- Come say “Hi!” in the #scrypto channel of our Discord server. The community will give you a warm welcome and help you with whatever questions you might have.
Scrypto Learning Resources
Do not worry if you don’t know how to code with Scrypto, as it is a very easy language to learn. Here are some resources to get you started with Scrypto for your submission:
- Go through the Scrypto 101 course here.
- Read the Radix documentation here.
- Look at Scrypto code examples here.
- Look through previous challenge submissions here.
- Join the Radix and Scrypto community on Discord to ask your questions!
Details of the Challenge
- Your entry must be built with Scrypto v0.8.
- You can submit multiple entries, but only one will be considered for the prizes.
- The competition starts on February 20th, 2023, at 9:00 am UTC. All entries must be submitted no later than March 24th, 2023, at 10:00 pm UTC. The winners will be announced by April 18th, 2023.
- $50,000 value of XRD will be shared between the three best submissions, the three honorable mentions, the best example of a perpetuals dApp, and the best example of a lending dApp. The value of XRD will be based on the spot price when we send the tokens.
- Decisions on the winners are at the sole discretion of the RDX Works team, and the decisions are final.
- We will keep track of the prize NFTs and their owners internally until after Babylon release, when they will be minted and sent to Radix addresses provided by each participant.
All entries are subject to the Radix competition terms and conditions. Winners will be required to disclose their name, DOB, and country of residence to receive any XRD prizes.