Proposal to start developing Bendearn which is a yield aggregator for ApeCoin staking

20220929 On setting up ApeStaking’s Vaults – BendEarn (Ver2)
Author: Vis.eth

Original by Vis.eth, written on 2022-09-29.
English translation by : NFTLZ.ETH
Thanks to the following community members who participated in the discussion: @37Thinking (for suggesting the idea of profit allocation ratio in Ver2), @defiandnft, Jiahui, @hijasminetea and other members.

  1. Background: APE Staking: staking-process-with-caps-1x-drop-process/5074
  2. introduction: transforming Yuga-system NFTs in BendDAO into miner and deploying Vaults(same as yVaults of yearn) to help users maximize revenue in the full market domain.
  3. yugalabs’ NFT+$APE paired staking mining, on the user side, has the following scenarios.
    3.1. the user has both NFT and $APE.(the user completes paired staking mining independently)
    3.2. only NFT.
    3.3. only APE.
    3.4. BendEarn’s customer base, which is the users of 3.2. and 3.3.
    3.5. users of 3.1. are also applicable to BendEarn, which can earn more revenue.
    3.6. BendEarn mainly addresses the need for paired mining of NFT and APE, where the core issue is the distribution of profits.
    3.7. (Ver1) In Ver1 version of this scheme, it is the use of market mechanism for price discovery to achieve the most efficient mining, i.e., maximizing the revenue.

3.8. (Ver2) In the Ver2 version of this scheme, the market value ratio of the paired assets will be used for profit allocation.The advantage of this method is that it can greatly simplify the operation cost for users, and at the same time, it can balance the benefit distribution of NFT/$APE holders. By extrapolating the profit allocation scheme in Ver1, we can calculate that, with a sufficient number of samples, NFT holders and $APE holders will eventually stabilize on the mean of the “optimal input-output ratio” through the game, and therefore the “optimal profit allocation curve” will be the same as The “ratio curve of NFT/$APE valuation in paired mining” will overlap with the “ratio curve of NFT/$APE valuation in paired mining”. In order to simplify the NFT valuation method, the NFT valuation in this scheme uses the NFT floor price of the prophecy machine as the unique value, so as to unify all the NFT/$APE profit allocation ratio value curves.

  1. (Ver2) Analysis of APE Staking rules.

4.1. According to the official documentation of APE Staking we can be informed that there are four mining pools.


The bakc/$ape pool has a pre-requirement: it must form an “advanced pair” with the bayc/$ape pool or the mayc/$ape pool before it can be mined; the mining rewards of the four pools are fixed, and the yield will change dynamically with the amount of assets in the pool.

4.2. APE Staking is a “Period Valuation Adjustment Mechanism” method, you only need to put NFT and the corresponding amount of $APE in your wallet, then go to the APE Staking page and sign the contract to start mining; at the expiration of the first period, i.e. 91 days, as long as you still have the same NFT and the corresponding amount of $APE in your wallet, you can claim reward.So, soft staking does not stop users from transferring and trading NFTs and $APEs at any time, they only need to hold them at the end of the period to complete the Period Valuation Adjustment Mechanism.

4.3. when APE Staking is officially launched, we will only be informed of its detailed interest-bearing period, which may be by ETH block or 91 days, and this proposal requires regular refreshing of the NFT floor price and $APE price provided by the oracle to calculate the profit allocation ratio according to the interest-bearing period.
5. (Ver2) Product logic for BendEarn paired mining -Vaults.

5.1. Excel version of the derivation:

5.2. First all BAYC/MAYC/BAKC/APE holders need to sign approval for APE Staking, which means that the holders need to know and agree to APE Staking’s rules about unstaking time, claim reward and other rulers of Yugalabs, BendEarn is a revenue optimization tools based on Yuga’s official rules .

5.3. we divide the product logic of BendEarn into two main parts: pair mining and profit allocation.

5.4. pairing rules: BendEarn sets up four pools corresponding to four mining pools, namely: bayc/$ape, mayc/$ape, bakc/$ape, $ape.

5.5. we treat NFT (BAYC/MAYC/BAKC) as the base asset for the first three pools and $APE as the base asset for the fourth pool, queued according to the chronological order in which users sign the contracts, first to sign and first to pair, and re-queued upon withdrawal.

5.6. the $APE holder deposits $APE into the protocol and the protocol will automatically pair with NFT according to the best earnings, if there is no paired NFT, then APE single token mining will be conducted.

5.7. After the BAYC/MAYC holder approves the contract, NFT will pair mine with the unpaired $APE. During the mining process, if the $APE single token mining revenue < pair mining revenue, the pair mining will continue, otherwise the pair mining will be aborted.

5.8. NFTs from the BendDAO collateral pool and the Custody pool, which can also be used for paired mining.

5.9. BAKC comes from the Custody pool, since BAKC is not collateral for BendDAO.

5.10. when BAKC pair mining, according to the official rules, it must be paired with BAYC or MAYC for “advanced pair mining”.

5.11. BAKC needs to increase the corresponding amount of APE to complete the pairing, so we can break it down as follows: BAYC/MAYC+APE is the base pairing, and the increased BAKC+APE is the advanced pair.

5.12. the returns earned by the advanced pairing go to BAKC and the corresponding APE and are not shared with the base pairing.

5.13. queue priority rules: first-come, first-served according to the time of approval of the contract and re-queued after exit.

5.14. regarding the calculation of the reward allocation ratio and the periodicity of the update of the ratio.

5.14.1. mode I: synchronization with the APE Staking’s interest-bearing period and allocation of profits in proportion to the market value of NFT and APE.

5.14.2. mode 2: daily calculation of NFT and APE market value, followed by the proportional allocation of the day’s profits.

5.14.3. both of the above are available for discussion.

5.14.4. the NFT oracle has been implemented in BendDAO.

5.14.5. the $APE price can come from Chainlink or Uniswap, because the prophecy machine offer does not affect the right to attribute the proceeds, so it does not cause hacking for profit and can be used without having to be too real-time and precise, so the Uniswap price can be used.
6. (Ver2) Regarding the locking rules for NFT and APE holders during paired mining.

6.1. according to Yugalabs official rules, mining is done in a soft staking way, which means that NFT and $APE can be transferred during mining, On the expiration date, when the user Claims the earnings, he must have the same paired assets in the wallet as when the contract was approved.

6.2. BendEarn is a paired mining protocol, a two-party cooperative act, if one party takes the NFT or APE and swaps it back at the expiration date, then the mining revenue can still be obtained, but if either party fails to return it, the mining revenue cannot be taken out, assuming it is the NFT that is traded out, then the new NFT holder can withdraw the revenue.

6.3. Through the above analysis, it can be seen that the rule may be subject to a variety of situations, so this proposal temporarily adopts the hardstaking locking rule, which means that in each 91-day mining period, the paired successful NFT, cannot be withdrawn, and the unpaired NFT can be withdrawn; the unused $APE, can also be withdrawn.

6.4. to discuss later whether to upgrade to more complex features to perfectly support softstaking.
7. Economic model design.

7.1. the user of paired mining can be charged 3% of the mining revenue as a service fee ($APE), and $APE single-coin mining is free.

7.2. the service fee is charged when the user withdraws the mining revenue and does not lead to MEV attacks.

7.3. convert the received $APE into $Bend at Uniswap.

7.4. the Bend redeemed from the service fee, there are several ways to handle it for discussion: return to the miner, deposit in the treasury, destruction, distribution to vebend.

7.5. the service fee of 3% can also be adjusted.

7.6. if it is deposited in the treasury or allocated to $vebend, then there is no need to swap to $bend, it can be swapped to $ETH.

7.7. (Ver2) I recommend buying back and destroying Bend immediately on Uniswap.

7.8. (Ver2) The service fee affects the calculation of the revenue earlier in this paper, and attention must be paid to the correctness of the calculation in the actual development, which affects the deployment of APE among the four mining pools.
8. (Ver2) Regarding the delegation of governance rights of APE.

8.1. since $APEs need to be deposited into the protocol to maximize revenue, APE community governance voting only supports signatures of wallet addresses holding APEs, APE holders participating in BendEarn need to understand and agree that APEs participating in paired mining have effectively formed a subcommunity.

8.2. when participating in the official APE community voting, the BendEarn protocol is required to operate the voting, so the governance rules of internal unified actors will be formed within the BendEarn-APE subcommunity, which currently defaults to the principle of majority rule and realizes subcommunity governance through the BendDAO governance platform.

(End of text)

-----The following is the version 1, which is still of positive value. It is recommended to read-----

Proposal to start developing Bendearn which is a yield aggregator for ApeCoin staking
Author: Vis.eth

  1. Original by Vis.eth, written on 2022-09-28.
  2. English translation by : Eye Kwin, @hijasminetea;
  3. Thanks to the following community members who participated in the discussion: @37Thinking (for suggesting the idea of profit allocation ratio in Ver2), @defiandnft, Jiahui and other members.


  1. APE Staking: staking-process-with-caps-1x-drop-process/5074

  2. All in all: Transform the Yuga’s NFT in BendDAO into a mining machine, open the market of machine-gun pool, and help users maximize their benefits in the whole market;

  3. Let’s roughly analyze the situation of mining match of BAYC+APE: In the Yuga Staking market, we can divide users into different situations to analyze hereinafter:
    ① Both hold NFTs and APE (in this case, it is most likely to be mined in themselves wallet);
    ② NFTs only;
    ③ APE only;
    3.1 Bendearn, the BendDAO machine-gun pool, is most attractive to the users from ② and ③;
    3.2 Of course, users of ① engaging YugaStaking can also participate Bendearn if they want. Just put your APE and NFTs into Bendearn to take part in Staking matching;
    3.3. Bendearn mainly considers the demand of paired mining of NFTs and APE, It is the crucial things among this activity, how to distribute the proportion of profits from mining. The proposal is to use the market mechanism to finish price discover, it can maximize mining efficiency – maximize the benefit.

  4. The detailed logic of BAYC+APE pairing:
    4.1. Firstly, all BAYC/MAYC holders who engage in Staking need to sign a new authorization, which means that the holder should know and agree to the official rules from Yuga including release time, extraction APE from proceed of mining, etc., In a word, Bendearn is only an optimization tool based on Yuga’s official rules;
    4.2. Bendearn is a market to establish a pairing between BAYC/MAYC and APE, the default initiator is BAYC/MAYC holders searching and pairing the APE holder who wants stake in the Staking mining;
    4.3. The holder providing APE needs to issue a share quotation and the holder who provides the highest share quotation will into the priority queue to finish the paring, as well as the low share quote listed by holders will be later;
    4.4. So~ how to build an environment to ensure the balance of the APE using? That is mean, which APE are assigned to which NFTs to form a team? We can fully use the enlighten from the model of NFTs pool: According to the number of NFTs in the pool(such as N), The APE will be divided into N parts(the high quotation first),and then use the APE with a low quotation. Finally, complete a pair pool;
    4.5. Boundary situation analysis:
    ⑴. When the number of NFTs in the NFT pool is more than the number of APEs in the APE pool, then refer to the chronological order of the pledge in BendDAO, the NFT with early pledge will have the priority for pairing. The NFT with the late pledge may be suspended, and these have been in the waiting state, do not participate in mining, and have no mining profit;
    ⑵. When the number of NFTs is less than the number of APE, the overflowed APE enter the pure currency mining pool automatically, and can only obtain APE mining revenue;
    ⑶. How does the fluctuation of the pair pool affect the team: when the number of NFTs changes, the APE pool immediately refreshes the combination of NFTs and APE;
    ⑷. APE holders can modify the share quotation at any time, or they can withdraw APE at any time (according to Yuga’s official rules, it is necessary to release the deposit first);

  5. The Detailed description of mining packing BAYC/MAYC+BAKC+APE:
    5.1. After understanding the pairing method explained above, we will implement the three-combination packaged mining scheme, You can refer to the official document of Yuga for the related staking rules;
    5.2. The process of the packed mining:
    ⑴Like 4.2. : the default initiator is also BAYC/MAYC holders initiating the demand firstly, and then wait for the APE to pair;
    ⑵If the BAKC holders also want to participate in packaged mining (BAYC/MAYC+BAKC+APE) to mine the APE rewards of the BAKC pool, refer to the official rules of the Yuga , They need to increase the corresponding APE to complete the pairing.
    5.3. But this plan proposes not to consider the BAKC holders, to redistribute the partial reward to the BAYC/MAYC holders, and also follow the idea of pair pool, So we can part it as: BAYC/MAYC+APE is the basic pair, and the BAKC+APE is the plus edition. and the benefits of the two teams will be calculated respectively;
    5.4. The default profit quotation given by APE holders in this scheme is uniformly applicable to BAYC team and BAKC team;
    5.5. Therefore, BAYC/MAYC+APE starts mining immediately after completing the pairing, at same time, if a BAKC holder puts the BAKC into the staking pool with the Custody agreement, which is equivalent to the BAKC holder initiating the teaming demand and waiting for the APE holders to match a team;
    5.6. If there is a balance of APE in the pool at this time, they immediately team up with APE holder, and start mining;
    5.7. If the APE amount is insufficient, BAKC will be waiting;
    5.8. If the number of BAKC more than the number of BAYC or MAYC, then BAKC also be waiting;
    5.9. BAKC pairing priority is yield to the order of time deposited in Custody, which that means early depositing early staring mining;

  6. How to achieve a true machine-gun pool? It can dynamically distribute mining team based on profit when mining in four Staking pools:
    6.1. First of all, BAYC/MAYC comes from the stake pool and Custody pool in BendDAO, which is the default mining initiation demand;
    6.2. BAKC comes from the Custody pool and is the second mining initiation demand side;
    6.3. APE holder can mine without NFTs;
    6.4. Therefore, APE is dynamically allocated according to the benefit from pool corresponding to the initiator side;
    6.5. When the APE holder lists a share quotation offer, the agreement defaults to “when the pure APE mining income is higher than that of team mining, it will be automatically converted to pure APE mining”, so as to protect the interests of the APE holder;
    Annotation: 18. Economic model design:

  7. We can collect 3% of mining revenue as a service fee from paring mining users(APE), but it is free for pure APE coin mining;

  8. The timing that we take the fee is the proceed when the user extracts mining profit, so that it will not be hijack by some hackers;

  9. Convert APE received into ETH in Uniswap immediately and then into Bend;

  10. This Bend is equivalent to 3% of the users mining income, and there are three ways to deal with it: return it to the miner, deposit it in the treasury, destroy it, and distribute it to vebend;

  11. Whether the charge rate is 3% can also be adjusted.

  12. If it is stored in the treasury or allocated to vebend, there is no need to change to bend, you can get ETH directly.
    (End of text)

The development team had done some solution design and made a development plan.

Desiging Solution

All Apes used as collateral in BendDAO can take part in Ape Staking.
Ape holders and ApeCoin lenders can make offers and accept the offer in pairing.
Both Ape holders and ApeCoin lenders can claim rewards from the staking pool.

Developing Plan

The entire development plan will be broken down into two phases.

The first stage (v1)

We need to implement the matching requirements between Ape holders and ApeCoin lenders, that is, develop the BendApeStaking contract, the holders and lenders can manually match according to their expected profit sharing.

The estimated development time will take 2-3 weeks, which should be completed before the release of Ape Staking (31 October).

The second stage (v2)

We will implement the machine gun pool, develop the BendEarn contract, and automatically distribute NFT and ApeCoin into different staking pools through different revenue strategies to maximize profit for the holders and lenders.

The estimated development time will take 4 weeks at least, which may be completed before 31 November. This development may conflict with the top priority tasks of the team, requiring further coordination of development plans.

We will update more details about the development.

Thanks to vis.eth for the work with the team.
For the team’s suggestion, the pairing scheme in The first stage (v1): “the holders and lenders can manually match according to their expected profit sharing.”
My suggestion is as follows.
Pairing method: use a peer to pool approach to automatically match and share profits.
Profit allocation: directly use the fixed allocation method, 50% each for $APE single token mining above APR.

In current design, the peer-to-pool will exist in BendEarn.

From the BendApeStaking side, we can think the BendEarn is just a peer who can provide lots of ApeCoin to Ape holders.

BendEarn collects ApeCoin from lenders and providing to BendApeStaking.
The rewards claimed from BendApeStaking will belong to BendEarn, and BendEarn distribute to all lenders proportionally.

My suggestion is:

Version 1 (10-31):

  1. Defer this goal to Version 2, the primary target is those users(BAYC/MAYC/BAKC/APE) who are not on BendDAO yet. If we don’t consider internal NFT of BendDAO in the next month, maybe we could ensure the launch time and code security.
  1. Agree this, this will save more time.
  1. It’s better to implement the machine gun pool in Version 1, maybe we could find a simple solution , please check this document: BendEarn - Google Sheets

@benddaodev Is Earn Strategries will call from create Party?

Earn Strategies should be called by BendEarn only but can be triggered by any NFT holders or ApeCoin lenders.
BendEarn should choose the best strategies which can make the maximum profit from 4 staking pools.

Earn Strategies - what’s detail of function interact with BendEarn smart contract?
what’s workflow for this process?

The main advantage: BendEarn can provide more revenue than APE single token staking.

And Earn Strategies need handle when claim accumulated from staked ApeCoin and deposit to BendEarn again to get more profit

I think make sure that every single Ape in BendDAO to join the ape staking is our job.

Maximum Ape Coin holder earning is not BendDAO’s Job.

So this would be a BendApeStaking contract using flashclaim, not a yielding aggregator IMO.

1 Like

BendAPEStaking as I understand it.
1, Bring in third party $APE token to pair mining with benddao’s APE NFT.
2,No mining strategy, just pair mining.
I personally think it is an improvement to do the first point.

Or does it only allow APE NFT holders to pair mine?

but welcome anyone to build aggregator system for ape coin staking based on BendDAO protocol, it’s opened and would be a big ecosystem of BendDAO.

The first move will be BendApeStaking contract, but the aggregator for max ape coin holders’ return, we need to do more discussion, IMO it’s out of BendDAO’s job, and we welcome any team to do it, they can deploy a contact and share some profits to BendDAO treasury.

The ape coin like 3% or 5% service fee from BendApeStaking for different address pairing, I suggest go directly to the DAO treasury.

in the first stage (v1)
will bring the APE Token Lenders.

now,it’s canceled?

No, help NFT users in BendDAO to march ape coin holder is quite a bit diff from make apecoin staking aggregator.

GM, Vis! I’m Vasquez, a researcher and data analyst.
I’m really impressed by your BendEarn proposal about Ape staking.

Have a question here:

What do you think will attract ape holders to use BendEarn for staking, if BendEarn charges 3% of service fees?

Strongly agree

Distractions are not good things. Aggregator is a long-term work, not only a single development, including a long-term maintenance, update, operation, etc.

BendDAO should focus on NFT lending work, and make sure that every single Ape in BendDAO to join the ape staking.

The next step

The proposal can be made into a benddao‘s Grant to attract community developers.

Working on a related proposal now.