Only this pageAll pages
Powered by GitBook
1 of 24

EmplifAI Wiki

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

​The Liquidity Harvesting Protocol

The EmplifAI, shortened for Earnings Amplified with Algorithms and AI...

The Emplifai product will be rolled out in 2 phases, V1 and Version Pro. Versions 1 will be retail facing whereas Version Pro will be more catered to institutional participants. Emplifai is designed to utilize yield generating activity in the areas of Liquidity Mining and DeFi strategies. The core sources of yield in liquidity mining opportunities that we will engage in, come from trading fees, incentivized rewards for providing liquidity, bridge protocol fees and potentially arbitrage opportunities. Before we dive deeper into the Emplifai it is important that we understand the following set of areas within DeFi as listed out in the next few sections of this documentation.

Yield Farming

Yield farming is the term used to describe the way DeFi participants generate yield or extra return on their crypto assets. Generally speaking, DeFi participants shift their liquidity around to earn the highest available yields from the different options available in the DeFi ecosystem. Those options include borrowing/lending, Liquidity mining, staking, flash loan arbitrage etc. Yield farming strategies usually involve many different steps and protocols, utilizing most of the existing DeFi features and functionality. For example, a yield farming strategy may be as follows:

  • Deposit ETH on ‘Maker DAO’ as collateral, borrow DAI stable coin at x% interest.

  • Deposit DAI to any Curve.fi stable coin liquidity pool supporting DAI. Receive LP token as proof of deposit. (Liquidity Providing to Curve DEX/AMM)

  • Lock/Stake the Curve LP token in Curve protocol to earn CRV tokens on top of the trading fees earned by providing liquidity to the pool. (Liquidity Mining)

  • Stake CRV rewards to receive a share of overall platform fees/profit.

This type of strategy allows a user to keep their core position in ETH, borrow and leverage against it to carry out a variety of yield generating activity.

With regards to shariah compliance, it is important to note that most yield farming strategies may contain both impermissible and permissible subset strategies and tokens. Yield farming strategies are very rarely exclusively permissible or impermissible.

Hence, in general we can deduce that a yield farming strategy that contains both permissible and impermissible subset strategies and tokens would ultimately be impermissible to execute. In the above example, if DAI itself is not Shariah compliant, so all aspects of the above yield farming strategy would be impermissible. However, if DAI was permissible, we can say that the liquidity mining aspects of this strategy ((ii) and (iii)) can be seen as permissible.

Cross Chain Bridging

Most blockchains are networks that operate independently from other blockchains, having their own native tokens/digital assets and native network token. For example, ETH is the native currency of the Ethereum network used to pay for the fees required in processing complex deterministic transactions and change the state of the network’s ledger. The Ethereum network is a smart contract-based network that can process deterministic transactions which has ultimately led to the innovation in DeFi.

In contrast, the Bitcoin network does not support smart contracts. What if a user wanted to maintain their position in Bitcoin and make use of the smart contract functionality available in Ethereum’s DeFi ecosystem? Many protocols have emerged to support the bridging of assets across different chains specifically for this purpose. A specific blockchain may also have a desired level of liquidity and TVL, lower transaction fees and processing time making it desirable for a user to use that chain for some deterministic transactional activity.

Over the past year, we have seen a variety of cross-chain protocols supporting the bridging of crypto assets across multiple chains allowing for further interoperability, flow of liquidity and capital market efficiency in the blockchain ecosystem. Similar to the decentralized market making functionality on decentralized exchanges, some cross chain bridging protocols allow for users to provide liquidity to the bridge and earn bridging fees for ensuring that there exists liquidity to support the bridging of assets.

With regards to Shariah compliance, bridge fees also follow the concept of ‘Mudharabah’ and the incentivized rewards also follow the concept of ‘Hiba’. Therefore, bridging can be utilized as long as the tokens being used in the ‘Mudharabah’ are compliant as well as the tokens being earned in the ‘Hiba’.

Emplifai V1

Architecture, Strategies and Shariah Structure

Emplifai V1 will forgo any vaults with multiple underlying ‘strategies’ requiring some level of fund management to achieve yield optimization. Instead, V1 will transfer this responsibility onto the user by providing various different single ‘strategy’ vaults that a user can switch between as they see fit. Each V1 vault will be responsible for depositing, withdrawing, harvesting, and compounding funds into a single pool. This pool could be a liquidity pool on a DEX earning fees and rewards and/or some cross chain Bridge earning fees and/or rewards. In the event that a pool requires a dual sided LP deposit the Vault will provide a Zap feature relieving the user of any complexity (Zap Feature will also be utilized for single sided pools). The main purpose of V1 is to provide our users with an easy-to-use interface, seamless entry and exit into different liquidity pools without all the complexity.

Contract Addresses

All deployed contracts are verified by Hacken and verified source code on relevant explorer. There addresses can be found in the sub-sections listed.

BNB Chain - BiSwap USDT/USDC

USDC based on available liquidity. Liquidity providers to this pool are essentially behaving as market makers earning fees from traders as well as the right to BSW token incentives (BSW). BSW is the governance token of the BSW Decentralised Exchange.

Our EmplifAI Vault holds the LP token of the underlying Biswap pool, however we allow users easy access into this pool using the ‘ZAP’ feature. User can deposit the LP token directly into the vault or use the ZAP feature by providing USDT or USDC. If ZAP is used, the USDT or USDC is swapped for the exact amount of the other token needed to satisfy a Liquidity provision into the Biswap Pool. The ZAP feature then deposits the amounts and receives the LP tokens and holds them in the vault with all the other user’s LP tokens. All LPs in the Biswap pool are entitled to BSW token rewards (Hiba). The Vault uses the sum of all LP tokens to claim BSW rewards periodically and then sells them for more USDT/USDC and redeposits back into the underlying pool, effectively increasing the LP balance of the vault.

Solution Design

The following diagram highlights some of the differences with regards to the different versions of Emplifai

Feature set between retail and institutional

The idea being that as we progress with each version of Emplifai, the level of Fund Management, Regulatory compliance and accountability, architecture and Innovation, Risk Management increase.

The Pro version is designed to implement a more comprehensive architecture that can utilize on-chain and off-chain activity and custodial services to support more scalable yield generation and fund management.

Overview Architecture

The above diagram shows the basic architecture, flow, and Shariah structure of a multi strategy liquidity mining vault. The above vault pertains mainly to the architecture of Emplifai PRO, whereby there are multiple Liquidity Mining strategies managed by the vault and the fund management activity will not only be catered to just harvesting and compounding the rewards earned from each strategy but also rebalance and redistribute the vaults funds across the different strategies periodically to optimize the yield based on the total value locked (TVL) in the vault and the effect of injecting any amount of the TVL on a single strategy’s APR. The fund management activity in PRO will be catered to yield optimization.

Version 1 will follow a similar architecture as illustrated above, albeit each V1 vault will only have one underlying strategy that it is responsible for managing. Therefore, the MRHB's interjection in V1 will mainly be catered to claiming and auto compounding any rewards from the single strategy on behalf of the user as well as providing easy access and user experience into these strategies. In V1, it is down to users to shift their funds around the different vaults if they want to optimize yield, whereas this will be taken care of by MRHB in the PRO version. Although the PRO version may only be catered to institutions, we will ensure that V1 comes with the necessary insights for users to be able to manage their own yield optimization.

Architecture and Vaults

Generally speaking, we have 2 separate types of vaults in V1:

  1. LP vault that only accepts and holds LP tokens of a specific dual sided pool. Such vaults hold the LP token for a third party AMM pool. Ie, USDC-USDT on Uniswap. The core function of these vaults is to harvest and compound any rewards obtained by the pooled LP tokens. Users can Zap into the vault using any of the assets used in the underlying pool and Zap out into either of the assets.

  2. LP vault that only accepts and holds LP tokens of a specific ‘Single Sided’ pool. i.e., single sided AMM pool such as Curve or a cross chain bridge pool such as Stargate. These vaults also harvest and compound any rewards obtained by the pooled LP tokens contained in the vault. Users can Zap into the vault using the asset used in the underlying pool and Zap out into the same asset.

It can be tedious and complicated for a new user to navigate to the underlying protocol which is offering the pool and deposit liquidity before returning to the vault to deposit the LP token. To allow for a one stop seamless solution for users wishing to deposit directly into the vaults from the asset/assets used in the underlying strategy or withdraw from the vaults into the asset/assets, MRHB's smart contracts will take care of all the necessary steps in between. Each vault will have separate ‘in-between’ activity. This feature is what we refer to as ZAP.

ZAP is essentially the ‘in-between’ activity that facilitates the seamless deposit/withdrawal into the vault.

Generally speaking, the user facing flow and deposit/withdrawal activity for a stable coin vault can be visualized as follows:

Deposit Flow
Withdrawal Flow

Vault Type 2

The only difference with regards to Vault type 2 is that the ZAP feature doesn’t conduct any 50/50 split (potentially incurring slippage).

  1. Instead, during deposits the smart contract:

    • Deducts deposit fee and facilitates the user's token into the pool and receives the pool's LP token. Or deducts the deposit fee on the LP token and deposits it directly if that option is selected.

    • Deposit the pool LP token into the incentivized rewards contract and mint a user the vault’s LP token using the ‘PricePerShare’ Formula.

T=V∗PT = V * PT=V∗P
  1. On withdrawal, the smart contracts will:

    • Users' equivalent share of the vault (in the underlying Pool LP tokens) will be calculated based on the amount Vault tokens the user burns.

    • Those equivalent pool LP tokens will be unlocked and either sent to the user or liquidated from the underlying pool to release the underlying token using the Zap Out contract and the released token will be sent to the user.

It is important to understand that what the vaults are holding with regards to assets are the underlying strategies LP token and not the underlying tokens. The vaults allow users to deposit the underlying tokens which are then deployed into the underlying pool to receive the LP token for the vault’s specific strategy.

The Vault is responsible for using this LP token to farm any available token rewards, harvest and compound them back into the pool. This way the users are not subject to price volatility of the reward token and the APR being offered is realized by selling the reward tokens for stable coins periodically. The way each vault keeps track of which user owns what share of the vault is by minting the user vault tokens, which is essentially a proof of deposit and represents the user’s pro-rata share of the vault’s assets (in this case the vaults assets would be the strategies LP token). The user is minting vault tokens using the ‘Price per Share’ formula.

Vault Type 1

  1. Upon calling the deposit function, first the user will select any of the tokens contained in the underlying pool and the amount they wish to deposit and the token to deposit. They can deposit one of the tokens specified in the pool or the LP token for the pool directly. If the Vault’s underlying pool is a USDC/USDT pool on Uniswap, then a user can select either USDC or USDT or the Uniswap LP token for that pool. All information relating to the parameters of the transaction should be shown in the UI before the user proceeds with execution. These parameters include:

    • If depositing a token, the optimal token split is achieved through zapping such that the user can see the details of the trade necessary to achieve a 50/50 deposit of both tokens into the pool. For example, the user may have 10000 USDC to deposit into a vault that supports a USDC/GUSD pool Uniswap. After calling the deposit function the user can see that in order to deposit 50/50 into the USDC/GUSD pool, firstly a deposit fee of x% is deducted from the 1000 USDC resulting in a balance of 999 USDC. Secondly a swap of 498 USDC for 499 GUSD must be conducted. Resulting in a final balance of 501 USDC and 499 GUSD that will be deposited into the pool.

    • The amount of USDC/GUSD UNISWAP LP tokens to be received. (If depositing a token rather than the LP itself).

    • Amount of Vault Tokens minted for the user by depositing the LP tokens into the vault. Using the Vault’s ‘Price Per Share formula’. (Represents share of the vault)

  2. If the user decides to proceed with transaction the following activity will be executed by the smart contracts:

    1. Using the internal ‘ZAP-IN’ functionality, deduct deposit fee and execute the trade needed to facilitate a 50/50 deposit into the underlying pool.

    2. Deposit the 50/50 tokens into the pool and receive the pools LP token.

    3. Deposit the pool LP token into the incentivized rewards contract and mint a user the vaults LP token using the ‘PricePerShare’ Formula

  1. Upon Withdrawal, the process will be similar but in reverse. Initially, once the withdraw function is called the user can select:

    • The desired token they wish to withdraw into

    • A mix of both tokens as per the underlying pool liquidity. Ie, if the pool has a ratio that is 51% and 49%. This will be the ratio of tokens received.

    • Users can choose to receive the LP token instead of zapping out into the tokens.

  2. The user can select the amount of Vault LP tokens they wish to burn in order to conduct any of the above. All the following parameters related to the withdrawal will be displayed in the UI:

    • Amount of Vault LP token to be burnt.

    • Number of underlying tokens or LP tokens the user can expect to receive after Zapping Out.

  3. If the user decides to execute the withdrawal transaction the following activity will be executed by the ZAP out smart contract:

    • The user's equivalent share of the vault (Pool LP tokens) will be calculated based on the amount Vault tokens the user burns.

    • Those LP tokens will be sent to the user's wallet if they select option 3.

    • The equivalent pool LP tokens will be unlocked and liquidated from the underlying pool to release the 50/50 stable coins and sent to the user’s wallet if option 2 is selected.

    • The equivalent pool LP tokens will be unlocked and liquidated from the underlying pool to release the 50/50 tokens and one will be sold for the desired token specified by the user if option 1 is selected. The token will be sent to the user's wallet.

    • The amount will be sent to the user’s wallet.

Understanding PPS (Price Per Share) Formula

The price per share formula is denoted by:

Where ’T’ is the amount of base asset tokens in the vault (strategy LP tokens), ‘V ’is the total amount of 'Vault' tokens in circulation and P is the 'price' of those vault tokens.

At the start, P=1

Thus, V=T, the amount of base asset tokens inside the vault is equal to the amount of Vault Tokens.

By keeping track of the number of Vault Tokens in circulation, and the number of tokens inside the vault (which increase the longer they are held in the vault) the price can be calculated as follows:

Since the amount of Vault tokens is constant relative to the amount of underlying base asset tokens (which increase due to them being deployed in strategies, unless the strategies fail), the price will increase, and a depositor can burn their Vault Tokens to claim their initial deposit and profits.

Example
  1. At time (i) (vault empty, and no Vault tokens minted) : Adam has 1000 USDC tokens and decides to invest them into a USDC/USDT dual sided LP vault.

    • He will be zapped in and the obtained amount of strategy LP tokens will be deposited into the vault. let’s say he obtained 1000 LP tokens from the ZAP. He will receive 1000 vault tokens as the price of the Vault token will be initialized to 1 with Adam’s deposit. Thus, the Vault is as follows: 1000 LP tokens / 1000 Vault tokens, giving a price of 1.

  1. At time (ii) (more strategy LP tokens have been generated through harvesting and compounding): The vault now has: 1050 LP tokens/ 1000 Vault Tokens, giving a price of 1.05

    • Sara adds 1000 USDC (which when zapped is equal to another 1000 LP tokens) and receives 952.38 vault tokens (because 1000 / 1.05), Thus the vault now has: 2050 LP tokens / 1952.38 Vault tokens, and still a price of 1.05

  1. At time (iii) (more strategy LP tokens have been generated through harvesting and compounding): The vault now has: 2100 LP tokens / 1952.38 Vault tokens, and a new price of 1.0756.

    • Adam burns 500 of his 1000 vault tokens and is entitled to 537.8 LP tokens back (500 * 1.0756). He can choose to receive the LP token or ZAP out into stable coins. The vault now contains: 1562.2 LP tokens / 1452.38 Vault Tokens, and still a price of 1.0756.

The formula to calculate the ‘USD value of Investment’ in the vault would be:

This portion of the equation gives the number of LP tokens the user has in the vault:

Where the price of a pools underlying LP token:

T=V∗PT = V * PT=V∗P
T=V∗PT = V * PT=V∗P
PriceOfVaultToken=(TotalBaseAssetTokens)/(TotalVaultTokensOnCirculation)PriceOfVaultToken = (Total Base Asset Tokens)/ (Total Vault TokensOnCirculation)PriceOfVaultToken=(TotalBaseAssetTokens)/(TotalVaultTokensOnCirculation)
NumberOfBaseTokensReceived=VaultTokensToBeBurned∗PriceNumberOfBaseTokensReceived = VaultTokensToBe Burned * PriceNumberOfBaseTokensReceived=VaultTokensToBeBurned∗Price
𝑈sers𝑉𝑂𝐼=𝑁𝑢𝑚𝑏𝑒𝑟O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠∗𝑃𝑟𝑖𝑐𝑒O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠∗𝑃𝑟𝑖𝑐𝑒O𝑓𝐿𝑃T𝑜𝑘𝑒𝑛𝑈sers𝑉𝑂𝐼 = 𝑁𝑢𝑚𝑏𝑒𝑟O𝑓 𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠 ∗ 𝑃𝑟𝑖𝑐𝑒O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠 ∗ 𝑃𝑟𝑖𝑐𝑒O𝑓𝐿𝑃T𝑜𝑘𝑒𝑛 UsersVOI=NumberOfVaultTokens∗PriceOfVaultTokens∗PriceOfLPToken
𝑁𝑢𝑚𝑏𝑒𝑟O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠∗𝑃𝑟𝑖𝑐𝑒O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠𝑁𝑢𝑚𝑏𝑒𝑟O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠 ∗ 𝑃𝑟𝑖𝑐𝑒O𝑓𝑉𝑎𝑢𝑙𝑡T𝑜𝑘𝑒𝑛𝑠NumberOfVaultTokens∗PriceOfVaultTokens
PriceOfLPToken=USDValueOfLiquidityNumberOfLPTokensInirculationPriceOfLPToken = \frac{USDValueOfLiquidity}{NumberOfLPTokensInirculation}PriceOfLPToken=NumberOfLPTokensInirculationUSDValueOfLiquidity​

Strategies

BNB Strategies

Stargate BUSD: https://bscscan.com/address/0x258183d8a279ebcbbfe571077012babc67d4eb12

BiSwap USDT/USDC: https://bscscan.com/address/0xa363cbc6f24f654d5c22e2d75b53b6f05cb21880

BNB Chain - Stargate BUSD

This Stargate pool is a bridge-based pool that provides liquidity such that people can bridge between tokens between different chains. Liquidity providers to this pool are essentially behaving as liquidity providers to the bridge earning fees from people wanting to bridge their tokens from one blockchain to another. LPs are entitled to STG token incentives. STG is the governance token of the Stargate Bridge.

Our EmplifAI Vault holds the LP token of the underlying Stargate pool, however we allow users easy access into this pool using the ‘ZAP’ feature. User can deposit the LP token directly into the vault or use the ZAP feature by providing BUSD. If ZAP is used, BUSD deposits the BUSD into the pool, receives the LP token and holds them in the vault with all other user’s LP tokens . All LP’s in the Stargate pool are entitled to STG token rewards (Hiba). The Vault uses the sum of all LP tokens to claim STG rewards periodically and then sells them for more BUSD and redeposits back into the underlying pool, effectively increasing the LP balance of the vault.

BNB Vaults

Stargate BUSD Vault:

BiSwap USDT/USDC Vault:

https://bscscan.com/address/0x753d29053c968c382b633d43407512f2558821b2
https://bscscan.com/address/0x868ccd70ed5fb345e896cf1148eaa3f015a2fbab

Fees

We take a 2% annual performance fee taken over the harvest periods deducted from the vaults Harvest APY.

Let’s say a vault has a 10% harvest APY, a 5% trading APR and a 5% performance fee, that would assume that after performance fee deductions the harvest APY would be 9.5%. This would give a Vault vROI of 14.5%.

𝑣𝑅𝑂𝐼=𝐻𝑎𝑟𝑣𝑒𝑠𝑡𝐴𝑃𝑌(1−𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒F𝑒𝑒)+𝑇𝑟𝑎𝑑𝑖𝑛𝑔𝐴𝑃𝑌𝑣𝑅𝑂𝐼 = 𝐻𝑎𝑟𝑣𝑒𝑠𝑡𝐴𝑃𝑌 ( 1 − 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒F𝑒𝑒) + 𝑇𝑟𝑎𝑑𝑖𝑛𝑔𝐴𝑃𝑌 vROI=HarvestAPY(1−PerformanceFee)+TradingAPY

Performance fee sent to treasury (distribution: strategist/devs, redistribute to MIRO stakers via token buy backs, etc).

There is also 1% deposit fee for all deposits. This deposit fee is more of a contribution towards the cost incurred with regards to harvesting/compounding and vault maintenance i.e., gas costs.

Although the Harvest/Compound function is open for all to call, MRHB will also use collected deposit fees and use them to pay for the gas cost of Harvesting/compounding and to cover the costs of vault maintenance. Deposit fees will be taken in the asset being deposited, i.e., stable coins and will be sent to a specific treasury smart contract wallet that will use these fees to purchase the native layer 1 cryptocurrency for the chain the vault is deployed on.

This mechanism also acts as a deterrent for users aiming to ‘game the system’. For example, a user may deposit just before a harvest and withdraw straight after to pocket some risk-free return at the expense of other users that have been in the vault between the last harvest and the current harvest. This deposit fee ensures that the profit in a single day/compound period is not more than the cost of depositing and thus removes the risk of gaming.

Example

For example, a USDT-USDC Uniswap vault on Ethereum will take deposit fees in both USDC and USDT. This USDC/USDT will be used to purchase ETH and pay for the gas needed to harvest and compound rewards periodically. The more fees collected the more often the vault can harvest/compound, increasing the Harvest APY. This is a one-time fee and a user’s harvesting/compounding costs will be covered throughout the period of time they are deposited in the vault. Even if the collected deposit fees are not enough to cover the cost, MRHB will allocate the necessary funds to ensure that the minimum compound period is met.

It is important to note that the vROI is only an estimate.

Trading fees are based on daily volume of the underlying strategies liquidity pool and the APR obtained by incentivized rewards are a function of the number of emissions being emitted on any given day as well as the amount of locked LP tokens being used to determine the pro-rata allocation of those emissions. Both are subject to variations, hence the vROI displayed by the vault is reflective of these factors in real time. In reality the vaults vROI could change every second as we will compute the raw vROI using the underlying input parameters every second (trading APR and Harvest APY).

There will be an analytics page for each vault whereby users can assess any volatility in these parameters over time. For example, a user comes in and sees that a specific USDC/USDT stable coin vault is displaying a vROI of 100%. On the vaults analytics page the user can see if this is abnormal by checking if this vROI has been consistent over time or if it is just a daily outlier due to some drastic change in one of the underlying parameters. Ie, maybe the TVL of the pool dropped suddenly or the token price shot up or both. Even if it is a daily outlier, It still does mean that users who have already deposited into the vault will earn 0.27% (100%/365days) of daily vROI for that day but assuming this will last is probably not realistic.

Arbitrage

Arbitrage generally refers to the process by which there is a price discrepancy that exists between a token pair that can be taken advantage of the earn a quick risk-free profit. For example, let's take the ETH/USDC pair. If the price defined by the Uniswap DEX’s automated market making mechanism is $4000 and the price defined by Sushiswap DEX’s automated market making mechanism is $3955, then a user could essentially buy ETH on Sushiswap for cheaper than what they are able to sell for on Uniswap. Due to varying levels of liquidity across exchanges and blockchains, arbitrage opportunities exist and when capitalized on bring the market prices to a level of unison.

In conclusion, Emplifai will be catered to generating returns from Shariah Compliant Liquidity mining -- DEX AMMs, cross chain Bridge Protocols, and arbitrage in later versions.

APRs and APYs

The whole of DeFi uses the incentivized token reward model to incentivize liquidity. For example, a new AMM DEX protocol wishing to attract liquidity for a certain new pool of X and Y token, may decide to distribute their native token to Liquidity providers of this pool. Generally speaking, the real return or yield from a liquidity pool are in the trading fees that are accumulated from the trading volume of that pool. Trading fees are subject to market activity and not something that is fixed. Usually, a protocol will take the fees generated from trading volume over the past 24 hours to compute an estimated yearly annual return. This is not the best measure of what a user can expect to receive.

The protocol will also emit token rewards for this pool following some emission schedule. The per second(s) APR for these rewards is governed by the following relationship.

APR=(rewardPerSec∗86400∗tokenPrice)∗100∗365TVLAPR = \frac{(rewardPerSec * 86400 * tokenPrice) * 100 * 365}{TVL}APR=TVL(rewardPerSec∗86400∗tokenPrice)∗100∗365​

As we can see from this relationship, the APR is dependent on the USD value of the token emission for that day and the amount of liquidity providers that have staked their LP tokens into the reward contract. Therefore, both the trading APR and the reward APR are both variable. The estimate given by the protocol is literally just that and can change every day based on these factors.

There is another issue, if the reward APR is 10% and the token price of the reward token suddenly drops due to some FUD or market conditions, then the APR is also subject to volatility. It’s a double-edged sword with regards to reward tokens. If a certain amount of accumulated token rewards have been earned over a period of time, if you don’t realize these rewards as soon as they are earned your actual APR is subject to the volatility in the reward token. You could end up with a much higher yield if the token appreciates in value or a much lower yield if the token drops in value. Hence why V1 vaults aim to realize any yield from rewards as soon as they are earned or over a period of 24 hours by selling them for the vault’s asset type (sold for stable coins and redeposit them back into the strategy) to achieve a generic compound effect. In version 2 we may take a different more hands on approach to harvesting/compounding as our level of fund management will be greater in this version.

If the underlying strategy/pool is displaying a certain APR, then this is essentially made up of trading fees and incentivized rewards. The Incentivized rewards are what can be compounded and not the trading fees (as they accrue to the LP position).

If the underlying pool/strategy has an incentivized reward APR of 7%, this would translate to a 7.25% if we were to compound every 24 hours (CP = 365) for a year (Y = 1). This may not look like much but if we were to make Y = 10 years, the APY would be nearly 100%. Assuming you put 100 USDT into this pool without compounding you could assume (all things being constant) that 7% annually for 10 years would be equivalent to a 70% appreciation on your principal 100 USDT (170 USDT after 10 years). The difference in compounding is almost 30%. This difference increases exponentially over time as Y increases. The higher the TVL in Marhaba Emplifai vaults the more compounding becomes a logical undertaking as there are more rewards to compound and costs become cheaper and more distributed.

Say a user deploys the same vault strategy themselves. Without selling the reward tokens for some other stable asset you will be subject to the volatility in the reward token over time and attempting to compound any rewards may be irrational as gas costs will be more expensive for a single user with less funds. Rewards may also not be significant enough to compound. During bull markets the reward token APR may be higher as token prices usually soar in value. However, most users forget to take profits/realize gains in bull markets. These factors coupled with the time and navigation required to manually execute the underlying strategy makes the act of depositing into a vault a logical undertaking.

The vaults will have a raw APY (prior to fees being deducted) that is governed by the following:

vROI=HarvestAPY+TradingAPYvROI = HarvestAPY + TradingAPYvROI=HarvestAPY+TradingAPY

Miscellaneous Options

Additionally, the user can decide to deposit/withdraw the LP token itself and forgo using the Zap feature. This would require the user to go to the underlying third-party pool and deposit the underlying token/tokens.

Risks

It is also important to highlight that DeFi is risky.

There are layers of risk associated with DeFi products that interface/utilize other third party DeFi protocols. The Emplifai is no exception to this.

The risks that are present in the Emplifai are:

  • Marhaba Smart Contract exploits/bugs etc

  • Exploits in the Smart Contracts of Third-Party Protocols we will be interfacing.

  • Systemic Risk (stable coin de-pegs and other Black Swan events such as a regulatory crackdown on DeFi)

  • Impermanent Loss (Mitigated for pegged pools like USDC/USDT or WBTC/renBTC)

The way we will try to mitigate each of the risk is by doing the following:

  • Audits, internal tests, bug bounties. (please see Strategy/protocol Due Diligence section)

  • Screening process to assess the third-party protocols smart contracts and security to assess level of risk present with each strategy and third-party protocol integration. Risk score will be between 0 and 10, whereby 0 is highly risky and 10 is relatively low risk.

  • A questionnaire that will act as a self-assessment of DeFi knowledge for each user before they proceed to interact with any vaults.

As we are a Shariah compliant service, we are unable to engage in insurance that would also mitigate some of these risks. Mitigating these risks any further within the current design of V1 would require more architectural modifications and a higher level of fund management activity and interaction. This may require further fees to be passed onto users to sustain any such efforts. As we progress with upgrades of V1, we hope to develop an architecture and modus operandi that is more suited to manage these risks.

Fund Management Guide

It is important to understand that in V1 it is the user’s responsibility to manage their liquidity mining portfolio. If a specific user has deposited into a vault that obtains 10% vROI and the following day the vROI drops to 5% due to some changes in the underlying pool/strategy being used in the vault, it is down to the user to make an assessment and decide whether or not it is viable to shift their funds to another vault offering a higher vROI or to stay in the same vault. It's completely down to the user’s discretion.

Now what could change the vaults vROI, well let's take a look at how the underlying pool/strategies APR is structured:

By observing this relationship, we can see that any changes in the TVL (increase or decrease) or any changes in the daily reward token emissions (increase or decrease) could impact the return for all users allocated to this pool by way of a Emplifai vault. If the price of the reward token changes that would also affect the return/APR. Now as a user, your yield generating portfolio may be such that:

  1. All your funds are allocated to a single vault.

  2. Your funds are split across multiple vaults.

In scenario (1) it would just be a matter of shifting 100% of your funds from one vault to another if you see a significant change in vROI. Not a difficult undertaking albeit the user should have enough knowledge to formulate a thesis as to why the APR of the underlying pool/strategy has increased or decreased and whether or not it is beneficial to move from one vault to another.

Some points to ponder on:

  1. If you have a large deposit relative to the pool/strategies TVL you could crush the APR and thus the vault vROI such that it is no longer viable.

  2. Are reward token emissions fixed or set to change over time?

  3. Are you bullish on the reward token being harvested and compounded? Do you expect its price to increase or decrease?

  4. If the APR of a pool/strategy has dropped due changes in the TVL and/or reward token price, is that due to some fundamental flaw or concern? Ie, FUD, exploit, etc.

Let’s imagine another Scenario (2), which is slightly more complicated.

In this scenario a user is depositing a relatively large some of funds in comparison to a vault with the highest TVL. Users need to try and optimize yield by choosing the right allocation to each vault such that their overall vROI is maximized. Let's say that vault (A) is giving 20% vROI but the TVL of the underlying pool/strategy is very low. By injecting 100% of your portfolio funds into this vault you may end up crushing the vROI to 5%. What if vault (B) is offering 8% with a high TVL and vault (C) is offering 10% with a moderate TVL. Injecting the majority of your funds into vault (B) would make most sense as it can absorb the most amount of liquidity without dampening the vROI, followed by vault (C) and then the smallest allocation could go towards vault (A) such that you can still pocket some extra APR. You can assess what will happen to the underlying pools APR and thus the vault vROI if you inject (X) amount of liquidity by doing the following:

Where d is; daily reward token emission in USD for the underlying liquidity pool and y is; USD value of TVL in underlying liquidity pool.

This will allow you to make comparisons between vaults based on liquidity injection into the underlying pool/strategy. (All things constant, i.e., token price etc.). Based on your assessment and how you plan to optimize your allocation in order to get the highest return possible, we can compute your portfolio vROI as follows

Where (R) is a percentage or value between 0 and 1. It represents the ratio of Liquidity allocated to that vault with respect to the total portfolio liquidity available for use. ROI being the return on each vault.

It is important to note that the vault TVL is different from the pool/strategy TVL. The vault TVL represents the overall amount of liquidity locked in that vault and allocated to the underlying pool/strategy. Thus, it can be said that vault TVL should already be contained in the underlying pool/strategy’s TVL value.

The vault TVL and vROI is not what you should go by when making your assessment. The underlying pool/strategy’s TVL and APR is the metric that should be used in analysis and will be available in the analytics section. MRHB will also provide a ROI optimization tool for Gold Tier stakers as well as various other tools to help users make better investment decisions.

APR=(rewardPerSec∗86400∗tokenPrice)∗100∗365TVLAPR = \frac{(rewardPerSec * 86400 * tokenPrice) * 100 * 365}{TVL}APR=TVL(rewardPerSec∗86400∗tokenPrice)∗100∗365​
newAPR=365∗dX+ynewAPR = \frac{365 * d}{X + y}newAPR=X+y365∗d​
𝑃𝑜𝑟𝑡𝑓𝑜𝑙𝑖𝑜𝑣𝑅𝑂𝐼=𝑅1(𝑣𝑅𝑂𝐼1)+𝑅2(𝑣𝑅𝑂𝐼2)+𝑅3(𝑣𝑅𝑂𝐼3)+……..𝑅n(𝑣𝑅𝑂𝐼n)𝑃𝑜𝑟𝑡𝑓𝑜𝑙𝑖𝑜 𝑣𝑅𝑂𝐼 = 𝑅_1(𝑣𝑅𝑂𝐼_1) + 𝑅_2(𝑣𝑅𝑂𝐼_2) + 𝑅_3(𝑣𝑅𝑂𝐼_3) +…….. 𝑅_n(𝑣𝑅𝑂𝐼_n) PortfoliovROI=R1​(vROI1​)+R2​(vROI2​)+R3​(vROI3​)+……..Rn​(vROIn​)

Shariah Structure

The proposed shariah-based structure by the MRHB Shariah Governance Board (SGB), is exclusively for EMPLIFAI V1 only.

In V1, MRHB will offer this product to the users through a software-as-a-service (SaaS), where the users will have full access and control over the management of their funds. They will be able to deposit and withdraw their funds at any time they want. The product will offer different shariah compliant strategies (vaults), with full disclosure of associated risks and rewards. These strategies are based on the structures and products offered by third parties.

SaaS is a computer program application offering model in which a vendor offers the computer application, and the users have the right to use it. Normally, the users have access to it through a web browser via the Internet.

From the shariah perspective, the product (EMPLIFAI) and strategies will be continuously reviewed and monitored. This is an ongoing process due to the dynamic aspects of the proposed strategies.

As for providing the software-as-a-service (SaaS), according to the Shariah Standard No. 28: Banking Services in Islamic Banks:

  • It is permissible for the Institutions to provide banking services that do not involve interest-based lending and borrowing, because such services serve a permissible interest of the clients.

  • Institutions may charge fees for providing banking services, because the fees so charged constitute a remuneration which the Institutions deserve for the tasks they perform, since it is permissible in Shariah to get reward for performing tasks that result in permissible benefits to others.

  • The fee charged by the institutions may be a lump sum amount or a percentage of the value of the service, because when the percentage remuneration is calculated it becomes like the lump sum amount.

Based on the above points, this type of service falls under the concept of Al Ujrah An Al Khidmah

Hence, MRHB may charge fees for providing such services, because the fees so charged constitute a remuneration which MRHB deserves for the tasks the product (EMPLIFAI) performs, since it is permissible in Shariah to get reward for performing tasks that result in permissible benefits to others. AAOIFI standard also allows the fees to be charged as a percentage. In MRHB’s case, it is the combination of percentage of the deposits (deposit fee) and the percentage of compounding revenue (performance fee).

Liquidity Mining

Liquidity mining is a subset of yield farming. It involves providing liquidity to DEX/AMM protocols to receive trading fees and any extra token rewards. Many decentralized exchanges provide an extra token reward to incentivize liquidity providers to provide liquidity to a specific pool. These tokens are usually an arbitrary token representing some utility such as governance. Trading fees earned by a liquidity pool are based on the amount of trading volume that the pool experiences over a given timeframe, hence different DEX’s may have varying levels of volume. Liquidity providers may shift their liquidity across different decentralized exchanges based on the token reward APR being offered, the desirability and market sentiment of the reward token as well as the trading volume of the pool.

Liquidity Mining is a feature of DeFi that when utilized within a specific framework can generate Sharia compliant returns. The majority of Marhaba’s efforts will be geared towards Sharia compliant liquidity mining framework.

It can be observed that trading fees in Liquidity Mining follows the concept of ‘Mudharabah’ and the incentivized rewards follow the concept of ‘Hiba’. Therefore, Liquidity Mining can be utilized as long as the tokens being used in the ‘Mudharabah’ are compliant as well as the tokens being earned in the ‘Hiba’.

Zappers

BiSwap Zapper: https://bscscan.com/address/0x04a6fbad7521165e9b6e10bdb9a2cc35836a8e1e

Stargate Zapper: https://bscscan.com/address/0xfc3b896eb82562c277be3d9576289f37f341969e