-
Notifications
You must be signed in to change notification settings - Fork 59
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
381 add ability to split native vs wrapped carbon orders #390
Merged
barakman
merged 72 commits into
develop
from
381-add-ability-to-split-native-vs-wrapped-carbon-orders
Mar 19, 2024
Merged
381 add ability to split native vs wrapped carbon orders #390
barakman
merged 72 commits into
develop
from
381-add-ability-to-split-native-vs-wrapped-carbon-orders
Mar 19, 2024
Conversation
This file contains 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
mikewcasale
suggested changes
Feb 22, 2024
barakman
requested changes
Feb 22, 2024
barakman
requested changes
Feb 26, 2024
barakman
requested changes
Feb 28, 2024
barakman
requested changes
Feb 29, 2024
barakman
requested changes
Feb 29, 2024
barakman
requested changes
Feb 29, 2024
barakman
requested changes
Feb 29, 2024
…lane-bot into 381-add-ability-to-split-native-vs-wrapped-carbon-orders
barakman
requested changes
Mar 19, 2024
barakman
previously approved these changes
Mar 19, 2024
zavelevsky
previously approved these changes
Mar 19, 2024
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.
LGTM!
barakman
requested review from
zavelevsky and
barakman
and removed request for
mikewcasale and
zavelevsky
March 19, 2024 19:31
barakman
approved these changes
Mar 19, 2024
barakman
deleted the
381-add-ability-to-split-native-vs-wrapped-carbon-orders
branch
March 19, 2024 19:32
sklbancor
restored the
381-add-ability-to-split-native-vs-wrapped-carbon-orders
branch
March 19, 2024 20:12
sklbancor
deleted the
381-add-ability-to-split-native-vs-wrapped-carbon-orders
branch
March 19, 2024 20:16
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.
Splitting Carbon Trades
New class:
CarbonTradeSplitter
Current problem:
In the main arb processing flow in bot.py _handle_trade_instructions, all trades that include Carbon deployments have been aggregated into a single trade action, which will cause trades to fail in cases in which a single trade action includes strategies that contain a mix of wrapped/native tokens (paired with the same token). a mix of strategies being traded on include native gas token, and some include wrapped gas token, or the trades occur on different carbon deployments.
Example 1:
Current output:
Trade 1: Carbon, WETH > TKN [Strategy 1, 2]
Trade 2: Uniswap, TKN > WETH
Expected output:
Trade 1: Carbon, ETH > TKN [Strategy 1]
Trade 2: Carbon, WETH > TKN [Strategy 2]
Trade 3: Uniswap, TKN > WETH
Example 2:
Current output:
Trade 1: Carbon, ETH > TKN [Strategy 1, 2, 3, 4]
Trade 2: Uniswap, TKN > WETH
Expected output:
Trade 1: Carbon, ETH > TKN [Strategy 1, 2]
Trade 2: Carbon, WETH > TKN [Strategy 3]
Trade 3: Graphene, ETH > TKN [Strategy 4]
Trade 4: Uniswap, TKN > WETH
Updated Wrap/Unwrap Algorithm
New class:
WrapUnwrapProcessor
To support the split trade upgrade, the wrap/unwrap algorithm has been updated to be significantly more robust. It can now handle much more complex routes (such as when you split Carbon trades!).