Skip to content

Commit

Permalink
feat: add more dex networks (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu authored Jan 9, 2025
1 parent 4397a02 commit 8eed441
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 9 deletions.
7 changes: 7 additions & 0 deletions internal/engine/worker/decentralized/contract/1inch/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ func (w *worker) Platform() string {
func (w *worker) Network() []network.Network {
return []network.Network{
network.Ethereum,
network.Arbitrum,
network.Optimism,
network.Polygon,
network.Base,
network.BinanceSmartChain,
network.Gnosis,
network.Avalanche,
}
}

Expand Down
6 changes: 6 additions & 0 deletions internal/engine/worker/decentralized/contract/aave/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (w *worker) Network() []network.Network {
network.Base,
network.Optimism,
network.Arbitrum,
network.Gnosis,
network.BinanceSmartChain,
}
}

Expand Down Expand Up @@ -92,6 +94,10 @@ func (w *worker) Filter() engine.DataSourceFilter {
aaveV3PoolAddress = aave.AddressV3PoolOthers
case network.Base:
aaveV3PoolAddress = aave.AddressV3PoolBase
case network.Gnosis:
aaveV3PoolAddress = aave.AddressV3PoolGnosis
case network.BinanceSmartChain:
aaveV3PoolAddress = aave.AddressV3PoolBinanceSmartChain
case network.Optimism, network.Arbitrum:
aaveV3PoolAddress = aave.AddressV3PoolOthers
default:
Expand Down
3 changes: 3 additions & 0 deletions internal/engine/worker/decentralized/contract/cow/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func (w *worker) Platform() string {
func (w *worker) Network() []network.Network {
return []network.Network{
network.Ethereum,
network.Arbitrum,
network.Base,
network.Gnosis,
}
}

Expand Down
3 changes: 3 additions & 0 deletions internal/engine/worker/decentralized/contract/curve/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ func (w *worker) Network() []network.Network {
network.Ethereum,
network.Arbitrum,
network.Avalanche,
network.Base,
network.BinanceSmartChain,
network.Gnosis,
network.Optimism,
network.Polygon,
network.XLayer,
}
}

Expand Down
11 changes: 11 additions & 0 deletions internal/engine/worker/decentralized/contract/paraswap/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func (w *worker) Platform() string {
func (w *worker) Network() []network.Network {
return []network.Network{
network.Ethereum,
network.Optimism,
network.BinanceSmartChain,
network.Avalanche,
network.Arbitrum,
network.Polygon,
network.Base,
}
}

Expand All @@ -64,6 +70,11 @@ func (w *worker) Filter() engine.DataSourceFilter {
LogAddresses: []common.Address{
paraswap.AddressV5ParaSwap,
paraswap.AddressV5ParaSwapBase,
paraswap.AddressV5ParaSwapBinanceSmartChain,
paraswap.AddressV5ParaSwapOptimism,
paraswap.AddressV5ParaSwapPolygon,
paraswap.AddressV5ParaSwapArbitrum,
paraswap.AddressV5ParaSwapAvalanche,
},
LogTopics: []common.Hash{
paraswap.EventHashV3Swapped,
Expand Down
21 changes: 21 additions & 0 deletions internal/node/component/info/network_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Aave,
decentralized.Arbitrum,
decentralized.Core,
decentralized.Cow,
decentralized.Curve,
decentralized.Highlight,
decentralized.Oneinch,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
Expand All @@ -338,6 +341,8 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Aave,
decentralized.Core,
decentralized.Curve,
decentralized.Oneinch,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
Expand All @@ -347,13 +352,21 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Aave,
decentralized.Base,
decentralized.Core,
decentralized.Cow,
decentralized.Curve,
decentralized.Oneinch,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
decentralized.Zerion,
},
network.BinanceSmartChain: {
decentralized.Aave,
decentralized.Core,
decentralized.Curve,
decentralized.Oneinch,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
Expand Down Expand Up @@ -390,8 +403,11 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Core,
},
network.Gnosis: {
decentralized.Aave,
decentralized.Core,
decentralized.Cow,
decentralized.Curve,
decentralized.Oneinch,
decentralized.Zerion,
},
network.Linea: {
Expand All @@ -417,7 +433,9 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Highlight,
decentralized.KiwiStand,
decentralized.Matters,
decentralized.Oneinch,
decentralized.Optimism,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
Expand All @@ -431,6 +449,8 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Highlight,
decentralized.IQWiki,
decentralized.Lens,
decentralized.Oneinch,
decentralized.Paraswap,
decentralized.Polymarket,
decentralized.Rainbow,
decentralized.Stargate,
Expand All @@ -450,6 +470,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
},
network.XLayer: {
decentralized.Core,
decentralized.Curve,
decentralized.Zerion,
},
}
Expand Down
16 changes: 9 additions & 7 deletions provider/ethereum/contract/aave/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import (
//go:generate go run --mod=mod github.com/ethereum/go-ethereum/cmd/abigen --abi ./abi/V3Pool.abi --pkg aave --type V3Pool --out contract_v3_pool.go

var (
AddressV1LendingPool = common.HexToAddress("0x398eC7346DcD622eDc5ae82352F02bE94C62d119")
AddressV2LendingPoolMainnet = common.HexToAddress("0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9")
AddressV2LendingPoolPolygon = common.HexToAddress("0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf")
AddressV2LendingPoolAvalanche = common.HexToAddress("0x4F01AeD16D97E3aB5ab2B501154DC9bb0F1A5A2C")
AddressV3PoolMainnet = common.HexToAddress("0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2")
AddressV3PoolBase = common.HexToAddress("0xA238Dd80C259a72e81d7e4664a9801593F98d1c5")
AddressV3PoolOthers = common.HexToAddress("0x794a61358D6845594F94dc1DB02A252b5b4814aD")
AddressV1LendingPool = common.HexToAddress("0x398eC7346DcD622eDc5ae82352F02bE94C62d119")
AddressV2LendingPoolMainnet = common.HexToAddress("0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9")
AddressV2LendingPoolPolygon = common.HexToAddress("0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf")
AddressV2LendingPoolAvalanche = common.HexToAddress("0x4F01AeD16D97E3aB5ab2B501154DC9bb0F1A5A2C")
AddressV3PoolMainnet = common.HexToAddress("0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2")
AddressV3PoolBase = common.HexToAddress("0xA238Dd80C259a72e81d7e4664a9801593F98d1c5")
AddressV3PoolGnosis = common.HexToAddress("0xb50201558B00496A145fE76f7424749556E326D8")
AddressV3PoolBinanceSmartChain = common.HexToAddress("0x6807dc923806fE8Fd134338EABCA509979a7e0cB")
AddressV3PoolOthers = common.HexToAddress("0x794a61358D6845594F94dc1DB02A252b5b4814aD")

EventHashV1LendingPoolDeposit = contract.EventHash("Deposit(address,address,uint256,uint16,uint256)")
EventHashV1LendingPoolBorrow = contract.EventHash("Borrow(address,address,uint256,uint256,uint256,uint256,uint256,uint16,uint256)")
Expand Down
9 changes: 7 additions & 2 deletions provider/ethereum/contract/paraswap/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ import (

// https://developers.paraswap.network/smart-contracts
var (
AddressV5ParaSwap = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapBase = common.HexToAddress("0x59C7C832e96D2568bea6db468C1aAdcbbDa08A52")
AddressV5ParaSwap = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapArbitrum = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapAvalanche = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapBase = common.HexToAddress("0x59C7C832e96D2568bea6db468C1aAdcbbDa08A52")
AddressV5ParaSwapBinanceSmartChain = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapOptimism = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")
AddressV5ParaSwapPolygon = common.HexToAddress("0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57")

AddressETH = common.HexToAddress("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE")

Expand Down

0 comments on commit 8eed441

Please sign in to comment.