Version Upgrade Guide
The Cetus CLMM core contract will undergo a mandatory upgrade in the near future. Upon completion:How to migrate to the latest version?
Why need to migrate?
Cetus has already updated to the new CLMM contract and will disable the old version of the CLMM contract. The following contracts will need to be updated simultaneously: integrate, stable farming, vault, aggregator, lp burn.
Clmm contract update details
This update introduces new methods for pool creation, with the primary change being mandatory liquidity provision for new pools. To create a new pool, you can use either:
pool_creator.create_pool_v2 on the cetus_clmm contract
pool_creator_v2.create_pool_v2 on the integrate contract
Note: The previous creation method factory.create_pool
is permissioned, and factory.create_pool_with_liquidity
is deprecated in this update. The pool_creator.create_pool_v2_by_creation_cap
method is deprecated, please use pool_creator.create_pool_v2_with_creation_cap
.
In these two methods, you can use the fix_amount_a parameter to control which coin amount remains fixed:
If fix_amount_a
is true: The amount of coin_a will be fixed. You should provide the exact amount of coin_a you want to deposit, and the required amount of coin_b will be calculated automatically. If fix_amount_a
is false: The amount of coin_b will be fixed. You should provide the exact amount of coin_b you want to deposit, and the required amount of coin_a will be calculated automatically.
There are two conditions for creating a pool. For regular tokens, the treasury cap owner does not impose any special requirements for creating pools associated with that token; anyone can create one. In this case, we have modified the original pool creation method to require only the addition of bidirectional liquidity at the time of pool creation.
In certain situations, coin issuers may wish to reclaim the ability to create pools. To accommodate this, the protocol implements a PoolCreationCap
mechanism for coin issuers. Here's how it works:
Prerequisites:
You must hold the
TreasuryCap
of the coinThe
TreasuryCap
must not be frozenOnly one
PoolCreationCap
can be minted per coin
Steps to create a restricted pool:
Mint a
PoolCreationCap
using your coin'sTreasuryCap
Register a pool by specifying: Quote coin and Tick spacing.
The protocol controls which quote coins and tick_spacing values are permitted for pool registration. Currently, only pools with the SUI-200 can be registered.
Additionally, a new event CollectRewardV2Event
has been added to the pool module. You can now use event to determine the type of reward to harvest
Previous versions of the contract will be deprecated and no longer accessible
All dependent protocols will require updates, including:
Vaults
StableFarming
LPBurn
Please ensure all necessary preparations are made before the upgrade takes effect.
2. For SDK integrations
In both testnet and mainnet, we have set up default contract addresses. To integrate these changes, simply upgrade the cetus-sui-clmm-sdk
package to version v5.1.10
. Then, replace your current Cetus SDK initialization method with src/config/initCetusSDK
.
You can refer to this Setting Up Configuration section to see the method for initializing the SDK.
Note: In version v5.1.8,
the default CLMM and integrated contract published are not the latest versions.
More details can refer to via SDK.
3. For contract integrations
You can update the dependencies in your project's Move.toml
More contract details can refer to via Contract.
4. For aggregator integrations
The aggregator contract also needs to be upgraded to the latest version. In this new version, we have not only upgraded the dependent CLMM contract but also integrated several non-dex liquidity paths. The latest npm packge version is v0.3.11. More details can refer to Cetus Plus Aggregator.
Last updated