Skip to content

Commit

Permalink
added url for lending and vault protocol (#1686)
Browse files Browse the repository at this point in the history
Co-authored-by: 0xprinc <[email protected]>
  • Loading branch information
0xprinc and 0xprinc authored Jan 13, 2025
1 parent ef1c0df commit dba6645
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/adaptors/fluid-lending/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const CONSTANTS = {
arbitrum: 42161,
base: 8453,
},
// SUPPORTED_CHAINS: ['ethereum'],
SUPPORTED_CHAINS: ['ethereum', 'arbitrum', 'base'],
RESOLVERS: {
LENDING: {
Expand Down Expand Up @@ -73,6 +72,7 @@ const getLendingApy = async (chain) => {
chain,
apyBase: Number((token.supplyRate / 1e2).toFixed(2)),
apyReward: Number((token.rewardsRate / 1e12).toFixed(2)),
url: `https://fluid.instadapp.io/lending/${CONSTANTS.CHAIN_ID_MAPPING[chain]}/${symbol.output[i].output}`,
}))
.filter((i) => utils.keepFinite(i));
} catch (error) {
Expand All @@ -84,14 +84,19 @@ const getLendingApy = async (chain) => {
// Vault Functions
const getVaultApy = async (chain) => {
try {
const vaultsEntireData = (
let vaultsEntireData = (
await sdk.api.abi.call({
target: CONSTANTS.RESOLVERS.VAULT[chain],
abi: abiVaultResolver.find((m) => m.name === 'getVaultsEntireData'),
chain,
})
).output;

vaultsEntireData = vaultsEntireData.map((vault, index) => ({
...vault,
VaultId: index + 1,
}));

const filteredVaults = vaultsEntireData.filter(
(vault) => vault[1] === false && vault[2] === false
);
Expand Down Expand Up @@ -223,6 +228,7 @@ const calculateVaultPoolData = (
),
ltv: vaultDetails.ltv[index] / 1e4,
mintedCoin: borrowSymbol,
url: `https://fluid.instadapp.io/vaults/${CONSTANTS.CHAIN_ID_MAPPING[chain]}/${vault.VaultId}`,
};
});
};
Expand All @@ -239,5 +245,4 @@ const apy = async () => {

module.exports = {
apy,
url: 'https://fluid.instadapp.io',
};

0 comments on commit dba6645

Please sign in to comment.