Move Cetus Aggregator to Rust#1123
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
gemcoder21
reviewed
May 12, 2026
- 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.
6d6f6ee to
b5e855d
Compare
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)
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
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.
Tested txs:
https://suiscan.xyz/mainnet/tx/JDStmwnHtGDGv7DfWWwap5FSnFkJZH7WDXEmiqCwtkeh
https://suiscan.xyz/mainnet/tx/Br9w3DMbR3wqYfvVwvmh93qvzaCixz4G4UUvPQKzpXLx
https://suiscan.xyz/mainnet/tx/3eGMFZ834JY8sebiaLeqmiVMBEwSvaFoT6JXB96tGU2d
https://suiscan.xyz/mainnet/tx/8xfR7e2DRgcHpTL1whQWtyuqwFChYUKvnVJpqwS7zTk7