# Litepaper

## Introduction

Jollof.fi is a decentralized finance (DeFi) protocol that is developing DeFi products with a specific focus on the African continent. The core mission of Jollof.fi is to develop financial products that are relevant to African communities, yet are attractive to international capital.&#x20;

By focusing on developing financial applications that help solve access to core financial primitives within the African continent, Jollof.fi will bring new users into the DeFi space and help generate wealth, opportunities and bring financial freedom to communities that are underserved and unserved by existing financial services.

Built on the Celo network first, Jollof.fi will be launching three key products by year end 2022:&#x20;

* Fixed Yield/Interest Rate Swaps
* Baki ForEx
* Jollof Vaults

Each product aims to address deficiencies in both DeFi and African financial markets, establishing a platform upon which wealth can be generated for all types of users  &#x20;

## Motivation

The African continent is home to 1.2B people, with a median age of 20 years. This young population has been chronically underserved by financial service providers and have little access to more complex financial instruments. This represents an untapped market in which Jollof.fi aims to grow.

As of writing (April 2022), the average Nigerian term-deposit rate sits at 3.0% p.a. paid in Naira (NGN). This is outstripped by both the inflation rate of 15.5% and the 12.6% YoY devaluation of the NGN against the USD. Furthermore, to help stem the chronic devaluation of the Naira, the government has implemented strict currency controls that limit the outflows of capital into safer currencies such as the US Dollar or the Euro, meaning that only the few in positions of power have access to global capital markets. These headwinds severely limits the ability of businesses and individuals to invest and subsequently generate growth.&#x20;

Another key challenge found on the African continent is that although commodity prices are priced on a global basis, they often have a significant impact on local communities. Currently the average African business has little to no access to financial products that may help them hedge their exposure to global commodity movements. This results in outweighed impacts from black-swan events that can be mitigated by investors and businesses in the developed world. &#x20;

Although, African countries are adopting crypto faster than global counterparts, these new entrants have a limited understanding of the entire crypto landscape and do not have products specifically tailored to their needs. The African crypto market remains the smallest crypto economy of any region despite growing by over 1,200% in terms of value received over the past year.&#x20;

Jollof.fi aims to address these challenges through the development of specific products that will both help solve issues found on the continent whilst offering attractive yields for foreign investors. This will help provide liquidity and TVL to help support DeFi products specifically tailored to African users. By building products that are relevant to local communities, Jollof.fi will be able to help democratize access to financial products that help generate sustainable, long-term generational wealth and help grow the African financial sector from the grassroots level.&#x20;

## Products

Jollof.fi is currently developing three key products that will be launched in the coming year:

* Fixed Yield & Interest Rate Swaps
* Baki ForEx
* Jollof Vaults

### Fixed Yield & Interest Rate Swaps

#### Background

One of the most important primitives, and a key signal of maturity of any financial system, is access to fixed yield deposits and interest rate swaps. These instruments allow investors to take positions on interest rates volatility and ensure a guaranteed yield over a period of time. More importantly, from an African context, these help solve the issues associated with the limited access to Dollar-yielding deposits that can help them beat inflation and avoid currency devaluations as seen in the past and rising borrowing costs.

Jollof.fi can integrate with any lending or stable swap liquidity pools and offer fixed yields to investors. Jollof.fi will also expand upon the existing protocol and add additional functionalities to help mitigate risk and incentivize additional take up compared to the existing project being forked.

#### Deposits

Built on top of lending protocols and stable swap liquidity pools, Jollof.fi will offer users the opportunity to earn a fixed yield on deposits into Moola Market and Mobius for terms up to a year, with more integrations to come. To convert the variable rate available on the lending and liquidity pools, the fixed interest rate will be offered at 75% to 37.5% of the variable rate, with longer term deposits converging to the lower bound. Once a user deposits their assets in a fixed yield pool, they are forgoing their variable yield for a guaranteed fixed yield, or in other words, the user has taken a short position on interest rates. &#x20;

For example if the average underlying lending pool for cUSD is yielding 10% APY, then a 1 year deposit on Jollof.fi would be priced at 3.75%. If Ibrahim were to deposit 1,000 cUSD tokens, at the end of 1 year he would be able to withdraw 1,037.5 cUSD tokens.&#x20;

Additionally, excess yields can be maintained in the protocol to help smooth over against fluctuations to the variable rate during the term of the deposit. Using the example above, if we assume that the variable rate averages to 10% APY over the term of the deposit, the excess 62.5 cUSD tokens will remain deposited to help generate additional yield to protect the solvency of the protocol.

#### Interest Rate Swaps (Yield Tokens)

In addition to the fixed yield deposits, 3rd party users can also take a long position on interest rates by entering in an interest rate swap, otherwise known as purchasing Yield Tokens (YT). By purchasing YT an investor would be paying the price of the fixed rate yield to earn access to the variable interest.&#x20;

Following on the example from above, once the deposit occurs, 1,037.5 YT are minted. These can be purchased for the price of the fixed yield promised to the depositor, 37.5 cUSD in this case. Once the YT are purchased, the purchaser of the YT earns the variable interest rate on 1,037.5 cUSD. Assuming that the rate averages to 10% APY, the YT purchaser would earn 103.75 cUSD, resulting in a ROI of 277%.&#x20;

YT in effect act as an interest rate swap where the YT purchaser pays a fixed rate and earns the variable rate, whilst the depositor earns the fixed rate and pays the variable rate. This means that the YT can also be used by investors who wish to protect themselves from the variable interest rate they are incurring on a borrow position.&#x20;

Lastly, YT also create an additional layer of security on the protocol, since any time YT are purchased the solvency of the fixed deposits are guaranteed. YT will most likely be sold out because the protocol naturally prices the deposits at a lower rate than the market, therefore this prompts arbitrageurs to purchase the YT and claim the excess yield generated by the protocol for themselves.

#### Risk Mitigation

The key risk associated with a fixed yield protocol is that the protocol is unable to satisfy the fixed yield for depositors. The protocol is specifically structured to mitigate this risk through the use of three lines of defence. These include:

1. Pricing Oracle
2. Maintaining Excess Yield
3. Yield Tokens

*Pricing Oracle*

The pricing oracle will be the first line of defence to protect the protocol from insolvency. As long as the average yield during the term of the loan is either equal to or greater than the fixed yield promised to a depositor the protocol is solvent. This requires that the oracle is able to calculate a discount factor to apply to the current yield that is conservative enough to protect against volatility in the interest rate for a period up to a year.&#x20;

To start with a simplistic curve between 75% and 37.5% will be applied to reduce the variable rate. The oracle will only need to protect against downward pressures on utilization and subsequently, interest rates. However, this will not be sufficient to account for black swan events and significant changes in the landscape (i.e. a mass liquidation event which significantly reduces utilization, or a large deposit into the pool). More advanced oracles using analytics and trend analysis can be deployed to further mitigate the risk that the fixed yield offered is beyond the variable rate being received from the deposits on the protocol. Unfortunately, barring perfect foresight of future rate movements, this alone will not be sufficient to ensure solvency on the protocol.&#x20;

*Maintaining Excess Yield*

When the pricing oracle calculates offers a fixed rate below the variable rate, this will create excess returns that are not distributed to the depositors. This excess yield can then be used to cover any shortfalls from when the pricing oracle over-estimates the fixed yield offered to the depositors. Moreover, depositors always will have the ability to withdraw early from the underlying pools. When a user withdraws early they will forfeit any accumulated interest and 0.5% of the deposited amount withdrawn, adding to the excess capital maintained in the pool.

Once more, this can help mitigate the risk associated with the protocol however, it cannot be counted on to fully reduce the insolvency risk.

*Yield Tokens*

The final and most important line of defence is the yield tokens. When YT are sold, this ensures that the deposit's fixed interest is fully covered and fully de-risks the protocol. As discussed above, the YT are attractive to arbitrageurs, hedgers and speculators, which should ensure that a significant share of deposits are fully covered.

#### Revenue Model

A performance fee of 20% will be applied to the fixed yield as well as an additional 0.5% of asset value on early withdrawal.  This will be split evenly between the treasury and the $CNZA token stakers.&#x20;

#### Further Development

In addition to the core features discussed above, additional features will be added in future iterations of the fixed yield product. These will include additional investment opportunities in more underlying protocols, incentivizing further capital efficiency between YT purchasers and depositors, leveraged deposits, and an insurance pool to further secure the solvency of the protocol. Further details will be explained in future medium articles and announcements.

### Baki ForEx

#### Background

Stable coins have a core function within crypto markets, as they represent a stable store of value within a volatile system. Moreover, stable coins underpin economic transactions on the blockchain for the purchases of goods and services and as a key on and off ramp for investors. In general, stable coins are either custodial, with real world assets, or algorithmic, with crypto-collateral, and are usually tied to the US Dollar, with additional currencies such as Pound Sterling, Euros and Brazilian Reals. Although there is a demand for US Dollars on the African continent, the current stable coin offerings do little to cater to local demands, most importantly of which is easy access to leading African currencies.

Developing a new stable coin comes with a number of challenges. To ensure low slippage deep liquidity pools need to be generated, which requires significant capital to be committed from investors. This also limits the ability to have multiple specialist currencies because the liquidity would be fragmented between the different stable coins. Additionally, a custodial approach would be complex and require significant off-chain controls and regulation that would result in additional costs.

Baki aims to solve this through developing a infinite liquidity multi-currency peer-to-contract exchange with no slippage.

#### The Protocol

Baki will allow users to deposit collateral and mint *zTokens* at a set collateralization rati&#x6F;*.* These will be available in 4 currencies to start with: zUSD, zNGN, zCFA and zZAR. Any *zTokens* can be burnt to mint an equivalent value in any other currency, allowing for infinite liquidity with no slippage in trades.

zUSD will be the main method to enter the protocol and liquidity will be provided on stable swap AMM pools to convert from any other USD stable coin into zUSD, meaning the other *zTokens* would not need to be supplied on AMMs to have liquidity. Moreover, this provides a method for African investors to easily convert their money into USD to avoid any underlying volatility. &#x20;

Lastly, Baki can help facilitate cross-border trade within the African continent and generate growth by creating a stable coin framework that can easily be converted into key African currencies. The *zTokens* can also be integrated with payment terminals so that they can help execute last-mile transactions.

#### Minting

Minters will form the core backbone of the Baki protocol. When collateral is deposited this will mint zUSD tokens. Minters can either supply *zUSD* on AMM's to generate additional yield and help provide access into the Baki ecosystem, or use Baki themselves to trade ForEx movements between the supported currencies. Minters will also receive a trading fee revenue whenever any *zTokens* are either minted or burnt, providing them with a passive income from providing liquidity to the Baki ecosystem.

When Minters deposit and mint zUSD tokens, they open a debt position equivalent to the total outstanding debt of the protocol. The global debt will be the sum of the value of all *zTokens* in circulation and will fluctuate accordingly over time. This will be shared by all Minters based on the following equation:  &#x20;

$$
Debt\_{user} = \frac{Mint\_{user}

* Redemptions\_{user}}{Mint\_{global} - Redemption\_{global}}\*Debt\_{global}
  $$

Minters will be responsible to maintain their own collateralization ratio, otherwise they will risk liquidation. To remove their collateral, they will need to repay their share of debt that they owe. If current long-term macro trends continue, where African currencies have tended to devalue against the Dollar, Minters might be able to withdraw their collateral by repaying a lower amount than what they initially deposited. &#x20;

#### Risk Mitigation

The key risk associated with Baki is that the *zTokens* de-peg from their value. To avoid this, multiple oracles tracking the price of the currencies will provide reference prices that will be used when swaps are conducted. Moreover, deposits will need to be over-collateralized, therefore creating a buffer against appreciation of the currencies provided as *zTokens.*&#x20;

If an individual user position drops below the set collateral ratio, then their collateral is liquidated and used to repay their share of the debt. Ensuring that individual collateralization ratios remain above 100% will ensure that the protocol is fully collateralized. In addition, the collateralization ratio can be adjusted to a higher amount during periods of augmented volatilit&#x79;*.* These risk mitigation strategies will maintain the protocol's solvency and keep the peg on the stable coins.&#x20;

#### Revenue Model

A trading fee of 0.3% will be applied to any swaps between *zTokens*. This will be split with 75% of the revenue being provided to the Baki Minters, with the remainder split between the treasury and 15% directed to $CNZA token stakers.

#### Further Development

Additional features being developed include: additional currencies for *zTokens*, integration into payment terminals and CTMs, implementation of time agnostic liquidation mechanic and access to commodity prices. These additional features and more will be announced following the Baki v1 launch.

### Jollof Vaults

#### Introduction

One of the core primitives available in DeFi is access to automated strategies to generate yield. These offer easy access to investors to generate passive yield in strategies that compound earnings across multiple protocols. Although, these are staples of DeFi on other chains, these products are conspicuously missing from the Celo ecosystem. Jollof Vaults will bring this core primitive to the Celo ecosystem and create further opportunities for investors to earn auto-compounded yield across not only the flagship Jollof.fi products (Baki and Fixed Yield deposits), but also on other protocols within the Celo ecosystem.

#### Stable Coin Strategies

A key differentiator between Jollof Vault strategies and existing strategies will be the implementation of further diversification in the stable coin deposits being made. This means that the individual deposits will not depend solely on the investment of a single stable coin, rather they're deposited across multiple pools and protocols to diversify risk and increase returns. Moreover, strategies will combine different types of protocols, both AMMs and lending protocols to leverage and increase yield for depositors, whilst managing risk appropriately.&#x20;

#### Revenue Model

Any yield generated by the Jollof Vaults will be subject to a 20% performance fee. 75% of this fee will be directed to the Jollof.fi treasury with the remaining 25% being directed towards $CNZA token stakers.&#x20;

#### Further Development

Further development will include the inclusion of non-stable coin strategies, integration with the Canza Finance JaraTreasury, leveraged LPs and much more which will be announced in future communications.

## Conclusion

In conclusion, the Jollof.fi protocol will not only provide number of key primitives ranging from fixed yield deposits, interest rate swaps, decentralized ForEx markets, and auto-compounding strategies, all of which are currently not available on the Celo network; but will also ensure that these DeFi products are relevant and useful to local African communities, whilst being attractive to international investors. This unique marriage between passive capital and active users will generate a natural tendency to generate higher APYs when compared to protocols that are unable to get an active user base long term. In the words of Walter Wriston, the former CEO of Citicorp "*Capital goes where it is welcome and stays where it is well treated."*


# Baki

Baki is an Infinite-liquidity FX protocol allowing for slippage free swaps between African currencies. The protocol allows users to deposit stable coins and mint overcollateralized, synthetic assets, called ***zTokens,*** that are pegged to African currencies, creating the **first on-chain implementation of African stable coins.**&#x20;

Any ***zToken*** can be burnt to mint the equivalent value, of ***zTokens*** in another currency. Currently, Baki supports the minting of US Dollars (***zUSD***), Nigerian Naira (***zNGN***), West African CFA (***zCFA***) and South African Rand (***zZAR***).&#x20;

All FX conversions between currencies are provided at the central bank rates, offering users access to dollar markets at the best possible rates.


# Mint

To mint ***zTokens***, the user must deposit Celo USD (***cUSD***) as collateral. \
\
The user can then select how much ***zUSD*** they wish to mint. The user can input any value of zUSD capped by a minimum collateralization ratio of 150.00%.&#x20;

If a user wants to deposit collateral without minting any ***zUSD*** they can simply leave the mint input box at 0.0. Similarly, if they would like to mint ***zUSD*** without depositing any collateral they can leave the deposit input box at 0.0, provided that the user has sufficient headroom in their collateralization ratio to mint additional ***zUSD**.*


# Swap

To swap between ***zToken*** currencies the user need to navigate to the swap page and select the input currency and select the output currency they would like to receive. The output amount will automatically be quoted in the output box.&#x20;

## Swapping Logic

When a swap is triggered, the input ***zToken*** is burnt and the output ***zToken*** is minted. This allows for infinite liquidity between the supported currencies. As long as a unit of a ***zToken*** exists, it can be swapped for another ***zToken*** currency.&#x20;

## Pricing

All swaps between ***zTokens*** occur at the price provided by the Baki oracle. This allows Baki to offer central bank rates rather than the parallel rates. This helps create an alternative market allowing users to enter and exit USD positions at the best rate.

## Fees

Every trade will incur a 0.80% trading fees that are split between 50.00% to minters, 25.00% to $CNZA token stakers (coming soon), and 25.00% to the development wallet.


# Burn

To manage their collateralization ratio, users might want to burn ***zUSD*** to reduce their outstanding debt and improve their collateralization ratio or allow them to withdraw collateral.

To burn ***zUSD*** a user needs to navigate to the ***Repay*** tab on the ***Mint*** page. The user can then input the amount of ***zUSD*** they wish to burn. This will decrease a users outstanding debt, thus increasing their collateralization ratio.

If a user wishes to burn ***zUSD*** without withdrawing any collateral, they have to keep the input box for collateral to withdraw at 0.0.&#x20;


# Withdraw

If there is sufficient headroom above the minimum collateralization threshold, the user can also withdraw collateral. To fully remove all collateral a user must repay their entire debt position.&#x20;

To withdraw without burning any tokens the user can keep the burn ***zUSD*** input box to 0.0.


# Rewards

Every trade will incur a 0.80% trading fees that are split between 50.00% to minters, 25.00% to $CNZA token stakers (coming soon), and 25.00% to the development wallet.

Minters can claim the ***zUSD*** trading fees on the Mint page.


# Liquidation

If a users position drops below the minimum collateralization threshold, then this position can be liquidated. The liquidator will pay the outstanding debt in ***zUSD***. In exchange, the liquidator will receive the collateral plus the liquidation fee, up to 10.00%.

The remaining balance of collateral will remain available to the minter to mint additional zUSD against or withdraw their collateral.

To avoid liquidations users need to keep their position above 150.00%. If the collateral value decreases, or the debt value increases, the liquidation ratio will decrease. The user will need to either add additional collateral, or repay debt to increase the collateralization ratio.

This feature will be bot driven and can only be triggered from the contract. Future iterations will allow for an asynchronous liquidation auction that will allow for much more capital efficient liquidations.


# Debt

## Global Debt

Minting ***zTokens*** will cause the protocol's users to incur debt. Each user will owe a share of the ***Global Debt***. This is quoted in US Dollars, and is derived by the sum product of the circulating supply of each ***zTokens*** multiplied by the exchange rate used by the protocol.&#x20;

The value of the debt can fluctuate depending on the FX rates reducing if currencies weaken against the dollar and increasing when they strengthen. The collateralization rate above 100% allows for a buffer, ensuring that all ***zTokens*** remain pegged.&#x20;

For example, assume the exchange rates are 400 Naira per USD, 600 CFA per USD, and 15 ZAR per USD and the circulating supplies are 50,000 zUSD, 100,000,000 zNGN, 6,000,000 zCFA, 1,500,000 zZAR.

The global debt would be calculated as: 50,000 + 100,000,000 / 400 + 6,000,000 / 600 + 1,500,000 / 15 = $410,000

If the exchange rate of Naira to USD increases to 800 Naira per USD the global debt would change to $285,000.

## User Debt

The global debt will be apportioned to each user based on the ***Net Mint*** ***Ratio*** to calculate the user debt. The user debt will be used in subsequent collateralization calculations to determine if a position is collateralized. Users will have to manage their own collateralization ratio to ensure that their position is not liquidated.

## Net Mint Ratio

The ***Net Mint Ratio*** will determine the allocation of the global debt to each user. This will be adjusted every time the user mints or burns ***zUSD**,* to reflect the users apportionment of the global debt.

$$
Net\ Mint\ Ratio = \frac{Mint\_{user}

* Redemptions\_{user}}{Mint\_{global} - Redemption\_{global}} = \frac{Net\ Mint\_{user}}{Net\ Mint\_{global}}
  $$

Each time a user mints ***zUSD***, the Net Mint increases by the amount minted.&#x20;

$$
Net\ Mint\_{user} = Net\ Mint\_{user} + zUSD\ Minted \ Net\ Mint\_{global} = Net\ Mint\_{global} + zUSD\ Minted
$$

Each time the user burns (i.e. redeems) ***zUSD*** their Net Mint is reduced based on a percentage of the outstanding debt they are burning.

$$
Net\ Mint\_{user} = Net\ Mint\_{user} \* (1 -  \frac{{zUSD\ to\ Burn}}{Outstanding\ Debt\_{user}})\Net\ Mint\_{global} = Net\ Mint\_{global} \* (1 -  \frac{{zUSD\ to\ Burn}}{Outstanding\ Debt\_{user}})
$$

## Collateralization Ratio

The collateralization ratio shows the relationship between the collateral deposited and outstanding debt for each user. This is calculated as the deposited collateral divided by the outstanding debt.

$$
Collateralization\ Ratio\_{user} = \frac{Collateral\ Balance\_{user}}{Debt\_{user}}
$$

### Increasing the Collateralization Ratio

If a users collateralization needs to be increased, they can either add collateral or burn ***zUSD*** to increase their ratio. A user needs to remain mindful to keep their collateralization ratio above the minimum threshold of 150.00% to avoid liquidation.

### Decreasing the Collateralization Ratio

If a user has a collateralization above 150.00%, they have the option to decrease it to the minimum threshold. The user has the choice to either mint more ***zUSD*** or remove collateral from the protocol.


# Pegging

All Baki ***zTokens*** are overcollateralized, meaning that they will always guarantee sufficient value to back the ***zToken.*** Additionally, this will incentivise users to maintain the peg through adjusting the supply of zToken. Lastly, since any swap between currencies will be handled by the oracle, only the USD currency peg needs to be maintained to secure the entire system.

### Collateral

Most importantly, to maintain a peg any protocol needs to ensure that the collateral balance is always greater than the outstanding debt. Unlike other collateralized debt position protocols, such as Maker DAO (DAI) or Abracadabra (MIM), Baki will exclusively use stable coins as collateral. The rationale behind this is to flip the traditional model found within crypto to back stable assets with volatile currencies. This is specifically done to avoid a situation where a user's position is liquidated due to movements in the collateral, rather than in movements in the FX markets that Baki's ***zTokens*** would track.

Moreover, Baki's collateralization ratio of 150.00% creates a buffer should there be any significant shocks in the FX prices. In the long term to make the protocol more capital efficient, this can be lowered in the provided protocol liquidity has enough depth.&#x20;

### Trading Above the Peg

If ***zUSD*** is trading above $1.00, then minters are incentivised to mint ***zUSD*** and sell it to earn the premium themselves. Additional minting of ***zUSD*** will drive the price down to the peg of $1.00.

### Trading Below the Peg

If ***zUSD*** is trading below $1.00, then minters are incentivised to burn their ***zUSD**.* Users can buy back their debt at a discount since Baki assumes that zUSD always equals $1.00. The reduction of the supply of ***zUSD*** will result in the price returning to the $1.00 peg.


# Contract Addresses

Once the protocol is live on test net we will include all the contract addresses here.


# Fixed Yield

Coming soon:tm: :construction:Under Construction:construction:&#x20;


