Skip to content

Commit

Permalink
add fusd v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mul53 committed Nov 15, 2023
1 parent ade5a54 commit af5e29b
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.6",
"version": "1.0.7",
"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 @@ -19,6 +19,7 @@ export const MASTERCHEF_V3_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/na
export const xVOLT = '0x97a6e78c9208c21afaDa67e7E61d7ad27688eFd1'
export const VOLT = '0x34Ef2Cc892a88415e9f02b91BfA9c91fC0bE6bD4'
export const FUSD = '0xd0ce1b4A349C35e61Af02f5971e71ac502441E49'
export const FUSD_V3 = '0xCE86a1cf3cFf48139598De6bf9B1dF2E0f79F86F'
export const sFUSE = '0xb1DD0B683d9A56525cC096fbF5eec6E60FE79871'
export const WFUSE = '0x0BE9e53fd7EDaC9F859882AfdDa116645287C629'

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, LIQUID_STAKING, sFUSE, VOLT, WFUSE, xVOLT } from '../constants'
import { FUSD, FUSD_V3, LIQUID_STAKING, sFUSE, 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() === FUSD_V3.toLowerCase()) {
const token0 = await fetchTokenInfo(FUSD_V3, this.web3)
tokens = [{ id: FUSD_V3, ...token0 }, null]

reserves = [globalTotalStake, null]

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

0 comments on commit af5e29b

Please sign in to comment.