Skip to content

Commit dd2dc27

Browse files
author
reditable
committed
Update readme
1 parent e80d712 commit dd2dc27

2 files changed

Lines changed: 7 additions & 121 deletions

File tree

README.md

Lines changed: 1 addition & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
## Projects
2525

2626
### 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.
2728
2829
- **Mainnet**
2930

@@ -79,127 +80,6 @@ The Cetus DCA integrates all core functionalities of the DCA interface. For more
7980

8081
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)
8182

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-
20383
Please ensure all necessary preparations are made before the upgrade takes effect.
20484

20585
# More About Cetus

sui/cetus_clmm/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ testnet:
3838
CetusClmm = { git = "https://github.com/CetusProtocol/cetus-clmm-interface.git", subdir = "sui/cetus_clmm", rev = "testnet-v1.25.0" }
3939
```
4040

41+
For future integration, it’s recommended to use the Move Registry command instead:
42+
43+
```bash
44+
mvr add @cetuspackages/clmm
45+
```
46+
4147
## Usage
4248

4349
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.

0 commit comments

Comments
 (0)