Skip to content

feat: Create SameAssetRebalancer#3561

Merged
nicholaspai merged 10 commits into
masterfrom
same-asset-rebalances
Jul 10, 2026
Merged

feat: Create SameAssetRebalancer#3561
nicholaspai merged 10 commits into
masterfrom
same-asset-rebalances

Conversation

@nicholaspai

Copy link
Copy Markdown
Member
  • Extend InventoryClient withdrawExcessBalances() and rebalanceInventoryIfNeeded() to allow caller to retrieve the set of potential rebalances (based on the configured inventory config) without executing any rebalances through the InventoryClient
  • Creates a SameAssetRebalancerClient that (1) asks the InventoryClient for the set of rebalances + withdrawals and (2) executes them using the swap-rebalancer/'s adapters
  • Creates a setup script that hardcodes USDT rebalances through Binance between Ethereum and Avalanche
  • Adds a new bot parallel to the swapRebalancer that can be run independently from the swap rebalancer called the sameAssetRebalancer

- Extend InventoryClient withdrawExcessBalances() and rebalanceInventoryIfNeeded() to allow caller to retrieve the set of potential rebalances (based on the configured inventory config) without executing any rebalances through the InventoryClient
- Creates a SameAssetRebalancerClient that (1) asks the InventoryClient for the set of rebalances + withdrawals and (2) executes them using the `swap-rebalancer/`'s adapters
- Creates a setup script that hardcodes USDT rebalances through Binance  between Ethereum and Avalanche
- Adds a new bot parallel to the `swapRebalancer` that can be run independently from the swap rebalancer called the `sameAssetRebalancer`
@nicholaspai nicholaspai changed the title eat: Create SameAssetRebalancer feat: Create SameAssetRebalancer Jul 9, 2026
@nicholaspai nicholaspai marked this pull request as ready for review July 9, 2026 22:09
(route.sourceChain === this.config.hubPoolChainId && route.destinationChain !== this.config.hubPoolChainId) ||
(route.sourceChain !== this.config.hubPoolChainId && route.destinationChain === this.config.hubPoolChainId)
)
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe its more readable to do something like

if ((srcChain === hubPool && dstChain === hubPool) || (srcChain !== hubPool && dstChain !== hubPool))

It will discard the outer negation. Tho its nothing major so i am okey with leaving it like this 👍

@dijanin-brat

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 517bbd5345

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/rebalancer/clients/SameAssetRebalancerClient.ts Outdated
Comment thread src/clients/InventoryClient.ts
@nicholaspai nicholaspai merged commit d9a3022 into master Jul 10, 2026
5 checks passed
@nicholaspai nicholaspai deleted the same-asset-rebalances branch July 10, 2026 14:37
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.

2 participants