Gathering detailed insights and metrics for @cetusprotocol/aggregator-sdk
Gathering detailed insights and metrics for @cetusprotocol/aggregator-sdk
Gathering detailed insights and metrics for @cetusprotocol/aggregator-sdk
Gathering detailed insights and metrics for @cetusprotocol/aggregator-sdk
npm install @cetusprotocol/aggregator-sdk
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
17
1
5
Integrating Cetus-Aggregator-SDK: A Comprehensive Guide, Please see details in document.
Explore the document »
Cetus plus swap aggregator is a high-speed and easy-to-integrate solution designed to optimize your trading experience on the Sui blockchain. This aggregator integrates multiple mainstream decentralized exchanges (DEX) on the Sui chain, including various types of trading platforms, providing users with the best trading prices and the lowest slippage.
Core Advantages:
High-Speed Transactions: Thanks to advanced algorithms and efficient architecture, our aggregator can execute transactions at lightning speed, ensuring users get the best opportunities in a rapidly changing market.
Easy Integration: The aggregator is designed to be simple and easy to integrate. Whether you are an individual developer or a large project team, you can quickly connect and deploy.
Multi-Platform Support: Currently, we have integrated multiple mainstream DEXs on the Sui chain, including cetus, deepbook, kriya, flowx, aftermath, afsui, haedal, volo, turbos etc, allowing users to enjoy a diversified trading experience on a single platform.
By using our aggregator, you can trade more efficiently and securely on the Sui blockchain, fully leveraging the various opportunities brought by decentralized finance (DeFi).
The SDK is published to npm registry. To use the SDK in your project, you can
npm install @cetusprotocol/aggregator-sdk
1const client = new AggregatorClient({})
1const amount = new BN(1000000) 2const from = "0x2::sui::SUI" 3const target = 4 "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS" 5 6const routers = await client.findRouters({ 7 from, 8 target, 9 amount, 10 byAmountIn: true, // true means fix input amount, false means fix output amount 11})
1const txb = new Transaction() 2 3if (routerRes != null) { 4 await client.fastRouterSwap({ 5 routers, 6 txb, 7 slippage: 0.01, 8 }) 9 10 const result = await client.devInspectTransactionBlock(txb, keypair) 11 12 if (result.effects.status.status === "success") { 13 console.log("Sim exec transaction success") 14 const result = await client.signAndExecuteTransaction(txb, keypair) 15 } 16 console.log("result", result) 17}
1const txb = new Transaction() 2const byAmountIn = true 3 4if (routerRes != null) { 5 const targetCoin = await client.routerSwap({ 6 routers, 7 txb, 8 inputCoin, 9 slippage: 0.01, 10 }) 11 12 // you can use this target coin object argument to build your ptb. 13 client.transferOrDestoryCoin(txb, targetCoin, targetCoinType) 14 15 const result = await client.devInspectTransactionBlock(txb, keypair) 16 17 if (result.effects.status.status === "success") { 18 console.log("Sim exec transaction success") 19 const result = await client.signAndExecuteTransaction(txb, keypair) 20 } 21 console.log("result", result) 22}
Contract | Tag of Repo | Latest published at address |
---|---|---|
CetusAggregatorV2 | mainnet | 0x3864c7c59a4889fec05d1aae4bc9dba5a0e0940594b424fbed44cb3f6ac4c032 |
CetusAggregatorV2ExtendV1 | mainnet | 0x39402d188b7231036e52266ebafad14413b4bf3daea4ac17115989444e6cd516 |
CetusAggregatorV2ExtendV2 | mainnet | 0x368d13376443a8051b22b42a9125f6a3bc836422bb2d9c4a53984b8d6624c326 |
CetusAggregatorV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/mainnet", rev = "mainnet", override = true }
CetusAggregatorV2ExtendV1 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v1", rev = "mainnet", override = true }
CetusAggregatorV2ExtendV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v2", rev = "mainnet", override = true }
Contract | Tag of Repo | Latest published at address |
---|---|---|
CetusAggregatorSimple | mainnet | 0x594d67abc0778023ac852800578271dd7e18698ad06e6298034858c77612333d |
CetusAggregatorSimple = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/simple-mainnet", rev = "mainnet-v1.49.1", override = true }
Cetus clmm interface is not complete(just have function definition), so it will fails when sui client check the code version. However, this does not affect its actual functionality. Therefore, we need to add a --dependencies-are-root during the build.
sui move build --dependencies-are-root && sui client publish --dependencies-are-root
Use the following links to learn more about Cetus:
Learn more about working with Cetus in the Cetus Documentation.
Join the Cetus community on Cetus Discord.
No vulnerabilities found.
No security vulnerabilities found.