@cetusprotocol/aggregator-sdk 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,706 +0,0 @@
1
- # Cetus Aggregator V3 合约接口文档
2
-
3
- ## 概述
4
-
5
- Cetus Aggregator V3 是一个去中心化交易聚合器,通过整合多个 DEX 的流动性来为用户提供最优的交易路径。系统采用分层架构,包含 Move 合约层和 Rust 服务层。
6
-
7
- **合约地址**: `0x55317429b88dccaeaba11c5c528d74ce07f3dadf6068727a2a315ac2c104edd2`
8
-
9
- ## 核心架构
10
-
11
- ### 1. 核心合约模块
12
-
13
- #### `aggregator_v3::router`
14
-
15
- 核心路由合约,负责管理交易上下文和执行确认。
16
-
17
- #### `aggregator_v3::errors`
18
-
19
- 错误定义模块,包含所有错误代码。
20
-
21
- ### 2. 支持的 DEX 列表
22
-
23
- 当前版本支持以下 DEX:
24
-
25
- - **CETUS** - CLMM 协议
26
- - **KRIYA** - AMM 和 CLMM
27
- - **DEEPBOOKV3** - 订单簿 DEX
28
- - **FLOWX** - AMM 和 CLMM
29
- - **AFTERMATH** - AMM
30
- - **BLUEFIN** - CLMM
31
- - **TURBOS** - CLMM
32
- - **STEAMM** - CPMM
33
- - **STEAMM_OMM** - Oracle 驱动借贷协议
34
- - **STEAMM_OMM_V2** - Oracle 驱动借贷协议 V2
35
- - **ALPHAFI** - Vault 协议
36
- - **MOMENTUM** - CLMM
37
- - **MAGMA** - CLMM
38
- - **SEVENK** - Oracle 驱动
39
- - **SCALLOP** - 借贷协议
40
- - **HAEDAL** - PMM
41
- - **VOLO** - AMM
42
- - **BLUEMOVE** - AMM
43
- - **OBRIC** - AMM
44
- - **METASTABLE** - 稳定币 AMM
45
- - **SPRINGSUI/SUILEND** - 借贷协议
46
- - **AFSUI** - 流动性质押
47
-
48
- ## 主要数据结构
49
-
50
- ### SwapContext
51
-
52
- ```move
53
- public struct SwapContext {
54
- quote_id: String, // 报价ID
55
- from: TypeName, // 输入代币类型
56
- target: TypeName, // 输出代币类型
57
- amount_in: u64, // 输入金额
58
- expect_amount_out: u64, // 期望输出金额
59
- amount_out_limit: u64, // 最小输出金额
60
- fee_rate: u32, // 手续费率
61
- fee_recipient: address, // 手续费接收者
62
- balances: Bag, // 余额管理
63
- }
64
- ```
65
-
66
- ## 核心接口函数
67
-
68
- ### 1. 创建交易上下文
69
-
70
- ```move
71
- public fun new_swap_context<A, B>(
72
- quote_id: String, // 报价ID
73
- expect_amount_out: u64, // 期望输出金额
74
- amount_out_limit: u64, // 最小输出金额
75
- input_coin: Coin<A>, // 输入代币
76
- fee_rate: u32, // 手续费率 (0-100000, 对应0%-10%)
77
- fee_recipient: address, // 手续费接收地址
78
- ctx: &mut TxContext,
79
- ): SwapContext
80
- ```
81
-
82
- **功能**: 创建一个新的交易上下文
83
- **参数约束**:
84
-
85
- - `input_coin.value() > 0`
86
- - `fee_rate <= 100000` (最大 10%)
87
- - 如果`fee_rate > 0`,则`fee_recipient != @0x0`
88
-
89
- ### 2. 余额管理函数
90
-
91
- #### 提取余额
92
-
93
- ```move
94
- public fun take_balance<T>(
95
- swap_ctx: &mut SwapContext,
96
- amount: u64
97
- ): Balance<T>
98
- ```
99
-
100
- #### 合并余额
101
-
102
- ```move
103
- public fun merge_balance<T>(
104
- swap_ctx: &mut SwapContext,
105
- balance: Balance<T>
106
- )
107
- ```
108
-
109
- #### 转账余额
110
-
111
- ```move
112
- public fun transfer_balance<T>(
113
- balance: Balance<T>,
114
- recipient: address,
115
- ctx: &mut TxContext
116
- )
117
- ```
118
-
119
- ### 3. 确认交易
120
-
121
- ```move
122
- public fun confirm_swap<T>(
123
- swap_ctx: SwapContext,
124
- ctx: &mut TxContext
125
- ): Coin<T>
126
- ```
127
-
128
- **功能**: 确认并完成交易,返回输出代币
129
- **检查**:
130
-
131
- - 输出金额 >= `amount_out_limit`
132
- - 所有余额已处理完毕
133
- - 自动扣除手续费并转账给`fee_recipient`
134
-
135
- ### 4. 工具函数
136
-
137
- #### 获取最大输入金额
138
-
139
- ```move
140
- public fun max_amount_in(): u64 // 返回 2^64 - 1
141
- ```
142
-
143
- #### 转账或销毁代币
144
-
145
- ```move
146
- public fun transfer_or_destroy_coin<T>(
147
- coin: Coin<T>,
148
- ctx: &TxContext
149
- )
150
- ```
151
-
152
- ## DEX 集成接口标准
153
-
154
- ### 1. CLMM 协议类 (类似 UniswapV3)
155
-
156
- #### 1.1 Cetus CLMM
157
-
158
- ```move
159
- module cetus_router::cetus;
160
-
161
- public fun swap<A, B>(
162
- swap_ctx: &mut SwapContext,
163
- global_config: &GlobalConfig,
164
- pool: &mut Pool<A, B>,
165
- partner: &mut Partner,
166
- a2b: bool, // 交易方向
167
- amount_in: u64, // 输入金额
168
- clock: &Clock,
169
- ctx: &mut TxContext,
170
- )
171
- ```
172
-
173
- #### 1.2 Kriya CLMM
174
-
175
- ```move
176
- module kriya_router::kriya_clmm;
177
-
178
- public fun swap<A, B>(
179
- swap_ctx: &mut SwapContext,
180
- pool: &mut Pool<A, B>,
181
- version: &Version,
182
- a2b: bool,
183
- amount_in: u64,
184
- clock: &Clock,
185
- ctx: &mut TxContext,
186
- )
187
- ```
188
-
189
- #### 1.3 FlowX CLMM
190
-
191
- ```move
192
- module flowx_router::flowx_clmm;
193
-
194
- public fun swap<A, B>(
195
- swap_ctx: &mut SwapContext,
196
- pool_register: &mut PoolRegistry,
197
- versioned: &Versioned,
198
- fee_rate: u64, // 费率参数
199
- amount_in: u64,
200
- a2b: bool,
201
- clock: &Clock,
202
- ctx: &mut TxContext,
203
- )
204
- ```
205
-
206
- #### 1.4 Bluefin CLMM
207
-
208
- ```move
209
- module bluefin_router::bluefin;
210
-
211
- public fun swap<A, B>(
212
- swap_ctx: &mut SwapContext,
213
- global_config: &GlobalConfig,
214
- pool: &mut Pool<A, B>,
215
- a2b: bool,
216
- amount_in: u64,
217
- clock: &Clock,
218
- ctx: &mut TxContext,
219
- )
220
- ```
221
-
222
- #### 1.5 Turbos CLMM
223
-
224
- ```move
225
- module turbos_router::turbos;
226
-
227
- public fun swap<A, B, Fee>(
228
- swap_ctx: &mut SwapContext,
229
- pool: &mut Pool<A, B, Fee>, // 需要Fee类型参数
230
- versioned: &Versioned,
231
- a2b: bool,
232
- amount_in: u64,
233
- clock: &Clock,
234
- ctx: &mut TxContext,
235
- )
236
- ```
237
-
238
- #### 1.6 Momentum CLMM
239
-
240
- ```move
241
- module momentum_router::momentum;
242
-
243
- public fun swap<A, B>(
244
- swap_ctx: &mut SwapContext,
245
- pool: &mut Pool<A, B>,
246
- a2b: bool,
247
- amount_in: u64,
248
- version: &Version,
249
- clock: &Clock,
250
- ctx: &mut TxContext,
251
- )
252
- ```
253
-
254
- #### 1.7 Magma CLMM
255
-
256
- ```move
257
- module magma_router::magma;
258
-
259
- public fun swap<A, B>(
260
- swap_ctx: &mut SwapContext,
261
- global_config: &GlobalConfig,
262
- pool: &mut Pool<A, B>,
263
- a2b: bool,
264
- amount_in: u64,
265
- clock: &Clock,
266
- ctx: &mut TxContext,
267
- )
268
- ```
269
-
270
- ### 2. AMM 协议类 (类似 UniswapV2)
271
-
272
- #### 2.1 Kriya AMM
273
-
274
- ```move
275
- module kriya_router::kriya_amm;
276
-
277
- public fun swap<A, B>(
278
- swap_ctx: &mut SwapContext,
279
- pool: &mut Pool<A, B>,
280
- a2b: bool,
281
- amount_in: u64,
282
- ctx: &mut TxContext,
283
- )
284
- ```
285
-
286
- #### 2.2 FlowX AMM
287
-
288
- ```move
289
- module flowx_router::flowx_amm;
290
-
291
- public fun swap<A, B>(
292
- swap_ctx: &mut SwapContext,
293
- container: &mut Container,
294
- a2b: bool,
295
- amount_in: u64,
296
- ctx: &mut TxContext,
297
- )
298
- ```
299
-
300
- #### 2.3 BlueMove AMM
301
-
302
- ```move
303
- module bluemove_router::bluemove;
304
-
305
- // 仅支持单向接口
306
- public fun swap_a2b<A, B>(
307
- swap_ctx: &mut SwapContext,
308
- dex_info: &mut Dex_Info,
309
- amount_in: u64,
310
- ctx: &mut TxContext,
311
- )
312
-
313
- public fun swap_b2a<A, B>(
314
- swap_ctx: &mut SwapContext,
315
- dex_info: &mut Dex_Info,
316
- amount_in: u64,
317
- ctx: &mut TxContext,
318
- )
319
- ```
320
-
321
- ### 3. 订单簿类
322
-
323
- #### DeepBook V3
324
-
325
- ```move
326
- module deepbook_router::deepbookv3;
327
-
328
- public fun swap<A, B>(
329
- swap_ctx: &mut SwapContext,
330
- config: &mut GlobalConfig,
331
- pool: &mut Pool<A, B>,
332
- amount_in: u64,
333
- a2b: bool,
334
- coin_deep: Coin<DEEP>, // 需要DEEP代币支付手续费
335
- clock: &Clock,
336
- ctx: &mut TxContext,
337
- )
338
- ```
339
-
340
- ### 4. 复杂协议类
341
-
342
- #### 4.1 Aftermath AMM
343
-
344
- ```move
345
- module aftermath_router::aftermath;
346
-
347
- // 需要多个辅助对象
348
- public fun swap_a2b<A, B, Fee>(
349
- swap_ctx: &mut SwapContext,
350
- pool: &mut Pool<Fee>,
351
- pool_registry: &PoolRegistry,
352
- vault: &ProtocolFeeVault,
353
- treasury: &mut Treasury,
354
- insurance_fund: &mut InsuranceFund,
355
- referral_vault: &ReferralVault,
356
- amount_in: u64,
357
- expect_amount_out: u64,
358
- ctx: &mut TxContext,
359
- )
360
- ```
361
-
362
- #### 4.2 Steamm CPMM
363
-
364
- ```move
365
- module steamm_router::steamm_cpmm;
366
-
367
- public fun swap<LENDING_MARKET, COIN_A, COIN_B, BCOIN_A, BCOIN_B, LP_TOKEN: drop>(
368
- swap_ctx: &mut SwapContext,
369
- pool: &mut Pool<BCOIN_A, BCOIN_B, CpQuoter, LP_TOKEN>,
370
- bank_a: &mut Bank<LENDING_MARKET, COIN_A, BCOIN_A>,
371
- bank_b: &mut Bank<LENDING_MARKET, COIN_B, BCOIN_B>,
372
- lending_market: &LendingMarket<LENDING_MARKET>,
373
- a2b: bool,
374
- amount_in: u64,
375
- clock: &Clock,
376
- ctx: &mut TxContext,
377
- )
378
- ```
379
-
380
- #### 4.3 Steamm OMM
381
-
382
- ```move
383
- module steamm_router::steamm_omm;
384
-
385
- public fun swap<LENDING_MARKET, COIN_A, COIN_B, BCOIN_A, BCOIN_B, LP_TOKEN: drop>(
386
- swap_ctx: &mut SwapContext,
387
- pool: &mut Pool<BCOIN_A, BCOIN_B, OracleQuoter, LP_TOKEN>,
388
- bank_a: &mut Bank<LENDING_MARKET, COIN_A, BCOIN_A>,
389
- bank_b: &mut Bank<LENDING_MARKET, COIN_B, BCOIN_B>,
390
- lending_market: &LendingMarket<LENDING_MARKET>,
391
- oracle_price_update_a: OraclePriceUpdate, // Oracle 价格更新 A
392
- oracle_price_update_b: OraclePriceUpdate, // Oracle 价格更新 B
393
- a2b: bool,
394
- amount_in: u64,
395
- clock: &Clock,
396
- ctx: &mut TxContext,
397
- )
398
- ```
399
-
400
- #### 4.4 Steamm OMM V2
401
-
402
- ```move
403
- module steamm_router::steamm_omm_v2;
404
-
405
- public fun swap<LENDING_MARKET, COIN_A, COIN_B, BCOIN_A, BCOIN_B, LP_TOKEN: drop>(
406
- swap_ctx: &mut SwapContext,
407
- pool: &mut Pool<BCOIN_A, BCOIN_B, OracleQuoterV2, LP_TOKEN>,
408
- bank_a: &mut Bank<LENDING_MARKET, COIN_A, BCOIN_A>,
409
- bank_b: &mut Bank<LENDING_MARKET, COIN_B, BCOIN_B>,
410
- lending_market: &LendingMarket<LENDING_MARKET>,
411
- oracle_price_update_a: OraclePriceUpdate, // Oracle 价格更新 A
412
- oracle_price_update_b: OraclePriceUpdate, // Oracle 价格更新 B
413
- a2b: bool,
414
- amount_in: u64,
415
- clock: &Clock,
416
- ctx: &mut TxContext,
417
- )
418
- ```
419
-
420
- ### 5. 借贷协议类
421
-
422
- #### 5.1 Scallop
423
-
424
- ```move
425
- module scallop_router::scallop;
426
-
427
- // mint s_coin: coin -> s_coin
428
- public fun swap_a2b<A, B>(
429
- swap_ctx: &mut SwapContext,
430
- version: &Version,
431
- market: &mut Market,
432
- treasury: &mut SCoinTreasury<B, A>,
433
- amount_in: u64,
434
- clock: &Clock,
435
- ctx: &mut TxContext,
436
- )
437
-
438
- // redeem s_coin: s_coin -> coin
439
- public fun swap_b2a<B, A>(
440
- swap_ctx: &mut SwapContext,
441
- version: &Version,
442
- market: &mut Market,
443
- treasury: &mut SCoinTreasury<B, A>,
444
- amount_in: u64,
445
- clock: &Clock,
446
- ctx: &mut TxContext,
447
- )
448
- ```
449
-
450
- ### 6. 流动性质押类
451
-
452
- #### 6.1 AlphaFi
453
-
454
- ```move
455
- module alphafi_router::alphafi;
456
-
457
- public fun swap<P: drop>(
458
- swap_ctx: &mut SwapContext,
459
- liquid_staking_info: &mut LiquidStakingInfo<P>,
460
- system_state: &mut SuiSystemState,
461
- a2b: bool,
462
- amount_in: u64,
463
- ctx: &mut TxContext,
464
- )
465
- ```
466
-
467
- #### 6.2 Volo
468
-
469
- ```move
470
- module volo_router::volo;
471
-
472
- public fun swap(
473
- swap_ctx: &mut SwapContext,
474
- pool: &mut StakePool,
475
- metadata: &mut Metadata<CERT>,
476
- sui_system: &mut SuiSystemState,
477
- a2b: bool,
478
- amount_in: u64,
479
- ctx: &mut TxContext,
480
- )
481
- ```
482
-
483
- ### 7. Oracle 驱动类
484
-
485
- #### 7.1 Haedal HMM
486
-
487
- ```move
488
- module haedal_router::haedal_hmm;
489
-
490
- public fun swap<A, B>(
491
- swap_ctx: &mut SwapContext,
492
- pool: &mut Pool<A, B>,
493
- base_price_pair_obj: &PriceInfoObject, // Pyth价格预言机
494
- quote_price_pair_obj: &PriceInfoObject,
495
- amount_in: u64,
496
- a2b: bool,
497
- clock: &Clock,
498
- ctx: &mut TxContext,
499
- )
500
- ```
501
-
502
- #### 7.2 Obric
503
-
504
- ```move
505
- module obric_router::obric;
506
-
507
- public fun swap<A, B>(
508
- swap_ctx: &mut SwapContext,
509
- pool: &mut TradingPair<A, B>,
510
- amount_in: u64,
511
- a2b: bool,
512
- pyth_state: &PythState, // Pyth状态对象
513
- a_price_info_object: &PriceInfoObject,
514
- b_price_info_object: &PriceInfoObject,
515
- clock: &Clock,
516
- ctx: &mut TxContext,
517
- )
518
- ```
519
-
520
- ### 8. 稳定币专用类
521
-
522
- #### Metastable
523
-
524
- ```move
525
- module metastable_router::metastable;
526
-
527
- // deposit coin => metacoin
528
- public fun swap_a2b<A, B>(
529
- swap_ctx: &mut SwapContext,
530
- vault_info: &mut Vault<B>,
531
- version: &Version,
532
- deposit_cap: DepositCap<B, A>,
533
- amount_in: u64,
534
- ctx: &mut TxContext,
535
- )
536
-
537
- // withdraw metacoin => coin
538
- public fun swap_b2a<A, B>(
539
- swap_ctx: &mut SwapContext,
540
- vault_info: &mut Vault<B>,
541
- version: &Version,
542
- withdraw_cap: WithdrawCap<B, A>,
543
- amount_in: u64,
544
- ctx: &mut TxContext,
545
- )
546
- ```
547
-
548
- ## SDK 对接标准
549
-
550
- ### 1. 通用接口模式
551
-
552
- 所有 DEX 集成都遵循以下模式:
553
-
554
- ```move
555
- public fun swap<TypeParams>(
556
- swap_ctx: &mut SwapContext, // 必需:聚合器上下文
557
- // DEX特定参数
558
- a2b: bool, // 可选:交易方向 (部分DEX使用)
559
- amount_in: u64, // 必需:输入金额
560
- // 其他DEX特定参数
561
- ctx: &mut TxContext, // 必需:交易上下文
562
- )
563
- ```
564
-
565
- ### 2. DEX 分类和参数需求
566
-
567
- #### 简单 DEX (只需基本参数)
568
-
569
- - **Kriya AMM**, **FlowX AMM**, **BlueMove**
570
-
571
- #### CLMM 类 DEX (需要 Clock)
572
-
573
- - **Cetus**, **Kriya CLMM**, **FlowX CLMM**, **Bluefin**, **Turbos**, **Momentum**, **Magma**
574
-
575
- #### 订单簿 DEX (需要特殊代币)
576
-
577
- - **DeepBook V3** (需要 DEEP 代币)
578
-
579
- #### Oracle 驱动 DEX (需要价格预言机)
580
-
581
- - **Haedal HMM**, **Obric** (需要 Pyth 价格信息)
582
- - **Steamm OMM**, **Steamm OMM V2** (需要 Oracle 价格更新)
583
-
584
- #### 借贷协议 (需要市场/银行对象)
585
-
586
- - **Scallop**, **Steamm CPMM**
587
-
588
- #### 质押协议 (需要系统状态)
589
-
590
- - **AlphaFi**, **Volo** (需要 SuiSystemState)
591
-
592
- #### 复杂协议 (需要多个辅助对象)
593
-
594
- - **Aftermath** (需要多个金库和注册表)
595
-
596
- ### 3. SDK 实现建议
597
-
598
- 1. **参数管理**: 为每个 DEX 类型创建专门的参数结构体
599
- 2. **类型安全**: 利用 Move 的类型系统确保参数正确性
600
- 3. **错误处理**: 统一处理各 DEX 的特定错误情况
601
- 4. **批量操作**: 支持多路径并行执行
602
- 5. **滑点保护**: 在`SwapContext`层面统一管理滑点控制
603
-
604
- ## REST API 接口
605
-
606
- ### 路由查找接口
607
-
608
- #### 端点
609
-
610
- ```
611
- GET/POST /router_v2/find_routes
612
- ```
613
-
614
- #### 请求参数
615
-
616
- ```json
617
- {
618
- "from": "0x2::sui::SUI", // 输入代币类型
619
- "target": "0x2::coin::COIN", // 输出代币类型
620
- "amount": 1000000000, // 金额 (最小单位)
621
- "by_amount_in": true, // 是否按输入金额计算
622
- "depth": 3, // 最大路径深度
623
- "split_count": 5, // 分割数量
624
- "providers": "CETUS,KRIYA,DEEPBOOKV3", // 指定DEX (可选)
625
- "liquidity_change": [...], // 流动性变化 (可选)
626
- "v": 1000800 // 客户端版本
627
- }
628
- ```
629
-
630
- #### 响应格式
631
-
632
- ```json
633
- {
634
- "request_id": "unique_id",
635
- "amount_in": 1000000000,
636
- "amount_out": 950000000,
637
- "routes": [
638
- {
639
- "path": [
640
- {
641
- "provider": "CETUS",
642
- "pool_id": "0x...",
643
- "from": "0x2::sui::SUI",
644
- "target": "0x2::coin::COIN",
645
- "amount_in": 500000000,
646
- "amount_out": 475000000
647
- }
648
- ],
649
- "amount_in": 500000000,
650
- "amount_out": 475000000,
651
- "initial_price": "0.95"
652
- }
653
- ],
654
- "packages": {
655
- "CETUS": "0x...",
656
- "KRIYA": "0x..."
657
- }
658
- }
659
- ```
660
-
661
- ## 错误代码
662
-
663
- | 错误码 | 函数 | 说明 |
664
- | ------ | --------------------------- | -------------------- |
665
- | 1 | `err_less_amount_out` | 输出金额小于限制 |
666
- | 2 | `err_remains_balance` | 存在未处理的余额 |
667
- | 3 | `err_amount_in_is_zero` | 输入金额为零 |
668
- | 4 | `err_invalid_fee_recipient` | 无效的手续费接收者 |
669
- | 5 | `err_too_large_fee_rate` | 手续费率过大 |
670
- | 6 | `err_not_support_b2a` | 不支持 B 到 A 的交易 |
671
-
672
- ## 常量定义
673
-
674
- ```move
675
- const FEE_DENOMINATOR: u32 = 1000000; // 手续费分母
676
- const MAX_FEE_RATE: u32 = 100000; // 最大手续费率 (10%)
677
- const MAX_AMOUNT_IN: u64 = 0xFFFFFFFFFFFFFFFF; // 最大输入金额
678
- ```
679
-
680
- ## 版本兼容性
681
-
682
- 系统根据客户端版本自动调整支持的 DEX 列表:
683
-
684
- - `v1.0.3.18+`: 支持 BLUEFIN, SUILEND, ALPHAFI
685
- - `v1.0.3.22+`: 支持 HAEDALPMM
686
- - `v1.0.3.28+`: 支持 TURBOS
687
- - `v1.0.6.0+`: 支持 DEEPBOOKV3
688
- - `v1.0.7.0+`: 支持 STEAMM_OMM
689
- - `v1.0.8.0+`: 支持 MOMENTUM, STEAMM_OMM_V2
690
-
691
- ## 使用流程
692
-
693
- 1. **获取报价**: 调用 REST API 获取最优路径和报价 ID
694
- 2. **创建上下文**: 使用`new_swap_context`创建交易上下文
695
- 3. **执行交易**: 按报价路径调用各 DEX 的 swap 函数
696
- 4. **确认交易**: 调用`confirm_swap`完成交易并获得输出代币
697
-
698
- ## 安全考虑
699
-
700
- - 所有金额计算使用精确算术,避免精度损失
701
- - 滑点保护通过`amount_out_limit`参数实现
702
- - 手续费率有上限保护 (最大 10%)
703
- - 余额管理确保无资金遗漏
704
- - 统一的错误处理和状态管理
705
-
706
- 这份文档为 SDK 对接提供了完整的 DEX 集成标准,每个 DEX 类型都有明确的接口定义和参数要求,便于开发者正确实现聚合器功能。