Skip to content

Commit

Permalink
feat: include gyro pools that have a rate provider
Browse files Browse the repository at this point in the history
  • Loading branch information
gosuto-inzasheru committed Jan 30, 2024
1 parent 6f08112 commit 4cfff67
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
4 changes: 0 additions & 4 deletions config/core_pools_whitelist.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"mainnet": {
"0xxxx": "WHITELIST-ME",
"0xf7a826d47c8e02835d94fb0aa40f0cc9505cb1340002000000000000000005e0": "ECLP-wstETH-cbETH",
"0xf16aee6a71af1a9bc8f56975a4c2705ca7a782bc0002000000000000000004bb": "20WETH-80ALCX",
"0x8353157092ed8be69a9df8f95af097bbf33cb2af0000000000000000000005d9": "GHO/USDT/USDC",
"0x5f1f4e50ba51d723f12385a8a9606afc3a0555f5000200000000000000000465": "50wstETH-50LDO",
Expand All @@ -17,14 +16,11 @@
"0xb9debddf1d894c79d2b2d09f819ff9b856fca55200000000000000000000062a": "weETH-WETH"
},
"polygon": {
"0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49": "ECLP-WMATIC-stMATIC",
"0xee278d943584dd8640eaf4cc6c7a5c80c0073e85000200000000000000000bc7": "ECLP-WMATIC-MATICX",
"0x89b753153678bc434c610b7e9182297cada8ff29000000000000000000000c21": "stMATIC-WMATIC",
"0xdc31233e09f3bf5bfe5c10da2014677c23b6894c000000000000000000000c23": "wstETH-WETH"
},
"zkevm": {
"0x65da876a95cd5b6a5880710628c436409b1b29fa00000000000000000000005b": "ankrETH-wstETH",
"0xb1557cfea06de5a1601a7f0ccf3b515ef431a50d000200000000000000000059": "ECLP-wETH-rETH",
"0xdf725fde6e89981fb30d9bf999841ac2c160b512000000000000000000000010": "wstETH/rETH"
},
"arbitrum": {
Expand Down
20 changes: 14 additions & 6 deletions gen_core_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@

def get_pools_with_rate_provider(chain: str = None):
"""
for every chain, query the official balancer subgraph and retrieve pools that:
for every chain, query the official balancer subgraph and retrieve pools that meets
all three of the following conditions:
- have a rate provider different from address(0)
- have a liquidity greater than $250k
- have a yield fee > 0
- either:
- have a yield fee > 0
- be a meta stable pool with swap fee > 0
- be a gyro pool
"""
core_pools = {}
if chain:
Expand Down Expand Up @@ -42,7 +46,8 @@ def get_pools_with_rate_provider(chain: str = None):
{ swapFee_gt: 0 },
{ poolType_contains: "MetaStable" },
{ poolTypeVersion: 1 }
] }
] },
{ poolType_contains_nocase: "Gyro" },
] }
]
}
Expand All @@ -63,6 +68,9 @@ def get_pools_with_rate_provider(chain: str = None):


def has_alive_preferential_gauge(chain: str, pool_id: str) -> bool:
"""
return True if the pool has a preferential gauge which is not killed
"""
url = get_subgraph_url(chain, "gauges")
query = f"""{{
liquidityGauges(
Expand All @@ -89,11 +97,11 @@ def has_alive_preferential_gauge(chain: str, pool_id: str) -> bool:

def build_core_pools(chain: str = None):
"""
chain string format is the same as in extras/chains.json
note: chain string format is the same as in extras/chains.json
"""
core_pools = get_pools_with_rate_provider(chain)

# filter out pools without an alive preferential gauge
# make sure the pools have an alive preferential gauge
for chain in core_pools:
for pool_id in list(core_pools[chain]):
if not has_alive_preferential_gauge(chain, pool_id):
Expand Down Expand Up @@ -132,7 +140,7 @@ def is_core_pool(chain: str, pool_id: str) -> bool:
params:
chain: string format is the same as in extras/chains.json
pool_id: this is the long version of a pool id, so contract address + addition
pool_id: this is the long version of a pool id, so contract address + suffix
"""
core_pools = build_core_pools(chain)
return pool_id in core_pools[chain]
Expand Down
10 changes: 6 additions & 4 deletions outputs/core_pools.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"mainnet": {
"0x05ff47afada98a98982113758878f9a8b9fdda0a000000000000000000000645": "weETH/rETH",
"0x1cce5169bde03f3d5ad0206f6bd057953539dae600020000000000000000062b": "ECLP-GYD-sDAI",
"0x1e19cf2d73a72ef1332c882f20534b6519be0276000200000000000000000112": "B-rETH-STABLE",
"0x2e848426aec6dbf2260535a5bea048ed94d9ff3d000000000000000000000536": "wbETH-wstETH",
"0x36be1e97ea98ab43b4debf92742517266f5731a3000200000000000000000466": "50wstETH-50ACX",
Expand All @@ -13,27 +14,27 @@
"0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd0000000000000000000005c2": "wstETH-WETH-BPT",
"0x9f9d900462492d4c21e9523ca95a7cd86142f298000200000000000000000462": "50rETH-50RPL",
"0xb08885e6026bab4333a80024ec25a1a3e1ff2b8a000200000000000000000445": "B-staFiETH-WETH-Stable",
"0xb3b675a9a3cb0df8f66caf08549371bfb76a9867000200000000000000000611": "ECLP-mevETH-wETH",
"0xdfe6e7e18f6cc65fa13c8d8966013d4fda74b6ba000000000000000000000558": "ankrETH/wstETH",
"0xe7e2c68d3b13d905bbb636709cf4dfd21076b9d20000000000000000000005ca": "swETH-WETH-BPT",
"0xf01b0684c98cd7ada480bfdf6e43876422fa1fc10002000000000000000005de": "ECLP-wstETH-wETH",
"0xf7a826d47c8e02835d94fb0aa40f0cc9505cb1340002000000000000000005e0": "ECLP-wstETH-cbETH",
"0xf16aee6a71af1a9bc8f56975a4c2705ca7a782bc0002000000000000000004bb": "20WETH-80ALCX",
"0x8353157092ed8be69a9df8f95af097bbf33cb2af0000000000000000000005d9": "GHO/USDT/USDC",
"0x5f1f4e50ba51d723f12385a8a9606afc3a0555f5000200000000000000000465": "50wstETH-50LDO",
"0x1ee442b5326009bb18f2f472d3e0061513d1a0ff000200000000000000000464": "50rETH-50BADGER",
"0x3ff3a210e57cfe679d9ad1e9ba6453a716c56a2e0002000000000000000005d5": "STG/USDC",
"0xf01b0684c98cd7ada480bfdf6e43876422fa1fc10002000000000000000005de": "ECLP-wstETH-wETH",
"0x37b18b10ce5635a84834b26095a0ae5639dcb7520000000000000000000005cb": "ETHx-WETH",
"0x127ecc2318d002664cc4515c9f2b22b09b6aea85000200000000000000000602": "ECLP-swETH-wstETH",
"0xcf7b51ce5755513d4be016b0e28d6edeffa1d52a000200000000000000000617": "80RDNT-20wETH",
"0xb3b675a9a3cb0df8f66caf08549371bfb76a9867000200000000000000000611": "ECLP-mevETH-wETH",
"0x58b645fa247b60f2cb896991fd8956146c9fcb4a00020000000000000000061d": "80mevETH-20FOLD",
"0x35c5c8c7b77942f9d44b535fa590d8b503b2b00c00000000000000000000060d": "sDAI-DUSD",
"0xb9debddf1d894c79d2b2d09f819ff9b856fca55200000000000000000000062a": "weETH-WETH"
},
"polygon": {
"0xcd78a20c597e367a4e478a2411ceb790604d7c8f000000000000000000000c22": "maticX-WMATIC-BPT",
"0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49": "ECLP-WMATIC-stMATIC",
"0xee278d943584dd8640eaf4cc6c7a5c80c0073e85000200000000000000000bc7": "ECLP-WMATIC-MATICX",
"0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49": "ECLP-WMATIC-stMATIC",
"0x89b753153678bc434c610b7e9182297cada8ff29000000000000000000000c21": "stMATIC-WMATIC",
"0xdc31233e09f3bf5bfe5c10da2014677c23b6894c000000000000000000000c23": "wstETH-WETH"
},
Expand All @@ -59,6 +60,7 @@
"0x4fd63966879300cafafbb35d157dc5229278ed2300020000000000000000002b": "BPT-rETH-ETH",
"0x5f8893506ddc4c271837187d14a9c87964a074dc000000000000000000000106": "bpt-ethtri",
"0x7b50775383d3d6f0215a8f290f2c9e2eebbeceb200020000000000000000008b": "BPT-WSTETH-WETH",
"0x7ca75bdea9dede97f8b13c6641b768650cb837820002000000000000000000d5": "ECLP-wstETH-WETH",
"0xa71021492a3966eec735ed1b505afa097c7cfe6f00000000000000000000010d": "frxETH/sfrxETH"
},
"gnosis": {
Expand All @@ -69,9 +71,9 @@
},
"zkevm": {
"0x1d0a8a31cdb04efac3153237526fb15cc65a252000000000000000000000000f": "B-rETH-STABLE",
"0xb1557cfea06de5a1601a7f0ccf3b515ef431a50d000200000000000000000059": "ECLP-wETH-rETH",
"0xe1f2c039a68a216de6dd427be6c60decf405762a00000000000000000000000e": "B-wstETH-STABLE",
"0x65da876a95cd5b6a5880710628c436409b1b29fa00000000000000000000005b": "ankrETH-wstETH",
"0xb1557cfea06de5a1601a7f0ccf3b515ef431a50d000200000000000000000059": "ECLP-wETH-rETH",
"0xdf725fde6e89981fb30d9bf999841ac2c160b512000000000000000000000010": "wstETH/rETH"
},
"avalanche": {
Expand Down

0 comments on commit 4cfff67

Please sign in to comment.