-
Notifications
You must be signed in to change notification settings - Fork 71
Implement sugar-sdk pool snapshot data pull #1393
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
base: main
Are you sure you want to change the base?
Conversation
We can try more Chain IDs as well: https://github.com/velodrome-finance/sugar-sdk?tab=readme-ov-file#configuration We store the OP Chain chain IDs in the chain metadata file (however is best to pull that). Not all will have Velodrome implementations. Also want to validate if we can pull things like votes, fees, etc before merging - since it's most valuable to have the full suite of metrics that you can pull from the UI (preferably at a token level for rewards and tvl). |
Howdy. We've just added some more pool stats. This matches what velo/aerodrome display on liquidity screens. Do let us know what other stats you might need. And thank you for your patience since all this is very much WIP at the moment |
this will break your current setup since async chains must be prefixed with Async* now (e.g. OPChain became AsyncOpChain, its sync version is now called OpChain) |
Thank you for flagging @callmephilip , we will review the new docs and reimplement. |
@@ -120,7 +113,7 @@ async def _sugar_pools(chain: str, sugar_chain: Chain) -> VelodromePools: | |||
lps = [] | |||
missing = [] | |||
for pool in pools: | |||
lp = LiquidityPool.from_tuple(pool, tokens_index) | |||
lp = LiquidityPool.from_tuple(pool, tokens_index, prices) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a bunch of missing Token information for native tokens mostly. Not sure how to fix this yet.
Sample data:
Exception: possible error, token info not found for pools
[MissingTokenInfo(token0='0x4200000000000000000000000000000000000006', token1='0x557929D1d015F4B30E9C0E68cDF6e8a86B308E18', pool_type=-1),
MissingTokenInfo(token0='0x2C00f7fF36c3591340b7DB47c22C4a413b925E5F', token1='0x4200000000000000000000000000000000000006', pool_type=-1),
MissingTokenInfo(token0='0x4200000000000000000000000000000000000006', token1='0xF6A35217F35220efF1e3E1c489C30817245bc7cf', pool_type=-1),
MissingTokenInfo(token0='0x4200000000000000000000000000000000000006', token1='0x92A062bB26A0Cbc704BF7dcD4C833d4e1beeb83d', pool_type=-1),
MissingTokenInfo(token0='0x505269DA224Db7C3497A9799Fee06BbfbD0D40D2', token1='0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', pool_type=-1),
MissingTokenInfo(token0='0x06ef35365c3FA9125E94b4657E671FDaA0cB7B70', token1='0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', pool_type=-1),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought this up with the velodrome team on telegram. At first setting listed_only=False made all pools with missing tokens go away. We should check again with them if that isn't working anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried with both "listed_only" options, and this issue persists. I think this requires patching on the sugar-sdk side.
Priorities to pull by pool:
If this is a super light pull, we can try to run ~hourly. Also, if this shows data for each weekly epoch, then we could build a view on top that gets the amount that happens in each hour (i.e. if there's $100 volume now, $90 last hour, then $10 happened in the period elapsed). |
Implements the Sugar SDK puller that currently pulls snapshot data for the Base and OP chains.