Skip to content

Commit

Permalink
add usdc (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
mul53 authored Aug 1, 2024
1 parent 51fb2f2 commit 97e0101
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuseio/earn-sdk",
"version": "1.0.8",
"version": "1.0.9",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const FUSD = '0xd0ce1b4A349C35e61Af02f5971e71ac502441E49'
export const FUSD_V3 = '0xCE86a1cf3cFf48139598De6bf9B1dF2E0f79F86F'
export const sFUSE = '0xb1DD0B683d9A56525cC096fbF5eec6E60FE79871'
export const WFUSE = '0x0BE9e53fd7EDaC9F859882AfdDa116645287C629'
export const USDC_V2 = '0x28C3d1cD466Ba22f6cae51b1a4692a831696391A'

export const LIQUID_STAKING = '0xa3dc222eC847Aac61FB6910496295bF344Ea46be'

Expand Down
9 changes: 8 additions & 1 deletion src/rewards/ChefRewardProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LIQUID_STAKING_ABI from '../constants/abi/LiquidStaking.json'
import { calculateReserves, getChef, weiToNumber } from '../utils'
import { ethCall, ethTransaction } from '../utils/eth'
import { getChefPool, getChefUser } from '../graphql/fetcher'
import { FUSD, FUSD_V3, LIQUID_STAKING, sFUSE, VOLT, WFUSE, xVOLT } from '../constants'
import { FUSD, FUSD_V3, LIQUID_STAKING, sFUSE, USDC_V2, VOLT, WFUSE, xVOLT } from '../constants'
import fetchVoltageTokenPrice from '../utils/fetchVoltageTokenPrice'
import fetchTokenInfo from '../utils/fetchTokenInfo'
import fetchChefPairInfo from '../utils/fetchChefPairInfo'
Expand Down Expand Up @@ -91,6 +91,13 @@ export default class ChefRewardProgram extends RewardProgram {

reserves = [globalTotalStake, null]

pairPrice = 1
} else if (pairAddress.toLowerCase() === USDC_V2.toLowerCase()) {
const token0 = await fetchTokenInfo(USDC_V2, this.web3)
tokens = [{ id: USDC_V2, ...token0 }, null]

reserves = [globalTotalStake, null]

pairPrice = 1
} else if (pairAddress.toLowerCase() === FUSD_V3.toLowerCase()) {
const token0 = await fetchTokenInfo(FUSD_V3, this.web3)
Expand Down

0 comments on commit 97e0101

Please sign in to comment.