Skip to content

Commit

Permalink
blacklist corrupted curve pools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jppade committed Aug 7, 2023
1 parent e657782 commit b8d02ab
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 1 deletion.
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.17

require (
github.com/diadata-org/diadata v1.4.317
github.com/diadata-org/diadata v1.4.322
github.com/segmentio/kafka-go v0.4.35
github.com/sirupsen/logrus v1.9.0
)
Expand Down
28 changes: 28 additions & 0 deletions config/curve/blacklist_pools/Curvefi-Arbitrum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"Pools": [
{
"Address": "0x316d06Dd6644AD630C73cD3A6a2c7AE0D22f939e"
},
{
"Address": "0x7DA64233Fefb352f8F501B357c018158ED8aA455"
},
{
"Address": "0x89287c32c2cac1c76227f6d300b2dbbab6b75c08"
},
{
"Address": "0x960ea3e3C7FB317332d990873d354E18d7645590"
},
{
"Address": "0x9cA6c4Bcfdf5580eA5e1e57aF4F921ad838b8316"
},
{
"Address": "0xAAe75FAebCae43b9d541Fd875622BE48D9B4f5D0"
},
{
"Address": "0xd4F94D0aaa640BBb72b5EEc2D85F6D114D81a88E"
},
{
"Address": "0xf9b1f177e883b90ffa64e50db29b7f74a17c9161"
}
]
}
25 changes: 25 additions & 0 deletions config/curve/blacklist_pools/Curvefi-Fantom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Pools": [
{
"Address": "0x2B039565B2b7a1A9192D4847fbd33B25b836B950"
},
{
"Address": "0x3a1659Ddcf2339Be3aeA159cA010979FB49155FF"
},
{
"Address": "0x5d58Eb45e97B43e471AF05cD2b11CeB4106E1b1a"
},
{
"Address": "0x74E25054e98fd3FCd4bbB13A962B43E49098586f"
},
{
"Address": "0xb11dc44a9f981faf1669dca6dd40c3cc2554a2ce"
},
{
"Address": "0xe6358f6a45b502477e83cc1cda759f540e4459ee"
},
{
"Address": "0xffbACcE0CC7C19d46132f1258FC16CF6871D153c"
}
]
}
7 changes: 7 additions & 0 deletions config/curve/blacklist_pools/Curvefi-Moonbeam.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Pools": [
{
"Address": "0x3eF6A01A0f81D6046290f3e2A8c5b843e738E604"
}
]
}
34 changes: 34 additions & 0 deletions config/curve/blacklist_pools/Curvefi-Polygon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"Pools": [
{
"Address": "0x008e1abb5d58dbdfd00b22180ecd0ee490420b9b"
},
{
"Address": "0x04aAB3e45Aa6De7783D67FCfB21Bccf2401Ca31D"
},
{
"Address": "0x2Fccb6a7e353c15156b951885CFbC1558f2c5272"
},
{
"Address": "0x774D1Dba98cfBD1F2Bc3A1F59c494125e07C48F9"
},
{
"Address": "0x7c5c946380b75a4c55e13881181b15d752ff3da5"
},
{
"Address": "0xF52e46bEE287aAef56Fb2F8af961d9f1406cF476"
},
{
"Address": "0xa9134fae98f92217f457918505375ae91fdc5e3c"
},
{
"Address": "0xae00f57663f4c85fc948b13963cd4627daf01061"
},
{
"Address": "0xd6930b7f661257da36f93160149b031735237594"
},
{
"Address": "0xf31bcdf0b9a5ecd7ab463eb905551fbc32e51856"
}
]
}
43 changes: 43 additions & 0 deletions config/curve/blacklist_pools/Curvefi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"Pools": [
{
"Address": "0x01b36Ff7d81b84487d5659c7857cBa8B4BB62cA1"
},
{
"Address": "0x0f7cd0e51ec3a904cee55098f68ea0c1cb2596dc"
},
{
"Address": "0x466c8fa3a6cd4625517594786013262a6abd3f96"
},
{
"Address": "0x6326DEbBAa15bCFE603d831e7D75f4fc10d9B43E"
},
{
"Address": "0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511"
},
{
"Address": "0x88855cdF2b0A8413D470B86952E726684de915be"
},
{
"Address": "0x8c1aB78601c259E1B43F19816923609dC7d7de9B"
},
{
"Address": "0xFe625167BD77C6A520e093C4d2d065355a1e2E93"
},
{
"Address": "0xaAD072E917D97011EB3D7e7bce953BDE9227c21E"
},
{
"Address": "0xc64F268BD8075B3222A508d7869E9C600bE7c47F"
},
{
"Address": "0xde14B4a4A83dB5e506A62f06079ED3E85862A06B"
},
{
"Address": "0xefD2fCa091e4bA762A7dd7f0F3FBEF8075A7ca12"
},
{
"Address": "0xf8b8db73db0c3f4ff0d633836e939db23847ca1e"
}
]
}
14 changes: 14 additions & 0 deletions pkg/dia/scraper/exchange-scrapers/CurvefiScraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,22 @@ func (scraper *CurveFIScraper) loadPools(liquidityThreshold float64, liquidityTh
log.Fatal("fetch pools: ", err)
}
log.Infof("found %v pools to subscribe: ", len(pools))

blacklistedPools, err := getAddressesFromConfig("curve/blacklist_pools/" + scraper.exchangeName)
if err != nil {
log.Fatal("blacklisted pools: ", err)
}
var blacklistedPoolsString []string
for _, bp := range blacklistedPools {
blacklistedPoolsString = append(blacklistedPoolsString, bp.Hex())
}
log.Infof("remove %v blacklisted pools: %s", len(blacklistedPools), blacklistedPoolsString)

lowerBoundCount := 0
for _, pool := range pools {
if utils.Contains(&blacklistedPoolsString, pool.Address) {
continue
}

liquidity, lowerBound := pool.GetPoolLiquidityUSD()
// Discard pool if complete USD liquidity is below threshold.
Expand Down

0 comments on commit b8d02ab

Please sign in to comment.