July 13, 2024

Demeter 2.0 is Live

Demeter 2.0 is Live

Published by Sperax Team

Published by Sperax Team

Demeter is a protocol that enables DAOs to launch and manage decentralized exchange (DEX) liquidity pools and farms on platforms like Uniswap V2, Uniswap V3, Camelot V2, Camelot V3, and Balancer V2. The protocol simplifies the process of incentivizing liquidity for the DAOs' native tokens without requiring coding expertise. Demeter automates the creation, management, and reward distribution for liquidity pools, providing support in engineering, marketing, and financial incentives.

Launching Demeter Farm (For Farm Admins)

Steps to Launch a Farm

  1. Approve Fees Spend: Users must first approve the spending of the fee token for the farm creation fee. The fee is 100 USDs on Arbitrum. On any chain not supporting USDs, it can be any other stablecoin supported on that chain.

  2. Input Pool and Farm Parameters: Users must provide the necessary parameters for the pool and farm.

  3. Execute Transaction: A transaction is executed to create the farm and pay the farm creation fee.

    • Reversion Conditions:

      • If the pool does not exist, the transaction reverts.

      • If the user does not have enough fee tokens to pay the fee, the transaction reverts.

Pool Parameters

  1. Token address

  • Token A

  • Token B

  1. Fee Tier (for Uniswap V3 Pools)

  2. Liquidity Parameter L - An LP token parameter that is set based on the user’s liquidity inside the pool. Updating this parameter will allow the farm users to add or remove liquidity. When the LP token is updated, the LP token should start receiving rewards based on the new L parameter. This will allow users to add or remove liquidity without having to unstake their entire LP position.

  3. Active Liquidity Time Check - (a Boolean value of true or false which determines whether the position is in the current price range) - To check if the position is in the current price range, as only that liquidity will be rewarded which is in range. However, users will be allowed to remove any locked liquidity during the period when the liquidity is not in the current price range.

Base Farm Parameters

  1. Farm admin: It is the address that will have admin control on the farm. It can be the same as the deployer’s address or any other desired address that will be used to manage the farm.

  2. The price range for the LP

  3. Reward tokens

    • Token addresses

    • Token address managers: Each token will have its own token manager.

    • Reward tokens have to be added at the time of farm creation and can't be added or removed after the farm is created. Maximum 4 reward tokens are possible for a farm.

    • For reward tokens emitting fixed APR, the Token manager will be the Rewarder contract deployed through the Rewarder factory.

  4. Cooldown Period for Locked Liquidity - The number of days users have to wait after initiating cooldown before they can unstake from a locked position. Only whole numbers are allowed for this parameter.

    • If the Cooldown Period = 0, then the farm only allows the creation of unlocked positions. Unlocked positions can be unstaked anytime.

    • If the Cooldown Period > =1, the farm will allow the creation of both locked and unlocked positions. For unstaking a locked position, users have to initiate cooldown and wait for the cooldown period before unstaking.

  5. Start date time stamp - Reward emission starts from this date. This date can be changed by the farm admin using admin functions (updateFarmStartTime). However, date change is not allowed after the farm starts.

    • The farms start accepting liquidity immediately after the creation of the farm contract. However, the reward accrual starts from the farm start date time stamp.

  6. Annual Percentage Return APR - The farm admin can set a fixed APR which will guarantee a reward to the LPs based on the current price of the reward tokens. The farm admin will also have to choose one or more base tokens out of the tokens present in the farm for the calculation of the daily number of reward tokens emitted.

    • Let’s say APR set = APR%.

    • Total value of Base Tokens in USD = Σ (Number of Base tokens in farm x USD value of Base Token)

    • No. of Reward tokens per day = [(APR x Total value of Base Tokens in USD) / (100 x 365)] / (Price of 1 reward token based on the oracle)]

  7. Maximum number of Rewards Tokens Emitted Per Day - The farm admin would be able to add the maximum number of reward tokens per day that the farm can distribute, to prevent any deficiency in the farm’s reward tokens in cases when many LPs deposit on the same day since then all the withdrawals may also happen on the same day.

    • It will override the reward tokens value calculated using the formula mentioned above in point no 6. The rewards emitted per day will be the minimum of the amount calculated above or the maximum reward rate set by the reward manager.

Expirable Farm Parameters

This is a new feature which has all the above parameters along with the expiry date feature:

  1. Expiry Date - Farms will have an expiry date associated with them. Users can specify the expiry date while creating the farms. The initial launch fee of 100 USDs (or some other stablecoin if USDs is not present on that chain) will add 100 days to the farm expiry. After that users have the option to extend the farm expiry date. Post that users will have to extend the farm in the multiple of 1 USDs/day with a minimum of 100 days at a time and a maximum of 300 days.

    • Farm admins will not be able to update any farm parameters once the farm has expired. However, they can remove any unclaimed reward tokens from the contract.

    • Farm users can still claim any accrued rewards from the farm or remove liquidity from them once that farm has expired.

    • Farms that have expired will be available on the Dashboard for removing liquidity up to 30 days beyond expiry. After that the farms will only appear on the expired farm list and admins cannot make the expired farms active again. Users or admins will be able to apply all actions through the smart contract.

    • Expired farms shall be removed from the Sperax Gauge and will not be eligible for SPA rewards.

    • Farm does not accrue rewards after the expiration so users can call the updateFarmRewardData function on the farm to accrue rewards before farmEndTime to avoid any loss of rewards.

Fee

  • Demeter will charge a flat $100 fee to launch the farm, which will add 100 days to the expiry date set during the creation of the farm.

  • After that users have the option to extend the farm expiry date. They can do so in the multiple of 1 USDs/day with a minimum of 100 days at a time and a maximum of 300 days. The fees can be paid in either USDs or any other stablecoin provided USDs is not present in that chain.

  • The fee collected belongs to the SPA stakers and can be transferred directly to the wallet address where all Sperax protocol fees are collected. The fee amount can be changed in the future through governance.

  • The Fee details can be fetched from the getFeeParams function on the Farm registry contract.

Farm Management

No one can make changes to the farm contract once deployed. Farm admins can do the following:

  1. Transfer farm ownership to another address

  2. Change the start date of the farm - The farm will emit rewards from this date. The date can be changed after farm creation. However, date change is not allowed after the farm starts.

  3. Update the cooldown period of the locked positions

  4. Pause or Unpause the farm

  • Pause the farm - All reward distributions are paused, LPs do not earn any rewards during this period. Withdrawals are allowed (including lockup LPs) and users can also claim previously accrued rewards. Admin/managers can make changes to the distribution rates and the other parameters when the farm is paused.

  • Unpause the farm - Resume the reward distribution. The reward distribution rate remains the same as set by the reward managers.

  1. Update the Expiry Date of the Farm by paying Subscription FeesFarm admins can choose and update the expiry date of farms as mentioned in the Farm Parameters.

  2. Close the farm - The farms can be closed before the expiry date and will automatically get closed once the expiry date is reached. Once the farm is closed, all liquidity providers including lockup users can now unstake their liquidity pool tokens and claim the accrued rewards from the farm.

Reward Management

Each reward token will be assigned a reward token manager. Farm admin cannot update the reward token manager once the farms are deployed. Reward token managers can do the following:

  1. Add reward token balance

  2. Update the reward distribution rate per second for each token. Only future distribution rates can be affected by this. Reward distribution can be paused by setting the rate to 0. These actions can be done:

    1. For all liquidity providers.

    2. For lockup liquidity providers (If the cooldown period is greater than 0)

  3. Changing the maximum number of token rewards per day - Farm admins can increase or decrease the reward tokens limit in the fixed APR model as per their choice.

  4. Withdraw reward tokens (Any rewards already accrued to LPs cannot be removed).

  5. Transfer reward token management to another address.

Setting up a Farm Position (For Liquidity Providers/Retail Users)

Adding a Farm Position:

  1. Select the farm: LPs need to choose the required farm from the whitelisted farms that are present on the dashboard, based on their choice of tokens and price range.

  2. Enter the number of farm tokens: Post that, they can enter the number of one of the tokens for the position, the other tokens are automatically calculated.

  3. Execute Transaction: The user then needs to approve the wallet transactions for the spending of tokens and the creation of a farm position.

    • Reversion Conditions: If the user does not have the required tokens in their wallet, the transaction reverts**.**

  4. LP Token: On successful execution of the transaction, the Liquidity Provider will receive the LP token(s) in their wallet.

  5. Depositing the LP Token: Users then need to deposit the LP tokens inside the farm to create a position.

Updating Liquidity in the LP Tokens:

  1. Updating the Liquidity Balance - This will allow LPs to add to or remove liquidity from the LP Token without having to unstake their entire LP position. When the LP token is updated, the LP token should start receiving rewards based on the new L parameter.

Rewards Emission:

  1. Fixed APR Rewards - The LPs will receive fixed APR rewards (this fixed APR will be set by the farm admin) generated from their invested farms. Each farm will have some base reward tokens which will be the base for calculating the number of reward tokens to be emitted per day. The LP will receive the reward tokens (selected by the farm admin) in their wallet, which will be calculated as:

    • Let’s say APR set = APR%.

    • Total value of Base Tokens in USD = Σ (Number of Base tokens in farm x USD value of Base Token)

    • No. of Reward tokens per day = [(APR x Total value of Base Tokens in USD) / (100 x 365)] / (Price of 1 reward token based on the oracle)]

  2. Maximum number of Reward Tokens Emitted Per Day - However, the number of reward tokens to be emitted by the farm has been capped. The farm admin would be able to add the maximum number of reward tokens per day that the farm can distribute, to prevent any deficiency in the farm’s reward tokens in cases when many LPs deposit on the same day since then all the withdrawals may also happen on the same day.

Sperax Off-Chain Governance Process:

The Sperax DAO governance process primarily utilizes the Sperax DAO Governance Forum. For a proposal to be accepted, it must go through the following phases:

Phase 0: Casual Ideation (Discord):

If you have an idea you’d like to share, please feel free to post it in #DAO-discussion channel on Sperax Discord, or, if you prefer to submit a proposal, you can use the SIP Template and submit your concept in the Proposal (Active Discussion) channel.

Phase 1: Governance Proposal (On Forum)

If you are ready to submit a formal proposal, you may do so on the Proposal (Active Discussion) channel using the SIP Template. Here you’ll begin to receive constructive feedback from the community as well as the Sperax team. Discussion will continue for a minimum of 48 hours.

Make sure to add the correct tag to the proposal(see below for definitions):

  1. USDs parameter: Proposals related to adjusting/modifying USDs components.

  2. New Assets and Yield Strategies: Proposals related to adding new forms of collateral and yield strategy schemes/methodologies.

  3. Liquidity Mining: Proposals related to the improvement of Sperax farming & liquidity mining mechanisms.

  4. Product Feature: Proposals related to the improvement, addition, or modification of new & existing Sperax products.

  5. Partnership(s): Proposals related to inquiring & establishing potential partnerships with the Sperax Protocol.

  6. Other: Miscellaneous proposals that have yet to be assigned a defined tag/category.

Phase 2: Snapshot vote

Once a proposal has gained traction, a snapshot poll will be created for voting. A Moderator will proceed to create the snapshot poll, link it to the corresponding forum post, and submit it on the Snapshot Voting channel on the Forum. Votes can be cast directly through Sperax Snapshot Space.

All snapshot polls will last 3 days upon initiation. Votes will be weighed by the voters' veSPA balance. A snapshot poll will include 2 vote options (Yes/ No) by default. If the proposal creator wants 3 vote options (Yes/ No/ Yes with modification) then they can inform that to the moderators while the snapshot poll is created. If the 'Yes with modification' option gets max votes, then the proposal is not subject to a cooldown period.

Proposal Passing Criteria:

  1. Acceptance Threshold: Proposal must receive more than 50% in "Yes" votes

  2. Minimum Quorum: At least 200 Million veSPA should vote in the snapshot poll

Possible outcomes at this stage:

  1. Both the proposal passing criteria are met: the proposal passes and escalates to a Sperax Improvement Plan (SIP).

  2. Quorum is not met: The proposal does not meet the minimum quorum and is marked “Defeated” by the moderators. The proposal undergoes a 7-day cooldown period. At the conclusion of this period, the proposer can resubmit the proposal and proceed with the governance process.

  3. Quorum is met but does not receive more than 50% in 'Yes' votes: The post is marked as ‘Defeated’ by the moderators.

    • If “No” votes > “Yes with modification” votes - The proposal must then undergo a 7-day cooldown period. Afterward, the proposer must then resubmit the proposal, along with any necessary modifications, and proceed with the governance process.

    • If “Yes with modification” votes >= “No” votes - The proposal can be returned to the deliberation phase for modifications and is not subject to the 7-day cooldown period. Once modifications are made to the proposal it can be elevated to a Snapshot vote once again.

Phase 3: Sperax Improvement Plan (SIP):

When a governance proposal passes the snapshot vote in the previous stage, the proposal moves to the Sperax Improvement Plan. This will have the list of all accepted proposals. The Sperax engineering team will pick up proposals from SIP for implementation based on their priorities and bandwidth. The community can also help write the code for implementing proposals from SIP. All codes will have to be audited before implementation. Sperax Foundation will help in facilitating the audits.

Sperax

Sperax Foundation © Sperax 2020. All rights reserved.

Governance

Resources

Terms and Conditions

Developers

Sperax

Sperax Foundation © Sperax 2020.

All rights reserved.

Governance

Resources

Terms and Conditions

Developers

Sperax

Sperax Foundation © Sperax 2020.

All rights reserved.

Governance

Resources

Terms and Conditions

Developers