Protocol Algorithm Design

BoC provides USD Stablecoins Farming and ETH Farming.

USD Stablecoins Farming Mechanism

Process Description

  1. “Deposit” - The BoC protocol supports users with the deposit function - to deposit the three major stablecoins (USDT, USDC, DAI) in any desired combination and amount. BoC also allows minting of USDi of the corresponding value to be returned to the user. “Withdraw” - Users can withdraw USDi which consists of the three major stablecoins at their convenience through the BoC protocol. By default, they will be returned according to the proportion of the three major stablecoins in the Vault at that time, or they can specify a certain currency to be returned.

  2. After the Vault receives the stablecoin, queryTokenPrice queries the price of the user's transfer of the stablecoin through an external oracle. Token prices follow the prices provided by the oracle.

  3. Based on the calculated value, mint/burn will mint/burn an equivalent value of USDi tickets.

  4. The Keeper module reaches the trigger condition doHardWork and triggers doHardWork.

  5. After the Keeper trigger doHardWork the vault allocates the funds and exchanges the USDi tickets (burn) for USDi (mint).

  6. Vault calls the aggregate exchange module swapTokenToWants.

  7. The aggregated exchange module swapTokens completes the exchange.

  8. Vault receives the targetted currency exchanged by the aggregate exchange module.

  9. Vault puts stablecoin deposits into the strategy according to the currency required by the strategy.

  10. The strategy invests stablecoin deposits into third-party protocols.

  11. The Keeper module reaches the harvest trigger condition and triggers the harvest.

  12. Harvester triggers each strategy to execute harvest.

  13. Each strategy executes claimRewards to collect mining.

  14. Each strategy transfers mining coins transferRewards to Harvester.

  15. Harvester sells miners sellRewards into stablecoins through the aggregated exchange.

  16. Harvester sendProfitToVault transfers stablecoins into Vault.

  17. The Keeper module reaches the rebase trigger condition and triggers the rebase.

  18. Vault calls changeTotalSupply to issue additional USDi.

  19. Vault collects 20% of the yield, which is transferred to the Treasury.

  20. The treasury will benefit users by using buyback to repurchase the BoC governance token.

Note:

  • The rewards (mining coins) will be swapped into USDT, and this could be changed (controlled) by the Keeper, which means the token to sell will be determined manually.

ETH Farming Mechanism

The collateral of USD stablecoins is USDi, whereas that of ETH is called ETHi.

In general, the mechanism of ETH farming is almost the same as that of the USD stablecoins farming. However, there are still slight differences as listed below:

  1. The Harvest mechanism of ETHi farming is slightly different; harvest and reallocations are not carried out uniformly by Harvester (as USDi Farming), instead each strategy is harvest and reallocated individually.

  2. During queryTokenPrice , all tokens should follow the Chainlink price directly. However for ETHi farming, there will be cases where certain tokens involved are not priced on Chainlink, so instead the 1-hour weighted average price of that token on UniswapV3 TWAP will be used as reference.

Last updated