Skip to content

Commit

Permalink
set oracle fee or mainnet to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tunogya committed May 8, 2022
1 parent 6cac474 commit 95a9f8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/CoFiXPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class CoFiXPair extends ERC20Token {
},
oracleOut: amountIn.multipliedBy(tokenAmount),
amountOut: amountOut,
oracleFee: toBigNumber(this.api.chainId === 1 ? 0 : 0.01),
oracleFee: toBigNumber(this.api.chainId === 1 ? 0 : 0.001),
}
} else if (src === this.pair[1].symbol && dest === 'ETH') {
let amountOut = amountIn.div(tokenAmount)
Expand All @@ -344,7 +344,7 @@ class CoFiXPair extends ERC20Token {
},
oracleOut: amountIn.div(tokenAmount),
amountOut: amountOut,
oracleFee: toBigNumber(this.api.chainId === 1 ? 0 : 0.01),
oracleFee: toBigNumber(this.api.chainId === 1 ? 0 : 0.001),
}
} else {
throw new Error(`can not swap ${src} to ${dest}`)
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useAddLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const useAddLiquidity = (content: TransactionAddLiquidityContent) => {
.shiftedBy(18)
.toFixed(0),
to: api.account || '',
oracleCallFee: api.chainId === 1 ? "0" : "0.01",
sendETHValue: api.Tokens.ETH.parse(toBigNumber(api.chainId === 1 ? 0 : 0.01).plus(toBigNumber(content.token0.amount))).toFixed(0),
oracleCallFee: api.chainId === 1 ? "0" : "0.001",
sendETHValue: api.Tokens.ETH.parse(toBigNumber(api.chainId === 1 ? 0 : 0.001).plus(toBigNumber(content.token0.amount))).toFixed(0),
}

if (JSON.stringify(newArgs) !== JSON.stringify(args)) {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useRemoveLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const useRemoveLiquidity = (content: TransactionRemoveLiquidityContent) => {
liquidity: liquidity.shiftedBy(18).toFixed(0),
amountETHMin: api.Tokens.ETH.parse(ethAmountOut.multipliedBy(1 - slippageTolerance)).toFixed(0),
to: api.account || '',
oracleCallFee: api.Tokens.ETH.parse(api.chainId === 1 ? 0 : 0.01).toFixed(0),
sendETHValue: api.Tokens.ETH.parse(api.chainId === 1 ? 0 : 0.01).toFixed(0),
oracleCallFee: api.Tokens.ETH.parse(api.chainId === 1 ? 0 : 0.001).toFixed(0),
sendETHValue: api.Tokens.ETH.parse(api.chainId === 1 ? 0 : 0.001).toFixed(0),
receive: content.receive,
}

Expand Down

0 comments on commit 95a9f8b

Please sign in to comment.