Any user can become a liquidity provider, as long as he holds BRZ or USDC and deposits it in one of the pools. Once a deposit is made, the user gets shares (which represent the portion of the pool that he owns) and starts participating in rewards (yield) generated by the pool.

To make it fair for all liquidity providers, a user that joins a pool only participates in rewards in the coming cycles (so he misses the current one).

The platform allows users to add / withdraw liquidity at any moment, but we need to distinguish how the process is done if the system is in the JoinLeave state or in a different one, because once a cycle is running, we can't really add the new assets immediately, and we can't really extract assets either.

So how does this work?

If we are in the JoinLeave period, there are 2 functions that allows you to deposit / withdraw assets immediately:

  • directDeposit: any user can call it to transfer BRZ immediately into a Pool, in exchange for shares.
  • directWithdraw: any user can call it to burn shares from a Pool immediately, in exchange for the corresponding BRZ.
  • USDC: Please notice this is done indirectly by interacting with another smart contract (Nako) which will be explained in a different section.

If we are not in the JoinLeave period, users that want to deposit / withdraw need to create requests that will be processed later:

  • queueDeposit: any user can call it to create a new deposit request. His BRZ is taken immediately and stored in the Pool. If it is called many times, the amount of the request keeps increasing.
  • queueWithdraw: any user can call it to create a new withdrawal request. His shares are taken immediately and stored in the Pool. If it is called many times, the amount of the request keeps increasing.
  • cancelDeposit: any user can call this with an amount to decrease his request's amount and get back the BRZ.
  • cancelWithdraw: any user can call this with an amount to decrease his request's amount and get back the shares.
  • finalizeDepositQueue: this can be called by the same user at any moment after the cycle (in which it was created) passed. You send an amount which is immediately processed, meaning you get the shares.
  • finalizeWithdrawQueue: this can be called by the same user at any moment after the cycle (in which it was created) passed. You send an amount which is immediately processed, meaning you get the BRZ.

Whenever a cycle ends, the platform does a rollover to know how much capital is available for the next cycle, both to know the availability for Oracles but also to understand how to distribute future late repayments. A late repayment is when a borrower repays a loan after the cycle finished.

The platform doesn't need the user to finalize its requests, but it is a necessary step for the user if he wants to access his assets:

  • Withdraws: when the user finalizes, he gets his BRZ back.
  • Deposits: when the user finalizes, he gets his LP tokens and also he is enabled to claim any late repayments.

What’s Next

Check out how the liquidity process works in a little more detail: