diff --git a/src/adaptors/glacier-finance/abiGauge.json b/src/adaptors/glacier-exchange-v2/abiGauge.json similarity index 100% rename from src/adaptors/glacier-finance/abiGauge.json rename to src/adaptors/glacier-exchange-v2/abiGauge.json diff --git a/src/adaptors/glacier-finance/abiPair.json b/src/adaptors/glacier-exchange-v2/abiPair.json similarity index 100% rename from src/adaptors/glacier-finance/abiPair.json rename to src/adaptors/glacier-exchange-v2/abiPair.json diff --git a/src/adaptors/glacier-finance/abiPairFactory.json b/src/adaptors/glacier-exchange-v2/abiPairFactory.json similarity index 100% rename from src/adaptors/glacier-finance/abiPairFactory.json rename to src/adaptors/glacier-exchange-v2/abiPairFactory.json diff --git a/src/adaptors/glacier-finance/abiVoter.json b/src/adaptors/glacier-exchange-v2/abiVoter.json similarity index 100% rename from src/adaptors/glacier-finance/abiVoter.json rename to src/adaptors/glacier-exchange-v2/abiVoter.json diff --git a/src/adaptors/glacier-finance/index.js b/src/adaptors/glacier-exchange-v2/index.js similarity index 98% rename from src/adaptors/glacier-finance/index.js rename to src/adaptors/glacier-exchange-v2/index.js index b973aef9ff..e66f303043 100644 --- a/src/adaptors/glacier-finance/index.js +++ b/src/adaptors/glacier-exchange-v2/index.js @@ -118,7 +118,7 @@ const getApy = async () => { return { pool: p, chain: utils.formatChain('avax'), - project: 'glacier-finance', + project: 'glacier-exchange-v2', symbol: utils.formatSymbol(s.split('-')[1]), tvlUsd, apyReward, diff --git a/src/adaptors/marginfi/index.js b/src/adaptors/marginfi-lending/index.js similarity index 73% rename from src/adaptors/marginfi/index.js rename to src/adaptors/marginfi-lending/index.js index f9ba61a1e9..30d7262a5a 100644 --- a/src/adaptors/marginfi/index.js +++ b/src/adaptors/marginfi-lending/index.js @@ -1,4 +1,3 @@ -const utils = require('../utils'); const fetch = require('node-fetch'); const MARGINFI_URL = 'https://app.marginfi.com'; @@ -7,8 +6,8 @@ const SNAPSHOT_URL = async function main() { const snapshotResponse = await fetch(SNAPSHOT_URL); - const snapshot = snapshotResponse.json(); - return snapshot; + const snapshot = await snapshotResponse.json(); + return snapshot.map((p) => ({ ...p, project: 'marginfi-lending' })); } module.exports = { diff --git a/src/adaptors/taiga-acala/index.js b/src/adaptors/taiga-acala/index.js new file mode 100644 index 0000000000..3331647b3f --- /dev/null +++ b/src/adaptors/taiga-acala/index.js @@ -0,0 +1,34 @@ +const utils = require('../utils'); + +const getPools = async () => { + const tdotApr = await utils.getData( + 'https://api.taigaprotocol.io/rewards/apr?network=acala&pool=0' + ); + const tdotStats = await utils.getData( + 'https://api.taigaprotocol.io/tokens/tdot/stats' + ); + + const priceKey = 'coingecko:polkadot'; + + const { coins: prices } = await utils.getData( + `https://coins.llama.fi/prices/current/${priceKey}` + ); + const dotUsd = prices[priceKey].price; + + const tdot = { + pool: 'acala-sa0-taiga', + chain: utils.formatChain('acala'), + project: 'taiga-acala', + symbol: 'tDOT', + tvlUsd: tdotStats.total * dotUsd, + apyBase: Number(tdotApr['sa://0']) * 100, + }; + + return [tdot]; +}; + +module.exports = { + timetravel: false, + apy: getPools, + url: 'https://app.taigaprotocol.io/', +}; diff --git a/src/adaptors/taiga-protocol/index.js b/src/adaptors/taiga-karura/index.js similarity index 63% rename from src/adaptors/taiga-protocol/index.js rename to src/adaptors/taiga-karura/index.js index 811b9ffded..e0941a1059 100644 --- a/src/adaptors/taiga-protocol/index.js +++ b/src/adaptors/taiga-karura/index.js @@ -14,24 +14,10 @@ const getPools = async () => { 'https://api.taigaprotocol.io/tokens/3usd/stats' ); - const tdotApr = await utils.getData( - 'https://api.taigaprotocol.io/rewards/apr?network=acala&pool=0' - ); - const tdotStats = await utils.getData( - 'https://api.taigaprotocol.io/tokens/tdot/stats' - ); - - const priceKey = 'coingecko:polkadot'; - - const { coins: prices } = await utils.getData( - `https://coins.llama.fi/prices/current/${priceKey}` - ); - const dotUsd = prices[priceKey].price; - const taiKsm = { pool: 'karura-sa0-taiga', chain: utils.formatChain('karura'), - project: 'taiga-protocol', + project: 'taiga-karura', symbol: 'tKSM', tvlUsd: taiKsmStats.data.tvl, apyBase: taiKsmApr['sa://0'] * 100, @@ -42,7 +28,7 @@ const getPools = async () => { const threeUsd = { pool: 'karura-sa1-taiga', chain: utils.formatChain('karura'), - project: 'taiga-protocol', + project: 'taiga-karura', symbol: '3USD', tvlUsd: threeUsdStats.data.tvl, apyBase: threeUsdApr['sa://1'] * 100, @@ -55,16 +41,7 @@ const getPools = async () => { 100, }; - const tdot = { - pool: 'acala-sa0-taiga', - chain: utils.formatChain('acala'), - project: 'taiga-protocol', - symbol: 'tDOT', - tvlUsd: tdotStats.total * dotUsd, - apyBase: Number(tdotApr['sa://0']) * 100, - }; - - return [taiKsm, threeUsd, tdot]; + return [taiKsm, threeUsd]; }; module.exports = {