Vault-SDK
SDK for developers who wants to integrate ratio vaults into their app.
1. Install vault-sdk
yarn add @ratio-finance/vault-sdkimport { RatioLendingProgram } from "@ratio-finance/vault-sdk";
const lendingProgram = RatioLendingProgram.getInstance(conn);
await lendingProgram.init();3. Deposit LP
const raydiumUsdtUsdcKey = "As3EGgLtUVpdNpE6WCKauyNRrCCwcQ57trWQ3wyRXDa6";
const depositTx = await lendingProgram.depositLP(
USER_KEYPAIR.publicKey, // UserPublicKey : PublicKey
raydiumUsdtUsdcKey, // CollateralMint: PublicKey
0.1 // DepositAmount: number (must be uiAmount)
);
const depositTxHash = await sendAndConfirmTransaction(
conn,
depositTx,
[USER_KEYPAIR]
);
console.log(`deposit is done successfully. txHash = ${depositTxHash}`);4. Other Transactions
5. Get Yield Farming Reward (Get pending reward from Yield Farming)
6. Get RATIO Apr Reward (If the pool has RATIO emission, user will get RATIO reward)
Last updated