{"id":36437814,"url":"https://github.com/CetusProtocol/aggregator","last_synced_at":"2026-01-18T13:00:31.186Z","repository":{"id":249043350,"uuid":"826297415","full_name":"CetusProtocol/aggregator","owner":"CetusProtocol","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-18T09:52:51.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-18T13:22:14.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CetusProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-09T12:39:05.000Z","updated_at":"2024-07-18T13:22:25.701Z","dependencies_parsed_at":"2024-07-18T13:22:19.196Z","dependency_job_id":"8576020e-770d-47b9-a482-c7f1700212fb","html_url":"https://github.com/CetusProtocol/aggregator","commit_stats":null,"previous_names":["cetusprotocol/aggregator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/CetusProtocol/aggregator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CetusProtocol%2Faggregator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CetusProtocol%2Faggregator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CetusProtocol%2Faggregator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CetusProtocol%2Faggregator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CetusProtocol","download_url":"https://codeload.github.com/CetusProtocol/aggregator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CetusProtocol%2Faggregator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-11T20:00:22.343Z","updated_at":"2026-01-18T13:00:31.177Z","avatar_url":"https://github.com/CetusProtocol.png","language":"TypeScript","funding_links":[],"categories":["**8\\. Conclusion**"],"sub_categories":["**7.4 Security, Audits, and Formal Verification**"],"readme":"\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca \u003e\n    \u003cimg src=\"https://archive.cetus.zone/assets/image/logo.png\" alt=\"Logo\" width=\"100\" height=\"100\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eCetus Plus Swap Aggregator\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Integrating Cetus-Aggregator-SDK: A Comprehensive Guide, Please see details in document.\n    \u003cbr /\u003e\n    \u003ca href=\"https://cetus-1.gitbook.io/cetus-developer-docs/developer/cetus-plus-aggregator\"\u003e\u003cstrong\u003eExplore the document »\u003c/strong\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# Welcome to Cetus Plus Swap Aggregator\n\nCetus 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.\n\nCore Advantages:\n\nHigh-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.\n\nEasy 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.\n\nMulti-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.\n\nBy using our aggregator, you can trade more efficiently and securely on the Sui blockchain, fully leveraging the various opportunities brought by decentralized finance (DeFi).\n\n# Aggregator SDK\n\n## Install\n\nThe SDK is published to npm registry. To use the SDK in your project, you can\n\n```\nnpm install @cetusprotocol/aggregator-sdk\n```\n\n## Usage\n\n### 1. Init client with rpc and package config\n\n```typescript\nconst client = new AggregatorClient({})\n```\n\n### 2. Get best router swap result from aggregator service\n\n```typescript\nconst amount = new BN(1000000)\nconst from = \"0x2::sui::SUI\"\nconst target =\n  \"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS\"\n\nconst routers = await client.findRouters({\n  from,\n  target,\n  amount,\n  byAmountIn: true, // true means fix input amount, false means fix output amount\n})\n```\n\n### 3. Confirm and do fast swap\n\n```typescript\nconst txb = new Transaction()\n\nif (routerRes != null) {\n  await client.fastRouterSwap({\n    routers,\n    txb,\n    slippage: 0.01,\n  })\n\n  const result = await client.devInspectTransactionBlock(txb, keypair)\n\n  if (result.effects.status.status === \"success\") {\n    console.log(\"Sim exec transaction success\")\n    const result = await client.signAndExecuteTransaction(txb, keypair)\n  }\n  console.log(\"result\", result)\n}\n```\n\n### 4. Build PTB and return target coin\n\n```typescript\nconst txb = new Transaction()\nconst byAmountIn = true\n\nif (routerRes != null) {\n  const targetCoin = await client.routerSwap({\n    routers,\n    txb,\n    inputCoin,\n    slippage: 0.01,\n  })\n\n  // you can use this target coin object argument to build your ptb.\n  client.transferOrDestoryCoin(txb, targetCoin, targetCoinType)\n\n  const result = await client.devInspectTransactionBlock(txb, keypair)\n\n  if (result.effects.status.status === \"success\") {\n    console.log(\"Sim exec transaction success\")\n    const result = await client.signAndExecuteTransaction(txb, keypair)\n  }\n  console.log(\"result\", result)\n}\n```\n\n# Aggregator Contract Interface\n\n## Tags corresponding to different networks\n\n| Contract                  | Tag of Repo | Latest published at address                                        |\n| ------------------------- | ----------- | ------------------------------------------------------------------ |\n| CetusAggregatorV2         | mainnet     | 0x40e457bc65a398d2db7026881358fcb7cfa2f1bb052bca41f46c55a1103f2d6f |\n| CetusAggregatorV2ExtendV1 | mainnet     | 0x2edc22bf96c85482b2208624fa9339255d5055113c92fd6c33add48ce971b774 |\n| CetusAggregatorV2ExtendV2 | mainnet     | 0x2e227a3cbc6715518b18ed339d2f967153674b7b257da114ca62c72b2011258a |\n\n## Example\n\n```\nCetusAggregatorV2 = { git = \"https://github.com/CetusProtocol/aggregator.git\", subdir = \"packages/cetus-aggregator-v2/mainnet\", rev = \"mainnet-v1.56.0\", override = true }\n\nCetusAggregatorV2ExtendV1 = { git = \"https://github.com/CetusProtocol/aggregator.git\", subdir = \"packages/cetus-aggregator-v2-extend-v1\", rev = \"mainnet-v1.56.0\", override = true }\n\nCetusAggregatorV2ExtendV2 = { git = \"https://github.com/CetusProtocol/aggregator.git\", subdir = \"packages/cetus-aggregator-v2-extend-v2\", rev = \"mainnet-v1.56.0\", override = true }\n```\n\n# Simple Aggregator Contract Interface\n\n- include: cetus, flowxv3, turbos, bluefin, haedalhmm, momentum, obric, deepbookv3\n\n## Tags corresponding to different networks\n\n| Contract              | Tag of Repo | Latest published at address                                        |\n| --------------------- | ----------- | ------------------------------------------------------------------ |\n| CetusAggregatorSimple | mainnet     | 0x54394cb5bceb8073c60df0964b904a607c9974ef771d9e8b3f9c45b8ce075499 |\n\n## Example\n\n```\nCetusAggregatorSimple = { git = \"https://github.com/CetusProtocol/aggregator.git\", subdir = \"packages/cetus-aggregator-v2/simple-mainnet\", rev = \"mainnet-v1.58.0\", override = true }\n```\n\n## Usage\n\nCetus 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.\n\n```\nsui move build --dependencies-are-root \u0026\u0026 sui client publish --dependencies-are-root\n```\n\n# More About Cetus\n\nUse the following links to learn more about Cetus:\n\nLearn more about working with Cetus in the [Cetus Documentation](https://cetus-1.gitbook.io/cetus-docs).\n\nJoin the Cetus community on [Cetus Discord](https://discord.com/channels/1009749448022315008/1009751382783447072).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCetusProtocol%2Faggregator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCetusProtocol%2Faggregator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCetusProtocol%2Faggregator/lists"}