From d4c5c5d5521f2357e03da3d1d3a69abb46e5345d Mon Sep 17 00:00:00 2001 From: jppade Date: Mon, 23 Sep 2024 16:18:00 +0200 Subject: [PATCH] add univ2 and univ3 trades scraper on base chain. --- .../Uniswap-BaseQuotetoken.json | 8 +++++++ .../uniswap/subscribe_pools/Uniswap-Base.json | 12 +++++++++++ .../UniswapV3-BaseQuotetoken.json | 8 +++++++ .../subscribe_pools/UniswapV3-Base.json | 21 +++++++++++++++++++ .../scraper/exchange-scrapers/APIScraper.go | 4 ++++ .../exchange-scrapers/UniswapV2Scraper.go | 5 +++++ .../exchange-scrapers/UniswapV3Scraper.go | 2 ++ 7 files changed, 60 insertions(+) create mode 100644 config/uniswap/reverse_tokens/Uniswap-BaseQuotetoken.json create mode 100644 config/uniswap/subscribe_pools/Uniswap-Base.json create mode 100644 config/uniswapv3/reverse_tokens/UniswapV3-BaseQuotetoken.json create mode 100644 config/uniswapv3/subscribe_pools/UniswapV3-Base.json diff --git a/config/uniswap/reverse_tokens/Uniswap-BaseQuotetoken.json b/config/uniswap/reverse_tokens/Uniswap-BaseQuotetoken.json new file mode 100644 index 000000000..6eeaf35e9 --- /dev/null +++ b/config/uniswap/reverse_tokens/Uniswap-BaseQuotetoken.json @@ -0,0 +1,8 @@ +{ + "Tokens": [ + { + "Address": "0x4200000000000000000000000000000000000006", + "Symbol": "WETH" + } + ] +} \ No newline at end of file diff --git a/config/uniswap/subscribe_pools/Uniswap-Base.json b/config/uniswap/subscribe_pools/Uniswap-Base.json new file mode 100644 index 000000000..6e4f438d1 --- /dev/null +++ b/config/uniswap/subscribe_pools/Uniswap-Base.json @@ -0,0 +1,12 @@ +{ + "Pools": [ + { + "Address": "0x16905890A1D02b6F824387419319Bf4188B961b0", + "ForeignName": "WETH-BENJI" + }, + { + "Address": "0x17A3Ad8c74c4947005aFEDa9965305ae2EB2518a", + "ForeignName": "WETH-MIGGLES" + } + ] +} \ No newline at end of file diff --git a/config/uniswapv3/reverse_tokens/UniswapV3-BaseQuotetoken.json b/config/uniswapv3/reverse_tokens/UniswapV3-BaseQuotetoken.json new file mode 100644 index 000000000..6eeaf35e9 --- /dev/null +++ b/config/uniswapv3/reverse_tokens/UniswapV3-BaseQuotetoken.json @@ -0,0 +1,8 @@ +{ + "Tokens": [ + { + "Address": "0x4200000000000000000000000000000000000006", + "Symbol": "WETH" + } + ] +} \ No newline at end of file diff --git a/config/uniswapv3/subscribe_pools/UniswapV3-Base.json b/config/uniswapv3/subscribe_pools/UniswapV3-Base.json new file mode 100644 index 000000000..c21f5884e --- /dev/null +++ b/config/uniswapv3/subscribe_pools/UniswapV3-Base.json @@ -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" + } + + ] +} \ No newline at end of file diff --git a/pkg/dia/scraper/exchange-scrapers/APIScraper.go b/pkg/dia/scraper/exchange-scrapers/APIScraper.go index b4ab26f90..9ca577058 100644 --- a/pkg/dia/scraper/exchange-scrapers/APIScraper.go +++ b/pkg/dia/scraper/exchange-scrapers/APIScraper.go @@ -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: @@ -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: diff --git a/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go b/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go index d20ffa5fc..bdba9dc97 100644 --- a/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go +++ b/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go @@ -38,6 +38,9 @@ const ( restDialEth = "" wsDialEth = "" + restDialBase = "" + wsDialBase = "" + restDialBSC = "" wsDialBSC = "" @@ -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: diff --git a/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go b/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go index 445934e3f..11251dbdf 100644 --- a/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go +++ b/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go @@ -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: