Skip to content

Commit

Permalink
Add AVAX factory to config and fix balances for Ethereum token
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Apr 3, 2024
1 parent 147628e commit ffa817d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions projects/aura-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const config = {
polygon: { factory: '0x22625eedd92c81a219a83e1dc48f88d54786b017', fromBlock: 40687417, voterProxy: '0xC181Edc719480bd089b94647c2Dc504e2700a2B0' },
xdai: { factory: '0x83E443EF4f9963C77bd860f94500075556668cb8', fromBlock: 27088527, voterProxy: '0xC181Edc719480bd089b94647c2Dc504e2700a2B0' },
polygon_zkevm: { factory: '0x2498A2B0d6462d2260EAC50aE1C3e03F4829BA95', fromBlock: 203652, voterProxy: '0xC181Edc719480bd089b94647c2Dc504e2700a2B0' },
avax: { factory: '0xf23b4DB826DbA14c0e857029dfF076b1c0264843', fromBlock: 32558551, voterProxy: '0xC181Edc719480bd089b94647c2Dc504e2700a2B0' },
}

module.exports = {
Expand Down
3 changes: 3 additions & 0 deletions projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const ibcMappings = {
}

const fixBalancesTokens = {
ethereum: {
'0x4d831e22f062b5327dfdb15f0b6a5df20e2e3dd0': { coingeckoId: 'stakestone-ether', decimals: 18 },
},
// Sample Code
ozone: {
// '0x83048f0bf34feed8ced419455a4320a735a92e9d': { coingeckoId: "ozonechain", decimals: 18 }, // was mapped to wrong chain
Expand Down
5 changes: 4 additions & 1 deletion projects/starshares/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ const { sumTokens2, nullAddress } = require('../helper/unwrapLPs')
const contract = "0xC605C2cf66ee98eA925B1bb4FeA584b71C00cC4C"

async function tvl(time, ethBlock, _b, {api}) {
return sumTokens2({ tokens: [nullAddress], owners: [contract, '0x563395A2a04a7aE0421d34d62ae67623cAF67D03', '0xa481b139a1a654ca19d2074f174f17d7534e8cec', '0x69B7F08B2952e2EE3CA4222190BCF07831f1096f'], api })
await sumTokens2({ tokens: [nullAddress], owners: [contract, '0x563395A2a04a7aE0421d34d62ae67623cAF67D03', '0xa481b139a1a654ca19d2074f174f17d7534e8cec', '0x69B7F08B2952e2EE3CA4222190BCF07831f1096f'], api })
if (Object.keys(api.getBalances()).length === 0) {
throw new Error("No tokens found")
}
}

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function getTvl(
api.storedKey = storedKey
if (!isFetchFunction) {
let tvlBalances = await tvlFunction(api, ethBlock, chainBlocks, api);
if (!tvlBalances && Object.keys(api.getBalances()).length) tvlBalances = api.getBalances()
if (tvlBalances === undefined) tvlBalances = api.getBalances()
const tvlResults = await computeTVL(tvlBalances, "now");
await diplayUnknownTable({ tvlResults, storedKey, tvlBalances, })
usdTvls[storedKey] = tvlResults.usdTvl;
Expand Down

0 comments on commit ffa817d

Please sign in to comment.