Skip to content

Commit

Permalink
Merge pull request #1054 from grkhr/init-1inch
Browse files Browse the repository at this point in the history
Init 1inch
  • Loading branch information
waynebruce0x authored Oct 26, 2023
2 parents 56daa28 + c30eb96 commit e172fc6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/adaptors/1inch-network/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const utils = require('../utils');

const ADDRESSES = {
ethereum: {
'1INCH': '0x111111111117dc0aa78b770fa6a738034120c302',
dst1INCH: '0x9a0c8ff858d273f57072d714bca7411d717501d7',
},
};

const main = async () => {
const data = await utils.getData(
'https://data-distributor.1inch.io/resolversMetrics'
);
const result = Object.values(data)[0].map((pool) => {
return {
pool: `1INCH-${pool.resolver_address}-${pool.chain}`.toLowerCase(),
chain: utils.formatChain(pool.chain),
project: '1inch-network',
symbol: `1INCH (${pool.pool})`,
tvlUsd: Number(pool.tvlUsd),
apyBase: Number(pool.apyBase),
url: `https://app.1inch.io/#/1/earn/delegate/${pool.resolver_address}`,
rewardTokens: [ADDRESSES[pool.chain.toLowerCase()]['1INCH']],
underlyingTokens: [
ADDRESSES[pool.chain.toLowerCase()]['1INCH'],
ADDRESSES[pool.chain.toLowerCase()]['dst1INCH'],
],
};
});
return result;
};

module.exports = {
timetravel: false,
apy: main,
// url: "https://app.1inch.io/#/1/dao/staking",
};

0 comments on commit e172fc6

Please sign in to comment.