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

Example: How to Create a Lorenzo OTF Vault for a Trading Strategy

The following are the steps to create a finBTC test vault on BSC Testnet. finBTC is the name of the OFT token.

  1. First, determinine the type of the underlying asset. Here we use the test token BBTC.

  2. Create 3 custody wallets, each receives 20%, 30%, 50% of the deposited BBTC tokens, respectively.

  3. Add the 3 wallets to CeDeFiManager by calling the method addPortfolios(address[]). Only these portfolios can be used for creating a vault.

  4. Create the vault for BBTC by invoking the creataVault() method of CeDeFiManager :

const [admin] = await ethers.getSigners();
const minDepositAmount = ethers.parseEther("1");
const minWithdrawAmount = ethers.parseEther("0.5");

const pp1 = ethers.parseEther("0.2");  // 20%
const pp2 = ethers.parseEther("0.3");  // 30%
const pp3 = ethers.parseEther("0.5");  // 50%

const CeDeFiManager = await ethers.getContractAt('CeDeFiManager', DebugContracts.Manager)
let t = await CeDeFiManager.connect(admin).createVault(
1,           // yield type 1 means SimpleVault
"Fin BTC",   // name of this vault
"finBTC",    // symbol of this vault
"0x4636E9e38121d3bB7773Ff63a85d1bF97c17d00f",  // address of underlying asset
minDepositAmount,  
minWithdrawAmount,
["0x40209e58D76492387eab68607F3731F4c4faB24c", 
 "0xeEA32E607235Ca6A18e2FC30Bb22421d9E2A7564",
 "0x96c1FA3793804e140E5c4a6A91966485d677c6aD"
 ],
[pp1, pp2, pp3]
);
await t.wait();
console.log(`createVault: ${t.hash}`);
  1. Now the vault is created and users can deposit BBTC to this vault from Lorenzo frontend.

Last updated