Skip to content

Commit

Permalink
Fix/fusd v2 (#34)
Browse files Browse the repository at this point in the history
* add fusdv2 farm fx

* update version number
  • Loading branch information
mul53 authored Dec 1, 2022
1 parent 60aa53b commit 616612f
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.2",
"version": "1.0.3",
"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 @@ -18,6 +18,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 STABLESWAP_POOL_LP_HASH = {
'0xa3c1046290b490e629e11ace35863cb0cae382ab': '0x2a68d7c6ea986fa06b2665d08b4d08f5e7af960c',
Expand Down
9 changes: 8 additions & 1 deletion src/rewards/ChefRewardProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ABI from '../constants/abi/MasterChef.json'
import { calculateReserves, getChef, weiToNumber } from '../utils'
import { ethCall, ethTransaction } from '../utils/eth'
import { getChefPool, getChefUser } from '../graphql/fetcher'
import { VOLT, xVOLT } from '../constants'
import { FUSD, VOLT, xVOLT } from '../constants'
import fetchVoltageTokenPrice from '../utils/fetchVoltageTokenPrice'
import fetchTokenInfo from '../utils/fetchTokenInfo'
import fetchChefPairInfo from '../utils/fetchChefPairInfo'
Expand Down Expand Up @@ -84,6 +84,13 @@ export default class ChefRewardProgram extends RewardProgram {
reserves = [globalTotalStake, null]

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

reserves = [globalTotalStake, null]

pairPrice = 1
} else {
const {
reserveUSD,
Expand Down

0 comments on commit 616612f

Please sign in to comment.