-
Notifications
You must be signed in to change notification settings - Fork 102
WIP: Add RebalancerClient scaffolding for Inventory Management System 2.0 #2826
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
Draft
nicholaspai
wants to merge
72
commits into
master
Choose a base branch
from
rebalancer-scaffolding
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… 2.0 This PR is designed to open the discussion on designing an improved inventory manager system that supports the following features: - Allows arbitrary any to any rebalances - Allows user to specify target balances instead of percentages, which are easier to reason about The current system is limited to L1->L2 and L2->L1 flows and it handles them separately with different clients, this makes the code harder to maintain and also difficult to implement L2 to L2 rebalancing.
next up is to place an order in initializeRebalances
…tEstimatedCosts for HL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial feature set of inventory manager 2.0 will support swapping cross chain between USDC and USDT. It should plug in seamlessly into the existing inventory client.
Features
Defines a new module under
src/rebalancerdesigned to be used by the same accounts that run therelayerprograms including the--relayerand--rebalancerprocesses. The new module can be run with the temporary--rebalancer2flag.Requirements
rebalanceris backwards compatible with the existing inventory client logic and its designed to be aware of all pending rebalances sent by the inventory client.Implementation
We will define a new configuration which will be a set of USDC/USDT target balances across all chains supported by Hyperliquid/Binance.
The IM 2.0 will compare those target balances against current balances as returned by the inventoryClient which will include any virtual balance modifications we currently make. This will produce a set of excesses and deficits, which the IM 2.0 will then attempt to reconcile by swapping between Hyperliquid and Binance. If there is no fortunate matching of excesses and deficits then the IM 2.0 will do nothing.
The IM 2.0 will also expose a function getPendingRebalances that can be used by the inventoryClient so that it doesn’t double count any inventory that gets swapped by the IM 2.0.
The initial version of IM 2.0 will not support same asset to same asset bridging, like we currently do with CCTP/OFT, but eventually it should implement this logic and take it away from the inventory client.
Structure
Integration with Inventory Client