Skip to content

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 ​

  • Native rewards: Protocol built-in on-chain rewards, e.g. USDC on fUSDC or ETH on an ETH/USDC vault. Accrue automatically by increasing the user balance, no claiming needed.
  • Merkle rewards: Separately claimable rewards that can be in any token, usually FLUID, on e.g. fUSDC. Note that merkle reward rates are not available on-chain via our resolvers, those have to be fetched through our API instead.
  • Third party rewards e.g. KING APR from ether.fi or rewards handled by merkl etc. For merkl, please refer to the merkl docs to fetch any related data.

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:

  • supplyRate: interest at the Liquidity Layer (paid from borrowers)
  • rewardsRate: additional interest from native rewards, if active
  • totalRate: supplyRate + rewardsRate
  • asset.stakingApr (optional): if the asset has some native APR like e.g. WSTETH staking rate, this is included in asset -> stakingApr. This is not included in totalRate.
  • rewards array (optional): all other rewards, only present if any exist. Fluid handled merkle rewards when rewardType is 'merkle', in that case "rate" is the merkle rewards APR. This is not included in totalRate. Metadata -> merkle -> programId can be used to fetch emission per second via this endpoint, which might not be available for all programs: https://merkle.api.fluid.instadapp.io/programs/<program-id>/apr. When other reward types like e.g. handled by merkl, please refer to the merkl docs to fetch any additional data or the respective reward source or check the metadata for useful included info (e.g. claimUrl).

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:

  • supplyRate: interest at the Liquidity Layer (paid from borrowers)
  • rewardsRate: additional interest from native rewards, if active

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:

  • supplyRate.liquidity.token0: interest earned by lenders at the Liquidity Layer (paid from borrowers)
  • supplyRate.vault.rate: rate at liquidity combined with rewards or fee rate (see supplyRate.vault.feeRat below). can never be < 0
  • supplyRate.vault.feeRate: rewards or fee rate. when positive rewards, when negative fee. The value is in relative percent to supplyRate.liquidity.token0, e.g.:
    • when rewards: supplyRateLiquidity = 4%, rewardsOrFeeRateSupply = 20%, supplyRateVault = 4.8%
    • when fee: supplyRateLiquidity = 4%, rewardsOrFeeRateSupply = -30%, supplyRateVault = 2.8%
  • borrowRate.liquidity.token0: interest payed by borrowers at the Liquidity Layer
  • borrowRate.vault.rate: rate at liquidity combined with rewards or fee rate (see borrowRate.vault.feeRate below). can never be < 0
  • borrowRate.vault.feeRate: rewards or fee rate. when positive fee, when negative rewards. The value is in relative percent to borrowRate.liquidity.token0, e.g.:
    • when rewards: borrowRateLiquidity = 4%, rewardsOrFeeRateBorrow = -20%, borrowRateVault = 3.2%.
    • when fee: borrowRateLiquidity = 4%, rewardsOrFeeRateBorrow = 30%, borrowRateVault = 5.2%.
  • supplyToken.token0.stakingApr: native APR of the supply asset itself, e.g. WSTETH staking rate
  • borrowToken.token0.stakingApr: native APR of the borrow asset itself, e.g. WSTETH staking rate
  • rewards array (optional): all other rewards, only present if any exist. More info see Lendings (fTokens)

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:

  • supplyRateLiquidity: interest earned by lenders at the Liquidity Layer (paid from borrowers)
  • borrowRateLiquidity: interest payed by borrowers at the Liquidity Layer
  • supplyRateVault: rate at liquidity combined with rewards or fee rate (see rewardsOrFeeRate below). can never be < 0
  • borrowRateVault: rate at liquidity combined with rewards or fee rate (see rewardsOrFeeRate below). can never be < 0
  • rewardsOrFeeRateSupply: rewards or fee rate. when positive rewards, when negative fee. The value is in relative percent to supplyRateLiquidity, e.g.:
    • when rewards: supplyRateLiquidity = 4%, rewardsOrFeeRateSupply = 20%, supplyRateVault = 4.8%
    • when fee: supplyRateLiquidity = 4%, rewardsOrFeeRateSupply = -30%, supplyRateVault = 2.8%
  • rewardsOrFeeRateBorrow: rewards or fee rate. when positive fee, when negative rewards. The value is in relative percent to borrowRateLiquidity, e.g.:
    • when rewards: borrowRateLiquidity = 4%, rewardsOrFeeRateBorrow = -20%, borrowRateVault = 3.2%.
    • when fee: borrowRateLiquidity = 4%, rewardsOrFeeRateBorrow = 30%, borrowRateVault = 5.2%.

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:

  • supplyRate.liquidity.token1: interest earned by lenders at the Liquidity Layer (paid from borrowers) for token1 of the dex pair
  • supplyToken.token1.stakingApr: native APR of the supply asset token1 itself, e.g. WSTETH staking rate
  • borrowRate.liquidity.token1: interest payed by borrowers at the Liquidity Layer for token1 of the dex pair
  • borrowToken.token1.stakingApr: native APR of the borrow asset token1 itself, e.g. WSTETH staking rate

Dex trading APR:

  • supplyRate.dex.trading: smart collateral dex pool APR earned through swap fees
  • borrowRate.dex.trading: smart debt dex pool APR earned through swap fees

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.

  • supplyRate.vault.rate: smart collateral rewards or fee rate at the vault. when positive rewards, when negative fee. Absolute percent APR amount referring to the dex shares, i.e. treat it the same way as Dex trading APR.
  • borrowRate.vault.rate: smart debt rewards or fee rate at the vault. when positive fee, when negative rewards. Absolute percent APR amount referring to the dex shares, i.e. treat it the same way as Dex trading APR.

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:

  • supplyRateLiquidity: always 0, must be fetched per token via the DexResolver instead (see below).
  • borrowRateLiquidity: always 0, must be fetched per token via the DexResolver instead (see below).
  • rewardsOrFeeRateSupply: can be ignored, always == supplyRateVault
  • rewardsOrFeeRateBorrow: can be ignored, always == borrowRateVault
  • supplyRateVault: smart collateral rewards or fee rate at the vault. when positive rewards, when negative fee. Absolute percent APR amount referring to the dex shares, i.e. treat it the same way as Dex trading APR.
  • borrowRateVault: smart debt rewards or fee rate at the vault. when positive fee, when negative rewards. Absolute percent APR amount referring to the dex shares, i.e. treat it the same way as Dex trading APR.

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:

  • tokens.token0.stakingApr: native APR of the supply asset token0 itself, e.g. WSTETH staking rate
  • tokens.token1.stakingApr: native APR of the supply asset token1 itself, e.g. WSTETH staking rate
  • rate.liquidity.token0: interest earned by lenders at the Liquidity Layer (paid from borrowers) for token0 of the dex pair
  • rate.liquidity.token1: interest earned by lenders at the Liquidity Layer (paid from borrowers) for token1 of the dex pair
  • rate.dex.trading: smart lending dex pool APR earned through swap fees
  • rate.lending.rate: smart lending rewards or fee rate If positive then rewards, if negative then fee. 1e6 = 100%, 1e4 = 1%, minimum 0.0001% fee or reward. Absolute percent APR that increases/decreases the SmartLending ERC20 token exchange rate to the underlying dex shares.
  • rewards array (optional): all other rewards, only present if any exist. More info see Lendings (fTokens)

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:

  • feeOrReward: The fee or reward rate for the SmartLending itself. If positive then rewards, if negative then fee. 1e6 = 100%, 1e4 = 1%, minimum 0.0001%. Absolute percent APR that increases/decreases the SmartLending ERC20 token exchange rate to the underlying dex shares.
  • dexEntireData.limitsAndAvailability: The 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. Note that this is not set when using the "View" methods like getSmartLendingEntireViewData!