Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ class QuoterV2(
Chain.Polygon,
Chain.Optimism,
Chain.ArbitrumOne,
Chain.EthereumGoerli -> "0x61fFE014bA17989E743c5F6cB21bF9697530B21e"
Chain.BinanceSmartChain,
Chain.Base -> "0x88F1905197cCb1A94a1EA906F4e973bF6F2248dB"

Chain.BinanceSmartChain -> "0x78D78E420Da98ad378D7799bE8f4AF69033EB077"
Chain.Base -> "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a"
Chain.ZkSync -> "0x8Cb537fc92E26d8EBBb760E632c95484b6Ea3e28"
Chain.EthereumGoerli -> "0x61fFE014bA17989E743c5F6cB21bF9697530B21e"
else -> throw IllegalStateException("Not supported Uniswap chain $chain")
}

private fun getPancakeSwapQuoterAddress(chain: Chain) = when (chain) {
Chain.BinanceSmartChain,
Chain.Ethereum -> "0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997"
Chain.Base,
Chain.Ethereum -> "0xc9b8E9513D71c7Ce8B5482242545e18036Effff3"
Chain.ZkSync -> "0x3d146FcE6c1006857750cBe8aF44f76a28041CCc"

else -> throw IllegalStateException("Not supported PancakeSwap chain $chain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ class SwapRouter(private val dexType: DexType) {
Chain.Polygon,
Chain.Optimism,
Chain.ArbitrumOne,
Chain.EthereumGoerli -> Address("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45")
Chain.BinanceSmartChain,
Chain.Base -> Address("0x8f934fD34A92C1df0DbA4bEfAe7d16CCF255FeBD")

Chain.BinanceSmartChain -> Address("0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2")
Chain.Base -> Address("0x2626664c2603336E57B271c5C0b26F421741e481")
Chain.ZkSync -> Address("0x99c56385daBCE3E81d8499d0b8d0257aBC07E8A3")
Chain.EthereumGoerli -> Address("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45")
else -> throw IllegalStateException("Not supported Uniswap chain ${chain}")
}

private fun getPancakeSwapRouterAddress(chain: Chain) = when (chain) {
Chain.BinanceSmartChain,
Chain.Ethereum -> Address("0x13f4EA83D0bd40E75C8222255bc855a974568Dd4")
Chain.Base -> Address("0x678Aa4bF4E210cf2166753e054d5b7c31cc7fa86")
Chain.Ethereum,
Chain.Base -> Address("0x2a114a012A75A267b80a8a3c5FB26B32E86c32bA")
Chain.ZkSync -> Address("0xf8b59f3c3Ab33200ec80a8A58b2aA5F5D2a8944C")

else -> throw IllegalStateException("Not supported PancakeSwap chain ${chain}")
Expand All @@ -50,7 +50,10 @@ class SwapRouter(private val dexType: DexType) {
}

val ethValue = when {
tradeData.tokenIn.isEther -> tradeData.trade.amountIn
tradeData.tokenIn.isEther -> when (tradeData.tradeType) {
TradeType.ExactIn -> tradeData.amountIn
TradeType.ExactOut -> tradeData.amountInMaximum
}
else -> BigInteger.ZERO
}

Expand Down
Loading