For the complete documentation index, see llms.txt. This page is also available as Markdown.

Example: How to Use Lorenzo OTF Vaults

To deposit/withdraw assets to/from Lorenzo OTF vaults, please follow the following steps:

Deposit

  1. Approve your underlying asset to the vault contract for the desired amount. The deposit amount must be greater than the minDepositAmount value set in the vault.

  2. Compose a transaction to call the depoist(uint256) method on the vault and submit the transaction.

  3. On receiving the transaction:

    1. The vault first transfers the underlying asset in by calling transferFrom().

    2. The vault then dispatches the underlying assets to its portfolios' wallet addresses.

    3. The vault finally mints LP tokens to the depositor. For calculation details, please refer to the previous section.

Request Withdrawal

  1. First, determine the amount of LP token shares to withdraw and invoke the requestWithdraw(uint256) method on the vault contract. The amount of shares must be greater than the minWithdrawAmount value set in the vault. If the amount of shares is less than minWithdrawAmount, all of the balance must be withdrawn at once.

  2. After the transaction is submitted successfully, a requestId is returned for later completing the final withdrawal. If the user submits multiple withdrawal requests within the same settlement period, the amount of requested LP tokens is accumulated and associated to only one requestId.

  3. The requested amount of LP tokens are locked instead of being immediately burnt until the final withdrawal settlement.

  4. Wait 5~8 days until the UnitNAVUnitNAV is finalized for the current settlement period.

Withdraw

  1. After the UnitNAVUnitNAV is finalized, the final withdrawal settlement can proceed.

  2. Invoke the withdraw(unint256 reqeustId) method on the vault with the prefiously received requestId.

  3. After the transaction is submitted, the corresponding amount of underlying assets is returned. The received amount Runderlying=Δshares×UnitNAVnR_{underlying}=\Delta{shares}\times{UnitNAV _ {n}}, and Δshares\Delta{shares} of LP tokens are burnt.

Last updated