Skip to content

Commit

Permalink
add univ2 and univ3 trades scraper on base chain.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Sep 23, 2024
1 parent 2b56d1f commit d4c5c5d
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/uniswap/reverse_tokens/Uniswap-BaseQuotetoken.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Tokens": [
{
"Address": "0x4200000000000000000000000000000000000006",
"Symbol": "WETH"
}
]
}
12 changes: 12 additions & 0 deletions config/uniswap/subscribe_pools/Uniswap-Base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Pools": [
{
"Address": "0x16905890A1D02b6F824387419319Bf4188B961b0",
"ForeignName": "WETH-BENJI"
},
{
"Address": "0x17A3Ad8c74c4947005aFEDa9965305ae2EB2518a",
"ForeignName": "WETH-MIGGLES"
}
]
}
8 changes: 8 additions & 0 deletions config/uniswapv3/reverse_tokens/UniswapV3-BaseQuotetoken.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Tokens": [
{
"Address": "0x4200000000000000000000000000000000000006",
"Symbol": "WETH"
}
]
}
21 changes: 21 additions & 0 deletions config/uniswapv3/subscribe_pools/UniswapV3-Base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Pools": [
{
"Address": "0x4b0Aaf3EBb163dd45F663b38b6d93f6093EBC2d3",
"ForeignName": "WETH-TOSHI"
},
{
"Address": "0xadAd4ce0C68F50A19CF5063E0B91d701Daab1df1",
"ForeignName": "WETH-MIGGLES"
},
{
"Address": "0x3d5D143381916280ff91407FeBEB52f2b60f33Cf",
"ForeignName": "WETH-AERO"
},
{
"Address": "0xc9034c3E7F58003E6ae0C8438e7c8f4598d5ACAA",
"ForeignName": "WETH-DEGEN"
}

]
}
4 changes: 4 additions & 0 deletions pkg/dia/scraper/exchange-scrapers/APIScraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ func NewAPIScraper(exchange string, scrape bool, key string, secret string, relD
return NewBancorScraper(Exchanges[dia.BancorExchange], scrape)
case dia.UniswapExchange:
return NewUniswapScraper(Exchanges[dia.UniswapExchange], scrape, relDB)
case dia.UniswapExchangeBase:
return NewUniswapScraper(Exchanges[dia.UniswapExchangeBase], scrape, relDB)
case dia.PanCakeSwap:
return NewUniswapScraper(Exchanges[dia.PanCakeSwap], scrape, relDB)
case dia.PanCakeSwapExchangeV3:
Expand Down Expand Up @@ -189,6 +191,8 @@ func NewAPIScraper(exchange string, scrape bool, key string, secret string, relD
return NewBKEXScraper(Exchanges[dia.BKEXExchange], dia.BKEX2Exchange, scrape, relDB)
case dia.UniswapExchangeV3:
return NewUniswapV3Scraper(Exchanges[dia.UniswapExchangeV3], scrape, relDB)
case dia.UniswapExchangeV3Base:
return NewUniswapV3Scraper(Exchanges[dia.UniswapExchangeV3Base], scrape, relDB)
case dia.DfynNetwork:
return NewUniswapScraper(Exchanges[dia.DfynNetwork], scrape, relDB)
case dia.UbeswapExchange:
Expand Down
5 changes: 5 additions & 0 deletions pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const (
restDialEth = ""
wsDialEth = ""

restDialBase = ""
wsDialBase = ""

restDialBSC = ""
wsDialBSC = ""

Expand Down Expand Up @@ -174,6 +177,8 @@ func NewUniswapScraper(exchange dia.Exchange, scrape bool, relDB *models.RelDB)
switch exchange.Name {
case dia.UniswapExchange:
s = makeUniswapScraper(exchange, listenByAddress, fetchPoolsFromDB, restDialEth, wsDialEth, uniswapWaitMilliseconds)
case dia.UniswapExchangeBase:
s = makeUniswapScraper(exchange, listenByAddress, fetchPoolsFromDB, restDialBase, wsDialBase, uniswapWaitMilliseconds)
case dia.SushiSwapExchange:
s = makeUniswapScraper(exchange, listenByAddress, fetchPoolsFromDB, restDialEth, wsDialEth, sushiswapWaitMilliseconds)
case dia.SushiSwapExchangePolygon:
Expand Down
2 changes: 2 additions & 0 deletions pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func NewUniswapV3Scraper(exchange dia.Exchange, scrape bool, relDB *models.RelDB
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "200", uint64(22757913))
case dia.UniswapExchangeV3Arbitrum:
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "200", uint64(165))
case dia.UniswapExchangeV3Base:
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "200", uint64(1371680))
case dia.PanCakeSwapExchangeV3:
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "200", uint64(26956207))
case dia.CamelotExchangeV3:
Expand Down

0 comments on commit d4c5c5d

Please sign in to comment.