Skip to content

Commit

Permalink
add liquidity scrapers for univ2 and univ3 on base.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Sep 23, 2024
1 parent 0c909bd commit b504c30
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/liquidityScraper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/diadata-org/diadata/liquidityScraper
go 1.20

require (
github.com/diadata-org/diadata v1.4.522
github.com/diadata-org/diadata v1.4.535
github.com/sirupsen/logrus v1.9.3
)

Expand Down
12 changes: 12 additions & 0 deletions config/liquidity-scrapers/uniswapv2/UniswapBase.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"
}
]
}
4 changes: 4 additions & 0 deletions pkg/dia/scraper/liquidity-scrapers/ScraperInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func NewLiquidityScraper(source string, relDB *models.RelDB, datastore *models.D
switch source {
case dia.UniswapExchange:
return NewUniswapScraper(exchanges[dia.UniswapExchange], relDB, datastore)
case dia.UniswapExchangeBase:
return NewUniswapScraper(exchanges[dia.UniswapExchangeBase], relDB, datastore)
case dia.SushiSwapExchange:
return NewUniswapScraper(exchanges[dia.SushiSwapExchange], relDB, datastore)
case dia.SushiSwapExchangePolygon:
Expand Down Expand Up @@ -139,6 +141,8 @@ func NewLiquidityScraper(source string, relDB *models.RelDB, datastore *models.D
return NewUniswapV3Scraper(exchanges[dia.UniswapExchangeV3Polygon], relDB, datastore)
case dia.UniswapExchangeV3Arbitrum:
return NewUniswapV3Scraper(exchanges[dia.UniswapExchangeV3Arbitrum], relDB, datastore)
case dia.UniswapExchangeV3Base:
return NewUniswapV3Scraper(exchanges[dia.UniswapExchangeV3Base], relDB, datastore)

case dia.BancorExchange:
return NewBancorPoolScraper(exchanges[dia.BancorExchange], datastore)
Expand Down
3 changes: 3 additions & 0 deletions pkg/dia/scraper/liquidity-scrapers/UniswapV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type UniswapPair struct {

const (
restDialEthereum = ""
restDialBase = ""
restDialBSC = ""
restDialPolygon = ""
restDialCelo = ""
Expand Down Expand Up @@ -87,6 +88,8 @@ func NewUniswapScraper(exchange dia.Exchange, relDB *models.RelDB, datastore *mo
switch exchange.Name {
case dia.UniswapExchange:
us = makeUniswapPoolScraper(exchange, pathToPools, restDialEthereum, relDB, datastore, uniswapWaitMilliseconds)
case dia.UniswapExchangeBase:
us = makeUniswapPoolScraper(exchange, pathToPools, restDialBase, relDB, datastore, uniswapWaitMilliseconds)
case dia.SushiSwapExchange:
us = makeUniswapPoolScraper(exchange, pathToPools, restDialEthereum, relDB, datastore, sushiswapWaitMilliseconds)
case dia.SushiSwapExchangePolygon:
Expand Down
2 changes: 2 additions & 0 deletions pkg/dia/scraper/liquidity-scrapers/UniswapV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func NewUniswapV3Scraper(exchange dia.Exchange, relDB *models.RelDB, datastore *
switch exchange.Name {
case dia.UniswapExchangeV3:
uls = makeUniswapV3Scraper(exchange, "", "", relDB, datastore, "200", uint64(12369621))
case dia.UniswapExchangeV3Base:
uls = makeUniswapV3Scraper(exchange, "", "", relDB, datastore, "200", uint64(1371680))
case dia.UniswapExchangeV3Polygon:
uls = makeUniswapV3Scraper(exchange, "", "", relDB, datastore, "200", uint64(22757913))
case dia.UniswapExchangeV3Arbitrum:
Expand Down

0 comments on commit b504c30

Please sign in to comment.