Skip to content

Commit

Permalink
add scraper suite for velodrome slipstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Nov 26, 2024
1 parent 02b0410 commit 5c97ead
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/assetCollectionService/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/diadata-org/diadata/assetCollectionService
go 1.22

require (
github.com/diadata-org/diadata v1.4.557
github.com/diadata-org/diadata v1.4.560
github.com/sirupsen/logrus v1.9.3
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/assetCollectionService/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ func NewAssetScraper(exchange string, secret string, relDB *models.RelDB) source
return source.NewOsmosisScraper(exchanges[dia.OsmosisExchange])
case dia.VelodromeExchange:
return source.NewVelodromeAssetSource(exchanges[dia.VelodromeExchange], relDB)
case dia.VelodromeSlipstreamExchange:
return source.NewVelodromeAssetSource(exchanges[dia.VelodromeSlipstreamExchange], relDB)
case dia.TraderJoeExchangeV2_1:
return source.NewTraderJoeAssetSource(exchanges[dia.TraderJoeExchangeV2_1], relDB)
case dia.TraderJoeExchangeV2_1Arbitrum:
Expand Down
2 changes: 1 addition & 1 deletion cmd/exchange-scrapers/collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/diadata-org/diadata/exchange-scrapers/collector
go 1.22

require (
github.com/diadata-org/diadata v1.4.559
github.com/diadata-org/diadata v1.4.560
github.com/segmentio/kafka-go v0.4.35
github.com/sirupsen/logrus v1.9.3
)
Expand Down
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.22

require (
github.com/diadata-org/diadata v1.4.557
github.com/diadata-org/diadata v1.4.560
github.com/sirupsen/logrus v1.9.3
)

Expand Down
1 change: 1 addition & 0 deletions pkg/dia/Config.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const (
ZenlinkswapExchange = "Zenlink"
ZenlinkswapExchangeBifrostPolkadot = "Zenlink-bifrost-polkadot"
VelodromeExchange = "Velodrome"
VelodromeSlipstreamExchange = "VelodromeSlipstream"
MaverickExchange = "Maverick"
MaverickExchangeZKSync = "Maverick-zksync"
MaverickExchangeBNB = "Maverick-bnb"
Expand Down
2 changes: 2 additions & 0 deletions pkg/dia/scraper/exchange-scrapers/APIScraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ func NewAPIScraper(exchange string, scrape bool, key string, secret string, relD
return NewBitgetScraper(Exchanges[dia.BitgetExchange], scrape, relDB)
case dia.AerodromeSlipstreamExchange:
return NewUniswapV3Scraper(Exchanges[dia.AerodromeSlipstreamExchange], scrape, relDB)
case dia.VelodromeSlipstreamExchange:
return NewUniswapV3Scraper(Exchanges[dia.VelodromeSlipstreamExchange], scrape, relDB)
// case dia.FinageForex:
// return NewFinageForexScraper(Exchanges[dia.FinageForex], scrape, relDB, key, secret)

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 @@ -105,6 +105,8 @@ func NewUniswapV3Scraper(exchange dia.Exchange, scrape bool, relDB *models.RelDB
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "2000", uint64(1768866))
case dia.AerodromeSlipstreamExchange:
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "2000", uint64(0))
case dia.VelodromeSlipstreamExchange:
s = makeUniswapV3Scraper(exchange, listenByAddress, "", "", "2000", uint64(0))
}

s.relDB = relDB
Expand Down
2 changes: 2 additions & 0 deletions pkg/dia/scraper/liquidity-scrapers/ScraperInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ func NewLiquidityScraper(source string, relDB *models.RelDB, datastore *models.D
return NewPlatypusScraper(exchanges[dia.PlatypusExchange], datastore)
case dia.VelodromeExchange:
return NewVelodromePoolScraper(exchanges[dia.VelodromeExchange], relDB, datastore)
case dia.VelodromeSlipstreamExchange:
return NewVelodromePoolScraper(exchanges[dia.VelodromeSlipstreamExchange], relDB, datastore)
case dia.AerodromeV1Exchange:
return NewVelodromePoolScraper(exchanges[dia.AerodromeV1Exchange], relDB, datastore)
case dia.AerodromeSlipstreamExchange:
Expand Down
4 changes: 3 additions & 1 deletion pkg/dia/scraper/liquidity-scrapers/Velodrome.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func NewVelodromePoolScraper(exchange dia.Exchange, relDB *models.RelDB, datasto
switch exchange.Name {
case dia.VelodromeExchange:
us = makeVelodromePoolScraper(exchange, relDB, datastore, restDialOptimism, velodromeWaitMilliseconds)
case dia.VelodromeSlipstreamExchange:
us = makeVelodromePoolScraper(exchange, relDB, datastore, restDialOptimism, velodromeWaitMilliseconds)
case dia.AerodromeV1Exchange:
us = makeVelodromePoolScraper(exchange, relDB, datastore, restDialBase, velodromeWaitMilliseconds)
case dia.AerodromeSlipstreamExchange:
Expand Down Expand Up @@ -170,7 +172,7 @@ func (us *VelodromePoolScraper) GetPoolByAddress(pairAddress common.Address) (po
}
}

if us.exchange.Name == dia.AerodromeSlipstreamExchange {
if us.exchange.Name == dia.AerodromeSlipstreamExchange || us.exchange.Name == dia.VelodromeSlipstreamExchange {
us.GetLiquidityUniV3Type(token0, token1, pairAddress, &pool)
} else {
us.GetLiquidityUniV2Type(token0, token1, pairContract, &pool)
Expand Down
2 changes: 2 additions & 0 deletions pkg/dia/service/assetservice/source/velodrome.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ func NewVelodromeAssetSource(exchange dia.Exchange, relDB *models.RelDB) (uas *V
switch exchange.Name {
case dia.VelodromeExchange:
uas = makeVelodromeAssetSource(exchange, restDialOptimism, relDB, velodromeWaitMilliseconds)
case dia.VelodromeSlipstreamExchange:
uas = makeVelodromeAssetSource(exchange, restDialOptimism, relDB, velodromeWaitMilliseconds)
case dia.AerodromeSlipstreamExchange:
uas = makeVelodromeAssetSource(exchange, restDialBase, relDB, velodromeWaitMilliseconds)
case dia.AerodromeV1Exchange:
Expand Down

0 comments on commit 5c97ead

Please sign in to comment.