Skip to content

Commit

Permalink
Add token details
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthK2 committed Oct 14, 2024
1 parent db166c3 commit e2ca101
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
20 changes: 19 additions & 1 deletion src/data/treasury-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,30 @@ export const TOKENS: TokensType = {
address: '0xe035e27a8ed6842b478933820f90093d205f7098',
image: '/svgs/fxb.svg',
},
'stkcvxFxs Fraxtal': {
'0x8c279f6bfa31c47f29e5d05a68796f2a6c216892': {
id: 'stkcvxFxs Fraxtal',
name: 'cvxFxs Fraxtal',
address: '0x8c279f6bfa31c47f29e5d05a68796f2a6c216892',
image: '/svgs/stkcvx.svg',
},
'0x1872621050cc3c267c1982c6d199b7d6a4d0e87a': {
id: 'FXB20551231',
name: 'FXB20551231',
address: '0x1872621050cc3c267c1982c6d199b7d6a4d0e87a',
image: '/svgs/FXB.svg',
},
'0x22c4649ea0937e86ab64366ddfb39d6769874b17': {
id: 'FXB20251231',
name: 'FXB20251231',
address: '0x22c4649ea0937e86ab64366ddfb39d6769874b17',
image: '/svgs/FXB.svg',
},
'0xed634f2dd6632d0eb017d44639ae77798a315c0f': {
id: 'FXB20291231',
name: 'FXB20291231',
address: '0xed634f2dd6632d0eb017d44639ae77798a315c0f',
image: '/svgs/FXB.svg',
},
}

export const tokenIds = Object.values(TOKENS).map((tok) => tok.id)
Expand Down
40 changes: 20 additions & 20 deletions src/utils/treasury-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ import {

const TOKEN_MINIMUM_VALUE = 4000

type FraxConvexDetails = {
name: string
pool: { controller: any }
stats: { asset_usd_value: any }
detail: { supply_token_list: { amount: number; symbol: string }[] }
}

const SUPPORTED_LP_TOKENS_ADDRESSES = [
'0x7af00cf8d3a8a75210a5ed74f2254e2ec43b5b5b',
'0x41a5881c17185383e19df6fa4ec158a6f4851a69:32',
Expand Down Expand Up @@ -174,19 +167,26 @@ export const getTreasuryDetails = async () => {

// Add Frax Convex holdings
if (fraxConvexDetails) {
fraxConvexDetails.forEach((item: FraxConvexDetails) => {
additionalTreasuryData.push({
id: `FXTL CVX ${item.name}`,
contractAddress: item.pool.controller,
raw_dollar: Number(item.stats.asset_usd_value),
token: item.detail.supply_token_list.map(
(supply: { amount: number; symbol: string }) => ({
amount: supply.amount,
symbol: supply.symbol,
}),
),
})
})
console.log(fraxConvexDetails)
fraxConvexDetails.forEach(
(item: {
pool: { adapter_id: any; controller: any; id: any }
stats: { asset_usd_value: any }
detail: { supply_token_list: { amount: number; symbol: string }[] }
}) => {
additionalTreasuryData.push({
id: item.pool.id,
contractAddress: item.pool.id,
raw_dollar: Number(item.stats.asset_usd_value),
token: item.detail.supply_token_list.map(
(supply: { amount: number; symbol: string }) => ({
amount: supply.amount,
symbol: supply.symbol,
}),
),
})
},
)
}

const allTreasureDetails = [...treasuryDetails, ...additionalTreasuryData]
Expand Down

0 comments on commit e2ca101

Please sign in to comment.