-
Notifications
You must be signed in to change notification settings - Fork 3
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
Osmosis Integration Tests + Improvements #27
base: main
Are you sure you want to change the base?
Conversation
Is it possible to see balances of wallets on both the chains? At the minimum we need to make evident which chain this wallet belongs to. |
Just made the change. Here's what the logs look like now:
Shows the balance for each in/out asset in all legs in the route, with the chain of the provider indicated. |
This PR also updates the local-ic docker images. |
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.
overall this looks good! it would help a lot with the review if you could add a few comments around some of the python-unique syntax oneliners, and general logic flow (e.g. early return conditions, prefix logic, etc).
I think I understand what's happening, but would be great to be a bit more certain.
assets = [leg.in_asset(), leg.out_asset()] | ||
|
||
return [ | ||
x for x in (asset_balance_prefix(leg, asset) for asset in assets) if x |
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.
would be nice to get some comments around oneliners like this
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.
Done!
src/scheduler.py
Outdated
async def query_denom_route( | ||
self, query: DenomRouteQuery | ||
) -> Optional[list[DenomRouteLeg]]: | ||
if self.denom_routes and query in self.denom_routes: |
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.
do we exit early here in case we already have a response stored? would be nice to add a comment
This PR finalizes Osmosis local-ic integration test implementation. This was achieved by centralizing Skip queries in the Context, allowing for injection of IBC paths and denom info. Furthermore, several bug fixes were made in the process, allowing for these tests to pass, including the addition of route reevaluation (updating quantities in the execution plan in accordance with slight slippage at any step of the plan that would cause it to be invalidated), and a binary search based execution planner (allowing for tighter execution plan-wallet balance differences, and maximizing profit per trade). Furthermore, several other quality of life improvements were made, including leg balance prefixing in route logs, which assists in debugging.
An example of this is as follows:
2024-10-04 15:18:21 INFO balance[neutron-1](untrn): 15503863 balance[neutron-1](factory/neut): 5681 r2- Route has possible execution plan: [5681]