Skip to content

Move Cetus Aggregator to Rust#1123

Merged
0xh3rman merged 7 commits into
mainfrom
cetus-aggregator
May 13, 2026
Merged

Move Cetus Aggregator to Rust#1123
0xh3rman merged 7 commits into
mainfrom
cetus-aggregator

Conversation

@0xh3rman
Copy link
Copy Markdown
Collaborator

@0xh3rman 0xh3rman commented May 12, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a native Cetus aggregator provider for the Sui network, transitioning from a proxy-based implementation. It includes a substantial refactoring of Sui transaction construction in the gem_sui crate, establishing a new tx_builder module for object resolution and data prefetching. New utilities for coin type normalization and a dedicated SuiError enum were also implemented. Review feedback suggests enhancing the error reporting for failed transaction dry runs by including specific execution details from the Sui node to aid in debugging.

Comment thread crates/swapper/src/cetus/tx_builder/quote_data.rs Outdated
Comment thread crates/gem_sui/src/tx_builder/object_resolver.rs Outdated
Comment thread crates/gem_sui/src/tx_builder/transaction.rs Outdated
Comment thread crates/gem_sui/src/coin_type.rs Outdated
0xh3rman added 5 commits May 13, 2026 11:15
- Add pinned initial_shared_version map for cetus/bluefin/deepbook configs
  so multiGetObjects skips them; resolver uses owner_only() options
- Refactor ObjectResolver: single prefetch(client, ids, pinned) entrypoint,
  fold helpers into one assemble path
- Refactor PrefetchedTransactionData::prefetch to try_join 4 fetches with
  pinned skip (Sui fullnodes don't support JSON-RPC batch -32005)
- Link Cetus aggregator Move source per DEX swap module; collapse u128/u64
  dance in SwapLimits; switch test set comparisons; extend shared_object_ids
  coverage (multi-DEX, deepbook reference pool, error case)
- Drop dead proxy cetus path (ProxyProvider::new_cetus_aggregator)
Wire cetus_dlmm provider into the aggregator route dispatch: new module
swap/cetus_dlmm.rs handling the
<published_at>::cetus_dlmm::swap(swap_context, global_config, pool,
partner, direction, amount_in, versioned, clock) Move call. Adds DLMM
global config, partner, and versioned shared-object IDs (with pinned
initial_shared_versions) to constants. Extends shared_object_ids() and
build_swap() dispatch and adds a unit-test case.
@0xh3rman 0xh3rman force-pushed the cetus-aggregator branch from 6d6f6ee to b5e855d Compare May 13, 2026 02:16
0xh3rman added 2 commits May 13, 2026 11:41
Each DEX path (CETUS CLMM, CETUS DLMM, BLUEFIN, DEEPBOOK V3) has been
verified end-to-end on mainnet with successful dry-runs and on-chain Move
call shapes matching upstream signatures.

Verifying transactions:
  JDStmwnHtGDGv7DfWWwap5FSnFkJZH7WDXEmiqCwtkeh  CETUS + BLUEFIN
  Br9w3DMbR3wqYfvVwvmh93qvzaCixz4G4UUvPQKzpXLx  CETUS + DLMM + BLUEFIN
  3eGMFZ834JY8sebiaLeqmiVMBEwSvaFoT6JXB96tGU2d  DLMM (multi-hop) + transfer_or_destroy_coin
  8xfR7e2DRgcHpTL1whQWtyuqwFChYUKvnVJpqwS7zTk7  DEEPBOOK V3 (coin::zero + swapped arg order)
@0xh3rman 0xh3rman merged commit e113141 into main May 13, 2026
5 checks passed
@0xh3rman 0xh3rman deleted the cetus-aggregator branch May 13, 2026 05:29
@0xh3rman 0xh3rman mentioned this pull request May 13, 2026
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