Skip to content

feat: migrate univ2 to SwapQuoter#523

Open
kayibal wants to merge 7 commits into
mainfrom
ah/migrate-univ2-swap-quoter
Open

feat: migrate univ2 to SwapQuoter#523
kayibal wants to merge 7 commits into
mainfrom
ah/migrate-univ2-swap-quoter

Conversation

@kayibal
Copy link
Copy Markdown
Collaborator

@kayibal kayibal commented Feb 2, 2026

A preview on how to migrate a protocol to the new trait.

Copy link
Copy Markdown
Collaborator

@dianacarvalho1 dianacarvalho1 left a comment

Choose a reason for hiding this comment

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

Thank you @kayibal ! Only have one suggestion

tokens: &HashMap<Bytes, Token>,
_decoder_context: &DecoderContext,
) -> Result<Self, Self::Error> {
let component = ProtocolComponent::<Arc<Token>>::new(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

couldn't we pass the ProtocolComponent already from the decoder? I think we already know them at this time

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We probably can, but I didn't want to break more interfaces right now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but this would be the time to break all the interfaces no? 👀

@kayibal kayibal force-pushed the ah/migrate-univ2-swap-quoter branch from 19b6f78 to 4e0fe65 Compare April 3, 2026 17:10
kayibal and others added 2 commits April 3, 2026 18:45
Two root causes on aarch64-apple-darwin:
1. conda GCC in PATH lacks __ARM_FEATURE_AES/__ARM_FEATURE_SHA2 macros
   that Apple clang defines unconditionally → force CC to clang
2. macOS 26 SDK's Metadata.h contains ObjC block pointer syntax pulled in
   transitively by aws-lc-sys jitterentropy → skip via include guard

Switch reqwest to native-tls to avoid pulling in aws-lc-rs unnecessarily.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
component(d0, d1) maps to token0 (0x...000) and token1 (0x...001).
token0 is WETH (18 dec) and token1 is USDC (6 dec), so the argument
order should be component(18, 6), not component(6, 18).
The swapped decimals caused spot_price / get_limits to return wrong
values, failing the PoolTargetPrice test with
"Target X < limit Y" where Y >> X.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kayibal kayibal force-pushed the ah/migrate-univ2-swap-quoter branch from 8b53552 to a0e82b2 Compare April 6, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants