mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 08:34:23 +08:00
feat: updated superloop tvl adapter (#16901)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const ADDRESSES = require('../helper/coreAssets.json')
|
||||
module.exports = {
|
||||
'VAULTS' : ['0xe24e5deba01ab0b5d78a0093442de0864832803e','0xc557529dd252e5a02e6c653b0b88984afa3c8199'],
|
||||
'V1_VAULTS' : ['0xe24e5deba01ab0b5d78a0093442de0864832803e','0xc557529dd252e5a02e6c653b0b88984afa3c8199'],
|
||||
'VAULTS' : ['0xdd160351c9b75ac2984b5e11367e06ab25ee49eb','0xe6da0bb72a818ed519edb51717b86077464f0857'],
|
||||
'MIGRATION_BLOCKS' : [29421087, 29426956],
|
||||
"SUPERLEND_PROTOCOL_DATA_PROVIDER": "0x99e8269dDD5c7Af0F1B3973A591b47E8E001BCac",
|
||||
'VAULT_TOKENS' : {
|
||||
'0xe24e5deba01ab0b5d78a0093442de0864832803e' : {
|
||||
@@ -10,6 +12,14 @@ module.exports = {
|
||||
'0xc557529dd252e5a02e6c653b0b88984afa3c8199' : {
|
||||
"lend" : ADDRESSES.etlk.LBTC,
|
||||
"borrow" : ADDRESSES.etlk.WBTC,
|
||||
},
|
||||
'0xdd160351c9b75ac2984b5e11367e06ab25ee49eb' : {
|
||||
"lend" : ADDRESSES.etlk.STXTZ,
|
||||
"borrow" : ADDRESSES.etlk.WXTZ,
|
||||
},
|
||||
'0xe6da0bb72a818ed519edb51717b86077464f0857' : {
|
||||
"lend" : ADDRESSES.etlk.LBTC,
|
||||
"borrow" : ADDRESSES.etlk.WBTC,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,19 @@ const userReserveDataAbi = "function getUserReserveData(address asset, address u
|
||||
|
||||
async function tvl(api) {
|
||||
const balances = {};
|
||||
|
||||
for(const vault of config.VAULTS) {
|
||||
await processVault(api, vault, balances);
|
||||
}
|
||||
|
||||
for(let i = 0; i < config.VAULTS.length; i++) {
|
||||
const vault = config.VAULTS[i];
|
||||
const v1Vault = config.V1_VAULTS[i];
|
||||
const migrationBlock = config.MIGRATION_BLOCKS[i];
|
||||
|
||||
if(!api.block || api.block > migrationBlock) {
|
||||
await processVault(api, vault, balances);
|
||||
} else {
|
||||
await processVault(api, v1Vault, balances);
|
||||
}
|
||||
}
|
||||
|
||||
return balances;
|
||||
}
|
||||
|
||||
@@ -37,8 +45,16 @@ async function processVault(api, vault, balances) {
|
||||
async function borrowed(api) {
|
||||
const balances = {}
|
||||
|
||||
for(const vault of config.VAULTS) {
|
||||
await processVaultBorrow(api, vault, balances);
|
||||
for(let i = 0; i < config.VAULTS.length; i++) {
|
||||
const vault = config.VAULTS[i];
|
||||
const v1Vault = config.V1_VAULTS[i];
|
||||
const migrationBlock = config.MIGRATION_BLOCKS[i];
|
||||
|
||||
if(!api.block || api.block > migrationBlock) {
|
||||
await processVaultBorrow(api, vault, balances);
|
||||
} else {
|
||||
await processVaultBorrow(api, v1Vault, balances);
|
||||
}
|
||||
}
|
||||
|
||||
return balances;
|
||||
|
||||
Reference in New Issue
Block a user