Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build core pools with apiv3 as only source #73

Merged
merged 11 commits into from
Jan 28, 2025
Merged

Conversation

gosuto-inzasheru
Copy link
Collaborator

@gosuto-inzasheru gosuto-inzasheru commented Jan 24, 2025

closes #72 and closes #39

@gosuto-inzasheru gosuto-inzasheru changed the title Issue/72 feat: build core pools with apiv3 as only source Jan 24, 2025
@gosuto-inzasheru
Copy link
Collaborator Author

blocked by balancer/backend#1519

@gosuto-inzasheru
Copy link
Collaborator Author

this is good to go, just need twap test fixed first

@gosuto-inzasheru gosuto-inzasheru marked this pull request as ready for review January 28, 2025 13:30
@jalbrekt85
Copy link
Collaborator

jalbrekt85 commented Jan 28, 2025

@gosuto-inzasheru i added a temp check to the twap price tests that makes sure the timestamps are less than 100 days old or will be skipped. the fact that the stable pools are <0.01% price diff and the non stable ones are off by a consistent amount means that the twap price function is working fine and just an issue with stale test data. can implement a full solution in #75

lets get this merged in the meantime so that BalancerMaxis/protocol_fee_allocator#337 isnt being blocked. reviewing now...

Comment on lines +374 to +379
if (
pool_token["priceRateProviderData"].get("address")
!= ZERO_ADDRESS
):
# pools with a non zero rate provider are core pools
core_pools.append(pool)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt the check be for at least for half of tokens to have rate provider based on BIP-734?

Minimum 50% yield-bearing or boosted tokens for pool types such as weighted or composable stable pools

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea that is true. in the previous direct subgraph implementation calcing this was practically impossible

i think the apiv3 would make it a lot easier now, but we are also not getting any false positives because of not having it (yet)

created a ticket for it so we can handle it later when it matter/there is more time: #76

@jalbrekt85
Copy link
Collaborator

here is what the core pool list looks like now based on this branch:
@gosuto-inzasheru does it still make sense for all of these new gnosis pools to show up?

{
  "mainnet": {
    "0x05ff47afada98a98982113758878f9a8b9fdda0a000000000000000000000645": "weETH/rETH",
    "0x10a04efba5b880e169920fd4348527c64fb29d4d": "B-csUSDC-csUSDL",
    "0x121edb0badc036f5fc610d015ee14093c142313b": "rstETH-Lido wstETH",
    "0x1cce5169bde03f3d5ad0206f6bd057953539dae600020000000000000000062b": "ECLP-GYD-sDAI",
    "0x1d13531bf6344c102280ce4c458781fbf14dad140000000000000000000006df": "tETH/wstETH",
    "0x1e19cf2d73a72ef1332c882f20534b6519be0276000200000000000000000112": "B-rETH-STABLE",
    "0x264062ca46a1322c2e6464471764089e01f22f1900000000000000000000066b": "sDOLA-DOLA BSP",
    "0x36be1e97ea98ab43b4debf92742517266f5731a3000200000000000000000466": "50wstETH-50ACX",
    "0x38fe2b73612527eff3c5ac3bf2dcb73784ad927400000000000000000000068c": "saETH/wstETH",
    "0x40c806394d03d350420d13cd7d1de1c806f349560000000000000000000005f5": "qETH/WETH",
    "0x41fdbea2e52790c0a1dc374f07b628741f2e062d0002000000000000000006be": "ECLP-stdeUSD-deUSD",
    "0x4216d5900a6109bba48418b5e2ab6cc4e61cf4770000000000000000000006a1": "trenSTETH",
    "0x42ed016f826165c2e5976fe5bc3df540c5ad0af700000000000000000000058b": "wstETH-rETH-sfrxETH-BPT",
    "0x47a4f5440ab097cf3ec7abeedf1afecc5749a4e200000000000000000000068d": "aETH/wstETH",
    "0x49cbd67651fbabce12d1df18499896ec87bef46f00000000000000000000064a": "sDAI/3Pool",
    "0x4ab7ab316d43345009b2140e0580b072eec7df16": "ETHx waWETH",
    "0x5512fddc40842b257e2a7742be3dadcf31574d53": "pxETH-gtWETHe",
    "0x57c23c58b1d8c3292c15becf07c62c5c52457a42": "osETH-waWETH",
    "0x596192bb6e41802428ac943d2f1476c1af25cc0e000000000000000000000659": "ezETH-WETH-BPT",
    "0x63e0d47a6964ad1565345da9bfa66659f4983f02000000000000000000000681": "pufETH/wstETH",
    "0x740a691bd31c4176bcb6b8a7a40f1a723537d99d0000000000000000000006b6": "cdcETH/wstETH",
    "0x848a5564158d84b8a8fb68ab5d004fae11619a5400000000000000000000066a": "weETH/ezETH/rswETH",
    "0x89bb794097234e5e930446c0cec0ea66b35d7570": "Aave USDC-USDT",
    "0x8d93b853849b9884e2bb413444ec23eb5366ee910002000000000000000006b3": "ECLP-sUSDe-GYD",
    "0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd0000000000000000000005c2": "wstETH-WETH-BPT",
    "0x9f9d900462492d4c21e9523ca95a7cd86142f298000200000000000000000462": "50rETH-50RPL",
    "0xb819feef8f0fcdc268afe14162983a69f6bf179e000000000000000000000689": "sUSDe/USDC",
    "0xb91159aa527d4769cb9faf3e4adb760c7e8c8ea700000000000000000000067c": "ETHx/wstETH",
    "0xc1d48bb722a22cc6abf19facbe27470f08b3db8c": "waUSDe-waUSDT",
    "0xc4ce391d82d164c166df9c8336ddf84206b2f812": "Aave Lido wETH-wstETH",
    "0xda17f3663c5d04c0b316cfa1a04aa53ebbc8c12c0000000000000000000006e7": "eBTC/wBTC",
    "0xdd59f89b5b07b7844d72996fc9d83d81acc8219600000000000000000000059e": "uniETH-WETH",
    "0xdfe6e7e18f6cc65fa13c8d8966013d4fda74b6ba000000000000000000000558": "ankrETH/wstETH",
    "0xf16aee6a71af1a9bc8f56975a4c2705ca7a782bc0002000000000000000004bb": "20WETH-80ALCX",
    "0x8353157092ed8be69a9df8f95af097bbf33cb2af0000000000000000000005d9": "GHO/USDT/USDC",
    "0x3ff3a210e57cfe679d9ad1e9ba6453a716c56a2e0002000000000000000005d5": "STG/USDC",
    "0xcf7b51ce5755513d4be016b0e28d6edeffa1d52a000200000000000000000617": "80RDNT-20wETH",
    "0xff42a9af956617e4c3532ef2fc7567465efe4909000200000000000000000672": "50KEP/50rsETH"
  },
  "polygon": {
    "0xa8cbbffe0d62797afaf7af0a23810bd5ba39a4dd000200000000000000000f04": "ECLP-GYD-AUSDT",
    "0xcd78a20c597e367a4e478a2411ceb790604d7c8f000000000000000000000c22": "maticX-WMATIC-BPT",
    "0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49": "ECLP-WMATIC-stMATIC"
  },
  "arbitrum": {
    "0x125bc5a031b2db6733bfa35d914ffa428095978b000200000000000000000514": "ECLP-AUSDC-AUSDT",
    "0x2ce4457acac29da4736ae6f5cd9f583a6b335c270000000000000000000004dc": "sFRAX/4POOL",
    "0x2d6ced12420a9af5a83765a8c48be2afcd1a8feb000000000000000000000500": "cbETH/rETH/wstETH",
    "0x3fd4954a851ead144c2ff72b1f5a38ea5976bd54000000000000000000000480": "ankrETH/wstETH-BPT",
    "0x46472cba35e6800012aa9fcc7939ff07478c473e00020000000000000000056c": "ECLP-GHO-AUSDC",
    "0x65c2d90b33f7bf693a7ef54662435f2cf3251c210000000000000000000005e7": "tETH/wstETH",
    "0x6ce1d1e46548ef657f8d7ebddfc4beadb04f72f30002000000000000000005a1": "ECLP-wstETH-GYD",
    "0x6e822c64c00393b2078f2a5bb75c575ab505b55c000200000000000000000548": "ECLP-GYD-AUSDC",
    "0x7272163a931dac5bbe1cb5fefaf959bb65f7346f000200000000000000000549": "ECLP-GYD-AUSDT",
    "0x7967fa58b9501600d96bd843173b9334983ee6e600020000000000000000056e": "ECLP-wstETH-WETH",
    "0x7b54c44fbe6db6d97fd22b8756f89c0af16202cc00000000000000000000053c": "ETHx/wstETH",
    "0x8d58755ca11d2c7273fed72aeb637e38a66c228c00000000000000000000058c": "sUSX/USDC",
    "0x90e6cb5249f5e1572afbf8a96d8a1ca6acffd73900000000000000000000055c": "rsETH/wETH",
    "0x9791d590788598535278552eecd4b211bfc790cb000000000000000000000498": "wstETH-WETH-BPT",
    "0xab297f94235de777b85024ed1208ff43852385d90000000000000000000005bb": "wUSDL/GHO",
    "0xb3047330c1cb5eb1a3670fabfb99bdc106d631eb0000000000000000000005e4": "sUSDX/USDX",
    "0xb61371ab661b1acec81c699854d2f911070c059e000000000000000000000516": "ezETH/wstETH",
    "0xc2598280bfea1fe18dfcabd21c7165c40c6859d30000000000000000000004f3": "wstETH/sfrxETH",
    "0xca8ecd05a289b1fbc2e0eaec07360c4bfec07b6100020000000000000000051d": "2CLP-AUSDC-USDC",
    "0xcdcef9765d369954a4a936064535710f7235110a000200000000000000000558": "ECLP-weETH-wstETH",
    "0xd0ec47c54ca5e20aaae4616c25c825c7f48d40690000000000000000000004ef": "rETH/wETH BPT",
    "0xdeeaf8b0a8cf26217261b813e085418c7dd8f1ee00020000000000000000058f": "ECLP-sUSDe-GYD",
    "0xef0c116a2818a5b1a5d836a291856a321f43c2fb00020000000000000000053a": "ECLP-WOETH-WETH",
    "0xf13758d6edd1937dcb3f4fe75889b579d400299a000000000000000000000595": "weETH/wETH",
    "0xff38cc0ce0de4476c5a3e78675b48420a851035b000200000000000000000593": "ECLP-GHO-GYD-rh",
    "0x423a1323c871abc9d89eb06855bf5347048fc4a5000000000000000000000496": "4POOL",
    "0x32df62dc3aed2cd6224193052ce665dc181658410002000000000000000003bd": "RDNT-WETH",
    "0x9f8ed1acfe0c863381b9081aff2144fc867aa7730002000000000000000004d4": "ANKR:ankrETH"
  },
  "gnosis": {
    "0x1e8b447129984d8a6b652c807dfc3bd1359731330002000000000000000000d6": "ECLP-GYD-sDAI",
    "0x263a6edafa6444dc2ae550f9eff6344c1686d6aa0002000000000000000000d5": "ECLP-GYD-AUSDC.e",
    "0x272d6be442e30d7c87390edeb9b96f1e84cecd8d": "50waWstETH-50waGNO",
    "0x6e6bb18449fcf15b79efa2cfa70acf7593088029": "waWstETH-waWETH",
    "0x71e1179c5e197fa551beec85ca2ef8693c61b85b0002000000000000000000a0": "ECLP-rETH-WETH",
    "0x8dd4df4ce580b9644437f3375e54f1ab0980822800020000000000000000009c": "ECLP-wstETH-WETH",
    "0xaa56989be5e6267fc579919576948db3e1f108070002000000000000000000ca": "ECLP-sDAI-USDC.e-rh",
    "0xbad20c15a773bf03ab973302f61fabcea5101f0a000000000000000000000034": "bb-WETH-wstETH",
    "0xd1d7fa8871d84d0e77020fc28b7cd5718c446522": "aGNO/sDAI"
  },
  "zkevm": {},
  "avalanche": {
    "0xc13546b97b9b1b15372368dc06529d7191081f5b00000000000000000000001d": "ggAVAX-WAVAX-BPT",
    "0xfd2620c9cfcec7d152467633b3b0ca338d3d78cc00000000000000000000001c": "sAVAX-WAVAX-BPT"
  },
  "base": {
    "0x54d86e177cdc664b5f9b17eb5fd6a76fa529e466000200000000000000000199": "ECLP-cbETH-wstETH",
    "0xab99a3e856deb448ed99713dfce62f937e2d4d74000000000000000000000118": "weETH/wETH",
    "0xc771c1a5905420daec317b154eb13e4198ba97d0000000000000000000000023": "rETH-WETH-BPT",
    "0x0c659734f1eef9c63b7ebdf78a164cdd745586db000000000000000000000046": "USDC/USDbC/axlUSDC"
  },
  "mode": {},
  "fraxtal": {
    "0x1570315476480fa80cec1fff07a20c1df1adfd53000200000000000000000009": "sFRAX/sfrxETH",
    "0x33251abecb0364df98a27a8d5d7b5ccddc774c42000000000000000000000008": "sFRAX/sDAI/sUSDe",
    "0xa0b92b33beafce388ce0092afdcd0ca77323eb12000000000000000000000006": "sFRAX/sDAI"
  }
}

@gosuto-inzasheru
Copy link
Collaborator Author

@jalbrekt85 yes that all looks good. i did a test run already and the output was reviewed by @Xeonus: BalancerMaxis/bal_addresses#588

all the (new) gnosis ones look good; they have the necessary tvl and have rate providers. im actually suspecting a bug in the old logic---not sure

Copy link
Collaborator

@jalbrekt85 jalbrekt85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, LGTM

@gosuto-inzasheru gosuto-inzasheru merged commit 5d3817f into main Jan 28, 2025
6 checks passed
@gosuto-inzasheru gosuto-inzasheru deleted the issue/72 branch January 28, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: consider v3 (boosted) pools for core pools feat: port build_core_pools to apiv3 query
2 participants