Ultimate magazine theme for WordPress.

Spiral DAO. How to create a DAO. Yield Aggregator Explained.

1. Define the structure of the DAO project

Determining the core structure of the DAO should be the first concern if you plan to build one from scratch.

  • What do you expect from your DAO? What are your goals?

Spiral DAO is designed to be the most capital efficient DAO while being intuitive for newcomers and complementing the entire ecosystem.

Our goal is to optimize our market position and open a new chapter in yield farming.

  • Is there a current problem in your industry that a DAO could solve?

In our estimation, bribery markets are inefficient, at least what they are $30 million of inefficiency annually. SpiralDAO is here to capture it.

The DAO Treasury uses bribery markets and Liquid Locker to achieve the required level of each token engagement and suppress inflation of each token.

Simply as a by-product of how Spiral DAO works, it makes the bribery market more rational and efficient for all participants and protocols operating bribery mechanisms.

  • Will your community, consumers, and customers benefit from a DAO?

This model makes Spiral DAO beneficial for:

farmers. Because they achieve a higher yield than elsewhere.

Other protocols. Earnings premiums are received and accumulated instead of being sold, reducing the circulating supply and selling pressure of accumulated tokens.

token holder. Spiral DAO allows users to participate in the governance process of numerous protocols by owning just one token – SPR, a token with a backing ratio that is designed to grow over time.

2. Decide on 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.

Similar to yield aggregators (like 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, reducing selling pressure and circulation token deployment of the supported protocols.

3. Decide on DAO tokens: supply, allocation and incentives

Spiral DAO distributes natively SPR Rewards tokens to its users that provide an additional revenue boost and incentive for Liquidity Providers (LPs) to pool their liquidity and contribute their earnings to the Spiral DAO Treasury.

Spiral DAO has developed a new staking model that leverages mechanisms similar to bonding, where the protocol distributes the native protocol tokens against some other tokens at a discount.

For Spiral DAO yield farmers, the protocol mints a set of SPR forms whose USD value is proportionally higher than the rewards that could be obtained through existing protocols alone. This additional yield can be viewed as a “discount” for getting our native token.

4. Create your DAO

As mentioned above, DAOs rely heavily on smart contracts. So let’s look at some of Spiral DAO’s smart contracts:

spiral.sol. — Spiral Token (SPR)

  • It represents the governance authority for all Treasury assets
  • It is distributed into Spiral DAO Convex/Balancer/Frax liquidity pools with additional returns for staking liquidity
  • It is a staked out version of COIL

Besides minting and burning tokens, the smart contract is also responsible for setting the governance address upon deployment and has a feature to update it. Only possible through 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 use their COIL tokens to earn COIL token rewards.

This ensures token holders are protected from dilution due to inflation of COIL while still receiving a reasonable APR. In return for staking, COIL users will receive a boxed version of COIL – SPR.

This smart contract has an implementation similar to Spiral.sol. Also manages its own governance, which in this case should be owned by a multisig.

SpiralStaking.sol. — Used for staking and detaching SPR and COIL.

If we take a look at the constructor, we can see that we will interact with SPR and COIL when they are assigned an address.

And it sets the owner or “guardian” as the news sender

iSpiral public steady coil;
ISpiral public constant 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 if we take a look at the stake() and unstake() functions, we can confirm the above again.

In return for staking, COIL users will receive a boxed version of COIL – SPR.

Function Stake(uint256 amount_) external {
Fox();
Coil.safeTransferFrom(msg.sender, address(this), amount_);
Spiral.mint( msg.sender, (amount_*initialIndex) / index );
lastStake[msg.sender] = epoch number;
}

function unstake(uint256 amount_) external {
Fox();
Spiral.safeBurnFrom(msg.sender, amount_);
Coil.safeTransfer( msg.sender, (amount_ * index) / initialIndex );
}

MasterMind.sol. — It definitely seems to be a mastermind contract in the truest sense of the word as it covers many things such as:

function init(address newOwner) external override initializer {
_roles().owner = newOwner;
}

function updateService(address newService) external override onlyService {
_roles().service = newService;
}

function _claim(uint256 poolId, address to) internal {
_updateUser(poolId, msg.sender);
_rewarder().value.claim(poolId, msg.sender, to);
}
Function Deposit(uint256 PoolId, uint256 RewardableAmount, Bool ClaimRewards) external override nonReentrant {
require(rewardableAmount > 0, “Deposit: Amount must be greater than zero”);

if(claimRewards) {
_claim(poolId, msg.sender);
}

PoolInfo storage pool = _poolInfo().pools[poolId];
pool.target.lockableToken(pool.targetPoolId).safeTransferFrom(msg.sender, address(this), rewardableAmount);

_deposit(poolId, msg.sender, rewardableAmount);
_updateUser(poolId, msg.sender);

emit Deposit(msg.sender, poolId, rewardableAmount);
}

function retire(uint256 PoolId, uint256 RewardableAmount, Bool ClaimRewards) external override nonReentrant {
require(rewardableAmount > 0, “Reward: Amount must be greater than zero”);

if(claimRewards) {
_claim(poolId, msg.sender);
}

uint256actualWithdrawAmount = _withdraw(poolId, msg.sender,rewardableAmount);
_updateUser(poolId, msg.sender);

PoolInfo storage pool = _poolInfo().pools[poolId];
pool.target.lockableToken(pool.targetPoolId).safeTransfer(msg.sender,actualWithdrawAmount);

emit Withdraw(msg.sender, poolId,actualWithdrawAmount);
}

Function Drain(uint256[] storage pool IDs) external override onlyAllowedDrainer {
for (uint j = 0; j < poolIds.length; j++) {
PoolInfo storage pool = _poolInfo().pools[poolIds[j]];
ITarget target = pool.target;
uint256 targetPoolId = pool.targetPoolId;
target.claimReward(targetPoolId);
IAdapter adapter = IAdapter(address(pool.adapter));
uint256 rewardTokenCount = adapter.rewardTokenCount();
for (uint i = 0; i < rewardTokenCount; i++) {
IERC20 rewardToken = adapter.rewardToken(i);
uint256 tokenAmount = rewardToken.balanceOf(address(this));
if (tokenAmount != 0) {
RewardToken.safeTransfer(_drainAddress().value, tokenAmount);
emit Drain(poolIds[j]Address(rewardToken), tokenAmount);
}
}
}
}

Rewarder.sol. – Manages fees, user updates and pool rewards, among other things.

bool private_migrated;
IERC20 public immutable reward token;
IMasterMind public immutable masterMind;
IRewarderVault public immutable RewarderVault;

Mapping (uint256 => PoolInfo) public poolInfo;
Mapping (uint256 => Mapping (Address => UserInfo)) public userInfo;
uint256 private MAX_REWARD_PER_BLOCK_PER_POOL = 100e18;

address of public developers;
address public Dao;
uint256 public constant FEE_BASE = 1000;
uint256 public devFee = 100;
uint256 public daoFee = 100;
uint256 public devDebt;
uint256 public daoDebt;

Constructor (
IERC20 _rewardToken,
IMasterMind _masterMind,
IRewarderVault _rewarderVault,
address _dao)
{
require(address(_rewardToken) != address(0) && address(_masterMind) != address(0) && address(_rewarderVault) != address(0), “Wrong Init”);
RewardToken = _rewardToken;
masterMind = _masterMind;
rewarderVault = _rewarderVault;
dev = msg.sender;
dao = _dao;
}

SpiralRouterV1.sol. — As usual, it is the router contracts that users interact with. It’s the first layer.

And so here we find three different swap functions:

function swap(
address tokenIn,
address tokenOut,
uint256[2] call datasets,
uint256 minAmountOut
) external
Function CurveSwap(
IERC20 TokenIn,
IERC20 token out,
uint256 amountIn,
uint256 minAmountOut
) internal
function balancerSwap(
address tokenIn,
address tokenOut,
uint256 amountIn,
uint256 minAmountOut
) internal

5. Create your DAO Treasury

Spiral DAO’s Treasury consists of several governance tokens and part of stablecoins. The treasury department is based on a multi-sig system and distributes liquidity across different strategies, with three main objectives in mind:

  • Protecting the Treasury from dilution – The market share of a token at Spiral DAO should continue to increase.
  • Identify, create and deploy safe strategies to use profitable, sustainable sources of income.
  • Efficient treasury management – Balanced assets within the Spiral DAO Treasury to reflect the aligned risk profile of the Spiral community.
  • fair exit – If the value of the total supply of COIL becomes less than that of the Treasury, DAO will perform buybacks or provide another way to redeem its tokens for a small penalty.

6. Create a community

Spiral DAO has built a community through Twitter and Discord, and uses a portal called Snapshot, which is used to submit and vote on proposals related to DAO governance.

Learn Crypto Trading, Yield Farms, Income strategies and more at CrytoAnswers
https://nov.link/cryptoanswers

Comments are closed.

%d bloggers like this: