|
24 | 24 | ## Projects |
25 | 25 |
|
26 | 26 | ### Latest Published At Table |
| 27 | +> To always access the most up-to-date package versions, please visit [**Move Registry**](https://www.moveregistry.com/) and search for **“Cetus”**. You’ll find the latest deployed packages and their corresponding contract addresses there. |
27 | 28 |
|
28 | 29 | - **Mainnet** |
29 | 30 |
|
@@ -79,127 +80,6 @@ The Cetus DCA integrates all core functionalities of the DCA interface. For more |
79 | 80 |
|
80 | 81 | The Cetus vaults integrates all core functionalities of the vaults interface. For more detailed information, please refer to the Vaults README document. [Vaults README Document](./sui/vaults/README.md) |
81 | 82 |
|
82 | | -## How to migrate to the latest version? |
83 | | - |
84 | | -### Why need to migrate? |
85 | | - |
86 | | -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: |
87 | | -integrate, stable farming, vault, aggregator, lp burn. |
88 | | - |
89 | | -### Clmm contract update details |
90 | | - |
91 | | -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: |
92 | | - |
93 | | -- **pool_creator.create_pool_v2** on the cetus_clmm contract |
94 | | -- **pool_creator_v2.create_pool_v2** on the integrate contract |
95 | | - |
96 | | -**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`. |
97 | | - |
98 | | -```rust |
99 | | -// cetus_clmm.pool_creator.create_pool_v2 |
100 | | -public fun create_pool_v2<CoinTypeA, CoinTypeB>( |
101 | | - config: &GlobalConfig, |
102 | | - pools: &mut Pools, |
103 | | - tick_spacing: u32, |
104 | | - initialize_price: u128, |
105 | | - url: String, |
106 | | - tick_lower_idx: u32, |
107 | | - tick_upper_idx: u32, |
108 | | - coin_a: Coin<CoinTypeA>, |
109 | | - coin_b: Coin<CoinTypeB>, |
110 | | - metadata_a: &CoinMetadata<CoinTypeA>, |
111 | | - metadata_b: &CoinMetadata<CoinTypeB>, |
112 | | - fix_amount_a: bool, |
113 | | - clock: &Clock, |
114 | | - ctx: &mut TxContext |
115 | | - ): (Position, Coin<CoinTypeA>, Coin<CoinTypeB>) |
116 | | - |
117 | | -// integrate.pool_creator_v2.create_pool_v2 |
118 | | -public entry fun create_pool_v2<CoinTypeA, CoinTypeB>( |
119 | | - config: &GlobalConfig, |
120 | | - pools: &mut Pools, |
121 | | - tick_spacing: u32, |
122 | | - initialize_price: u128, |
123 | | - url: String, |
124 | | - tick_lower_idx: u32, |
125 | | - tick_upper_idx: u32, |
126 | | - coin_a: &mut Coin<CoinTypeA>, |
127 | | - coin_b: &mut Coin<CoinTypeB>, |
128 | | - metadata_a: &CoinMetadata<CoinTypeA>, |
129 | | - metadata_b: &CoinMetadata<CoinTypeB>, |
130 | | - fix_amount_a: bool, |
131 | | - clock: &Clock, |
132 | | - ctx: &mut TxContext |
133 | | - ) |
134 | | -``` |
135 | | - |
136 | | -In these two methods, you can use the fix_amount_a parameter to control which coin amount remains fixed: |
137 | | - |
138 | | -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. |
139 | | -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. |
140 | | - |
141 | | -In some situations, coin issuers may want to reclaim the capability to create pools, so the protocol implements a `PoolCreationCap` mechanism for coin issuers. Here's how it works: |
142 | | -Prerequisites: |
143 | | - |
144 | | -- You must hold the `TreasuryCap` of the coin |
145 | | -- The `TreasuryCap` must not be frozen |
146 | | -- Only one `PoolCreationCap` can be minted per coin |
147 | | - |
148 | | -Steps to create a restricted pool: |
149 | | - |
150 | | -1. Mint a `PoolCreationCap` using your coin's `TreasuryCap` |
151 | | - |
152 | | -2. Register a pool by specifying: **Quote coin** and **Tick spacing**. |
153 | | - |
154 | | -The protocol controls which quote coins and tick_spacing values are permitted for pool registration. |
155 | | -Currently, only pools with the SUI-200 can be registered. |
156 | | - |
157 | | -```rust |
158 | | -let pool_creator_cap = factory::mint_pool_creation_cap<T>( |
159 | | - clmm_global_config, |
160 | | - clmm_pools, |
161 | | - &mut treasury_cap, |
162 | | - ctx |
163 | | -); |
164 | | - |
165 | | -factory::register_permission_pair<T, SUI>( |
166 | | - clmm_global_config, |
167 | | - clmm_pools, |
168 | | - 200, |
169 | | - &pool_creator_cap, |
170 | | - ctx |
171 | | -); |
172 | | - |
173 | | - |
174 | | -let (lp_position, return_coin_a, return_coin_b) = pool_creator::create_pool_v2_with_creation_cap<T, SUI>( |
175 | | - clmm_global_config, |
176 | | - clmm_pools, |
177 | | - pool_creator_cap, |
178 | | - 200, |
179 | | - current_sqrt_price, |
180 | | - string::utf8(b""), |
181 | | - coin_a, |
182 | | - coin_b, |
183 | | - metadata_a, |
184 | | - metadata_b, |
185 | | - is_fix_a, |
186 | | - clk, |
187 | | - ctx |
188 | | -); |
189 | | -``` |
190 | | - |
191 | | -Additionally, a new event `CollectRewardV2Event` has been added to the pool module. |
192 | | - |
193 | | -**Important Notice**: Mandatory Contract Upgrade |
194 | | -The Cetus CLMM core contract will undergo a mandatory upgrade in the near future. Upon completion, previous versions of the contract will be deprecated and no longer accessible |
195 | | -All dependent protocols will require updates, including: |
196 | | - |
197 | | -- [Vaults](sui/vaults/) |
198 | | -- [StableFarming](sui/stable_farming/) |
199 | | -- [LPBurn](sui/lp_burn/) |
200 | | -- Aggregator |
201 | | -- Integrate |
202 | | - |
203 | 83 | Please ensure all necessary preparations are made before the upgrade takes effect. |
204 | 84 |
|
205 | 85 | # More About Cetus |
|
0 commit comments