fluid ⌘K

Integrate

Get lend, borrow, yield rates

See below guides for fetching lending, borrow and yield incl. reward rates for the various Fluid protocols.

All contract addresses for the resolvers are listed here. Resolver methods are not intended for on-chain use and most resolver methods are expected to be called via callStatic.

All rate values are returned in percent 1e2 precision (1% = 100, 100% = 10000) unless otherwise specified.

Types of rewards

Lendings (fTokens)

via API

Use https://api.fluid.instadapp.io/v2/lending/1/tokens to fetch data for all tokens or https://api.fluid.instadapp.io/v2/lending/<chain-id>/tokens/<fToken-address> (e.g. fUSDC) to fetch data for a specific fToken.

Returned fields:

on-chain (without merkle rewards)

The LendingResolver contract methods like getFTokenDetails (also see docs) or getFTokensEntireData include all APR info incl. rewards. The returned struct FTokenDetails has the following fields:

Vaults

For smart vaults, refer to the specific section further below.

via API

Use https://api.fluid.instadapp.io/v2/borrowing/1/vaults to fetch data for all vaults or https://api.fluid.instadapp.io/v2/borrowing/<chain-id>/vaults/<vault-id> (e.g. vault 1) to fetch data for a specific vault.

Returned fields:

on-chain (without merkle rewards)

The VaultResolver contract methods like getVaultEntireData (also see docs) include all APR info incl. rewards. The returned struct VaultEntireData -> exchangePricesAndRates has the following fields:

Smart vaults (with dex liquidity on collateral or debt side)

Smart vaults can be either smart collateral / normal debt, normal collateral / smart debt or both smart collateral / smart debt. For normal collateral and debt, the previous section applies. For smart collateral and smart debt, the below info applies.

Use the same process as for normal vaults, but note the following differences:

via API

Additional fields:

Token1 infos:

Dex trading APR:

Differences for vault rate values:

"rate" refers to the reward / fee rate at the vault itself instead. "feeRate" can be ignored, it will always be 0.

on-chain (without merkle rewards and dex trading APR)

Dex trading APR and merkle rewards info is only available via API.

Differences to normal collateral / normal debt:

To fetch the dex pair token rates use the DexResolver contract methods like getDexSwapLimitsAndAvailability (also see docs) or getDexEntireData. The returned struct SwapLimitsAndAvailability includes the info for each token in the liquidityTokenData0 and liquidityTokenData1 returned OverallTokenData structs -> "supplyRate" and "borrowRate". These values refer to the rates earned as lenders or paid as borrowers at the LL.

Smart lendings (dex pool lendings)

via API

Use https://api.fluid.instadapp.io/v2/smart-lending/1/tokens to fetch data for all smart lendings (replace chain-id as needed)

Returned fields:

on-chain (without merkle rewards and dex trading APR)

Dex trading APR and merkle rewards info is only available via API.

The SmartLendingResolver contract methods like getSmartLendingEntireData (also see docs) include all APR info incl. rewards. The returned struct SmartLendingEntireData has the following fields:

Claim Merkle Rewards

Use https://merkle.api.fluid.instadapp.io/programs/<programId>/users/<user-address>/claims to fetch the merkle rewards related data (claimable amount, merkle proofs and cycle).

Call the claim method on the merkle distributor contract (refer to the distributor addresses here) with the following params:

How to find the programId to be used in the claims API?