Spiral DAO. Smart Contract breakdown. DeFi yield aggregators explained. How to create a DAO.
In the world of decentralized finance (DeFi), Spiral DAO stands as a promising entity, offering a capital-efficient and intuitive framework for yield farming enthusiasts.
I have written this article to cover how a DAO is created by going through some steps Spiral DAO had to consider in the process.
So, by the end of this article, you will both have a deep overview of Spiral DAO and at the same time you will have learned the steps needed to be taken while building a DAO.
I’ve taken the chance to give a short introduction about yield farming and yield aggregators as well. This will give you some understanding before continuing.
Join me on this journey as we unravel the inner workings of Spiral DAO.
Shall we?
Content
Introduction
→ How DAOs work?
→ What is yield farming?
→ What is a yield aggregator?
How to create a DAO?
→ 1. Define the structure of the DAO Project
→ 2. Decide the type of DAO
→ 3. Decide about DAO Token: Supply, allocation, and incentives
→ 4. Create Your DAO (Smart Contracts breakdown)
→ 5. Create Your DAO Treasury
→ 6. Create a Community
Introduction
How DAOs Work?
DAOs rely heavily on smart contracts, which form the foundational framework that dictates how the DAO will operate.
Those with a stake in a DAO then get voting rights and may influence how the organization operates by deciding on or creating new governance proposals.
The voting process for DAOs is posted on a blockchain. Users must often select between mutually-exclusive options.
What is yield farming?
Yield farming is the practice of staking or lending crypto assets in order to generate high returns or rewards in the form of additional cryptocurrency.
In this process, the investor is the liquidity provider (LP), and the liquidity pool is a cash-filled smart contract.
The automated market maker is another critical network component in yield farming that allows users to trade through an automated system via liquidity pools.
What is a yield aggregator?
Yield aggregators are a set of smart contracts that pool investors’ crypto assets (tokens), and help crypto investors maximize their passive income from yield farming by consolidating staking contracts across different protocols.
Yield aggregators combine the investments of various farmers (crypto investors) to facilitate profit earning using different strategies while remaining idle and waiting to accumulate passive income.
How to create a DAO?
1. Define the structure of the DAO Project
Determining the core structure of the DAO should be the first concern if you are planning to make one from scratch.
What do you expect your DAO will achieve? What are your goals?
Spiral DAO is built to be the most capital-efficient DAO while being intuitive for newcomers and complementary to the whole ecosystem.
We aim to optimize our market position and open a new chapter in yield farming.
Is there a current difficulty in your industry that a DAO could solve?
According to our estimation, bribes markets are inefficient, resulting in at least $30mln of inefficiency annually. SpiralDAO is here to capture it.
The DAO Treasury utilizes bribe markets and liquid lockers to reach a necessary level of each token exposure and beat the inflation of each token.
Simply as the byproduct of how Spiral DAO operates, it makes the bribe market more rational and efficient for all participants and protocols that engage in bribing mechanics.
Will your community, consumers, and customers benefit from a DAO?
This model makes Spiral DAO beneficial for:
Farmers. As they receive a higher yield than anywhere else.
Other protocols. Yield rewards are preserved and collected instead of being sold, reducing the circulating supply and sell pressure of the tokens it accumulates.
Token holders. Spiral DAO allows users to participate in the governance process of numerous protocols by holding only one token — SPR, a token with a backing ratio designed to grow over time.
2. Decide the type of DAO
Spiral DAO is a Decentralized Autonomous Organization (DAO) dedicated to acquiring the most relevant and important DeFi governance tokens within a single community-controlled DAO Treasury.
Similarly to yield aggregators (such as Yearn, Beefy, and Harvest), Spiral DAO aggregates liquidity, but instead of continuously selling reward tokens from third-party protocols, Spiral DAO redirects and secures them within the DAO, thus reducing the selling pressure and circulating supply of tokens of the protocols it supports.
3. Decide about DAO Token: Supply, allocation, and incentives
Spiral DAO distributes native SPR reward tokens to its users, providing an additional yield boost and incentive for Liquidity Providers (LPs) to pool their liquidity and contribute their yield within the Spiral DAO treasury.
Spiral DAO has designed a new staking model that utilizes mechanisms similar to bonding, where the protocol distributes the native protocol tokens for some other tokens with a discount.
For Spiral DAO yield farmers, the protocol mints an amount of SPR form proportionally higher in USD value than the rewards that could be obtained via existing protocols alone. This additional yield can be considered a “discount” for obtaining our native token.
4. Create Your DAO
As mentioned above, DAOs rely heavily on smart contracts, hence let’s take a look at some of Spiral DAO’s smart contracts:
Spiral.sol. — Spiral token (SPR)
It represents governance power for all of the treasury assets
It’s distributed for staking liquidity into Spiral DAO Convex/Balancer/Frax liquidity pools with additional yield
It is a staked version of COIL
Besides minting and burning tokens, the smart contract is also responsible to set the governance address on deployment and has a function to update it. Only possible by the previous owner.
function setGovernance(address _governance) external {
require(msg.sender == governance, "!governance");
require(_governance != address(0), "wrong address");
governance = _governance;
}
COIL.sol. — Coil token (COIL)
Token holders can stake their COIL tokens to receive COIL token rewards.
This ensures that token holders are protected from dilution caused by the inflationary nature of COIL whilst receiving a decent APR. In exchange for staking, COIL users receive a wrapped version of COIL — SPR.
This smart contract has a similar implementation to Spiral.sol. Also handles its own governance, which in this case it’s indicated that should be owned by a multisig.
SpiralStaking.sol. — Used for staking and unstaking SPR and COIL.
By taking a look at its constructor, we can see that we’re going to be interacting with SPR and COIL as they are assigned an address.
And it sets the owner or ‘guard’ as the msg.sender
ISpiral public immutable Coil;
ISpiral public immutable Spiral;
address public guard;
constructor(address coil, address spiral) {
Coil = ISpiral(coil);
Spiral = ISpiral(spiral);
epoch.number = 1;
epoch.length = 2400;
epoch.endBlock = block.number;
guard = msg.sender;
}
And by taking a look at the stake()
and unstake()
functions we can reaffirm what was mentioned above.
In exchange for staking, COIL users receive a wrapped version of COIL — SPR.
function stake(uint256 amount_) external {
rebase();
Coil.safeTransferFrom(msg.sender, address(this), amount_);
Spiral.mint( msg.sender, (amount_*initialIndex) / index );
lastStake[msg.sender] = epoch.number;
}
function unstake(uint256 amount_) external {
rebase();
Spiral.safeBurnFrom(msg.sender, amount_);
Coil.safeTransfer( msg.sender, (amount_ * index) / initialIndex );
}
MasterMind.sol. — It definitely seems to be, literally, a mastermind contract as it is handling many things such as:
Keep reading with a 7-day free trial
Subscribe to DeFi Protocol by code to keep reading this post and get 7 days of free access to the full post archives.