Integration Guide

Introduction

Solend has 3 types of accounts: lending market, reserve, and obligation.

There's only one instance of a lending market for now. There's a one-to-one mapping from listed asset to reserve. There's a one-to-one mapping from user to obligations (which tracks user's collateral/borrows).

Rust definitions are here.

Calculating TVL from on-chain data example

https://github.com/solendprotocol/tvl-calculator-example

Deriving obligation address

const seed = LENDING_MARKET_ADDRESS.slice(0, 32);
const obligationAddress = await PublicKey.createWithSeed(
  new PublicKey(address),
  seed,
  new PublicKey(SOLEND_PROGRAM_ID),
);

Calculating APY

The following typescript snippet is extracted from our codebase:

Additionally, we have a few other resources for developers:

Last updated

Was this helpful?