@logswap/sdk 0.5.79 → 0.5.81

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.
package/dist/fpool.d.ts CHANGED
@@ -47,7 +47,7 @@ export { fPoolManagerAbi, padPolicyAbi, polPolicyAbi, privatePolicyAbi, publicPo
47
47
  export declare const fPolicyBaseAbi: readonly [{
48
48
  readonly type: "constructor";
49
49
  readonly inputs: readonly [{
50
- readonly name: "_manager";
50
+ readonly name: "manager_";
51
51
  readonly internalType: "contract FPoolManager";
52
52
  readonly type: "address";
53
53
  }];
@@ -76,6 +76,16 @@ export declare const fPolicyBaseAbi: readonly [{
76
76
  readonly type: "address";
77
77
  }];
78
78
  readonly stateMutability: "view";
79
+ }, {
80
+ readonly type: "function";
81
+ readonly inputs: readonly [];
82
+ readonly name: "cManager";
83
+ readonly outputs: readonly [{
84
+ readonly name: "";
85
+ readonly internalType: "address";
86
+ readonly type: "address";
87
+ }];
88
+ readonly stateMutability: "view";
79
89
  }, {
80
90
  readonly type: "function";
81
91
  readonly inputs: readonly [{
@@ -93,7 +103,7 @@ export declare const fPolicyBaseAbi: readonly [{
93
103
  }, {
94
104
  readonly type: "function";
95
105
  readonly inputs: readonly [];
96
- readonly name: "creatorCurated";
106
+ readonly name: "feeCurated";
97
107
  readonly outputs: readonly [{
98
108
  readonly name: "";
99
109
  readonly internalType: "bool";
@@ -104,10 +114,10 @@ export declare const fPolicyBaseAbi: readonly [{
104
114
  readonly type: "function";
105
115
  readonly inputs: readonly [{
106
116
  readonly name: "";
107
- readonly internalType: "address";
108
- readonly type: "address";
117
+ readonly internalType: "uint256";
118
+ readonly type: "uint256";
109
119
  }];
110
- readonly name: "creatorListed";
120
+ readonly name: "feeListed";
111
121
  readonly outputs: readonly [{
112
122
  readonly name: "";
113
123
  readonly internalType: "bool";
@@ -116,32 +126,26 @@ export declare const fPolicyBaseAbi: readonly [{
116
126
  readonly stateMutability: "view";
117
127
  }, {
118
128
  readonly type: "function";
119
- readonly inputs: readonly [];
120
- readonly name: "feeCurated";
129
+ readonly inputs: readonly [{
130
+ readonly name: "poolId";
131
+ readonly internalType: "bytes32";
132
+ readonly type: "bytes32";
133
+ }];
134
+ readonly name: "incomeTax";
121
135
  readonly outputs: readonly [{
122
136
  readonly name: "";
123
- readonly internalType: "bool";
124
- readonly type: "bool";
125
- }];
126
- readonly stateMutability: "view";
127
- }, {
128
- readonly type: "function";
129
- readonly inputs: readonly [{
137
+ readonly internalType: "address";
138
+ readonly type: "address";
139
+ }, {
130
140
  readonly name: "";
131
141
  readonly internalType: "uint256";
132
142
  readonly type: "uint256";
133
143
  }];
134
- readonly name: "feeListed";
135
- readonly outputs: readonly [{
136
- readonly name: "";
137
- readonly internalType: "bool";
138
- readonly type: "bool";
139
- }];
140
144
  readonly stateMutability: "view";
141
145
  }, {
142
146
  readonly type: "function";
143
147
  readonly inputs: readonly [];
144
- readonly name: "keepQuote";
148
+ readonly name: "incomeTaxRate";
145
149
  readonly outputs: readonly [{
146
150
  readonly name: "";
147
151
  readonly internalType: "uint256";
@@ -168,6 +172,20 @@ export declare const fPolicyBaseAbi: readonly [{
168
172
  readonly type: "address";
169
173
  }];
170
174
  readonly stateMutability: "view";
175
+ }, {
176
+ readonly type: "function";
177
+ readonly inputs: readonly [{
178
+ readonly name: "";
179
+ readonly internalType: "bytes32";
180
+ readonly type: "bytes32";
181
+ }];
182
+ readonly name: "managerOf";
183
+ readonly outputs: readonly [{
184
+ readonly name: "";
185
+ readonly internalType: "address";
186
+ readonly type: "address";
187
+ }];
188
+ readonly stateMutability: "view";
171
189
  }, {
172
190
  readonly type: "function";
173
191
  readonly inputs: readonly [{
@@ -236,51 +254,74 @@ export declare const fPolicyBaseAbi: readonly [{
236
254
  }, {
237
255
  readonly type: "function";
238
256
  readonly inputs: readonly [];
239
- readonly name: "minQuoteAtSeed";
257
+ readonly name: "minQuoteRatio";
240
258
  readonly outputs: readonly [{
241
259
  readonly name: "";
242
260
  readonly internalType: "uint256";
243
261
  readonly type: "uint256";
244
262
  }];
245
263
  readonly stateMutability: "view";
246
- }, {
247
- readonly type: "function";
248
- readonly inputs: readonly [];
249
- readonly name: "mintFeeCurated";
250
- readonly outputs: readonly [{
251
- readonly name: "";
252
- readonly internalType: "bool";
253
- readonly type: "bool";
254
- }];
255
- readonly stateMutability: "view";
256
264
  }, {
257
265
  readonly type: "function";
258
266
  readonly inputs: readonly [{
259
267
  readonly name: "";
260
- readonly internalType: "uint256";
261
- readonly type: "uint256";
268
+ readonly internalType: "bytes32";
269
+ readonly type: "bytes32";
262
270
  }];
263
- readonly name: "mintFeeListed";
271
+ readonly name: "nameOf";
264
272
  readonly outputs: readonly [{
265
273
  readonly name: "";
266
- readonly internalType: "bool";
267
- readonly type: "bool";
274
+ readonly internalType: "bytes32";
275
+ readonly type: "bytes32";
268
276
  }];
269
277
  readonly stateMutability: "view";
270
278
  }, {
271
279
  readonly type: "function";
272
280
  readonly inputs: readonly [{
273
281
  readonly name: "";
274
- readonly internalType: "bytes32";
275
- readonly type: "bytes32";
282
+ readonly internalType: "address";
283
+ readonly type: "address";
284
+ }, {
285
+ readonly name: "";
286
+ readonly internalType: "struct CPoolKey";
287
+ readonly type: "tuple";
288
+ readonly components: readonly [{
289
+ readonly name: "base";
290
+ readonly internalType: "address";
291
+ readonly type: "address";
292
+ }, {
293
+ readonly name: "quote";
294
+ readonly internalType: "address";
295
+ readonly type: "address";
296
+ }, {
297
+ readonly name: "tickSpacing";
298
+ readonly internalType: "int256";
299
+ readonly type: "int256";
300
+ }, {
301
+ readonly name: "policy";
302
+ readonly internalType: "address";
303
+ readonly type: "address";
304
+ }, {
305
+ readonly name: "swapFee";
306
+ readonly internalType: "uint256";
307
+ readonly type: "uint256";
308
+ }, {
309
+ readonly name: "mintFee";
310
+ readonly internalType: "uint256";
311
+ readonly type: "uint256";
312
+ }];
276
313
  }];
277
- readonly name: "nameOf";
314
+ readonly name: "onCInitialize";
278
315
  readonly outputs: readonly [{
279
316
  readonly name: "";
280
- readonly internalType: "bytes32";
281
- readonly type: "bytes32";
317
+ readonly internalType: "uint8";
318
+ readonly type: "uint8";
319
+ }, {
320
+ readonly name: "";
321
+ readonly internalType: "uint256";
322
+ readonly type: "uint256";
282
323
  }];
283
- readonly stateMutability: "view";
324
+ readonly stateMutability: "pure";
284
325
  }, {
285
326
  readonly type: "function";
286
327
  readonly inputs: readonly [{
@@ -299,10 +340,6 @@ export declare const fPolicyBaseAbi: readonly [{
299
340
  readonly name: "bases";
300
341
  readonly internalType: "address[]";
301
342
  readonly type: "address[]";
302
- }, {
303
- readonly name: "weights";
304
- readonly internalType: "uint256[]";
305
- readonly type: "uint256[]";
306
343
  }, {
307
344
  readonly name: "swapFee";
308
345
  readonly internalType: "uint256";
@@ -320,24 +357,16 @@ export declare const fPolicyBaseAbi: readonly [{
320
357
  readonly internalType: "bytes32";
321
358
  readonly type: "bytes32";
322
359
  }, {
323
- readonly name: "lnCapOverFloor";
324
- readonly internalType: "uint24";
325
- readonly type: "uint24";
360
+ readonly name: "mintFee";
361
+ readonly internalType: "uint256";
362
+ readonly type: "uint256";
326
363
  }];
327
- }, {
328
- readonly name: "mintFee";
329
- readonly internalType: "uint256";
330
- readonly type: "uint256";
331
364
  }];
332
365
  readonly name: "onInitialize";
333
366
  readonly outputs: readonly [{
334
367
  readonly name: "";
335
368
  readonly internalType: "uint8";
336
369
  readonly type: "uint8";
337
- }, {
338
- readonly name: "";
339
- readonly internalType: "uint256";
340
- readonly type: "uint256";
341
370
  }];
342
371
  readonly stateMutability: "nonpayable";
343
372
  }, {
@@ -428,7 +457,7 @@ export declare const fPolicyBaseAbi: readonly [{
428
457
  readonly internalType: "uint256";
429
458
  readonly type: "uint256";
430
459
  }, {
431
- readonly name: "protocolCut";
460
+ readonly name: "minQuoteRatio";
432
461
  readonly internalType: "uint256";
433
462
  readonly type: "uint256";
434
463
  }, {
@@ -493,25 +522,11 @@ export declare const fPolicyBaseAbi: readonly [{
493
522
  }, {
494
523
  readonly type: "function";
495
524
  readonly inputs: readonly [{
496
- readonly name: "curated";
497
- readonly internalType: "bool";
498
- readonly type: "bool";
499
- }];
500
- readonly name: "setCreatorCurated";
501
- readonly outputs: readonly [];
502
- readonly stateMutability: "nonpayable";
503
- }, {
504
- readonly type: "function";
505
- readonly inputs: readonly [{
506
- readonly name: "who";
525
+ readonly name: "cManager_";
507
526
  readonly internalType: "address";
508
527
  readonly type: "address";
509
- }, {
510
- readonly name: "listed";
511
- readonly internalType: "bool";
512
- readonly type: "bool";
513
528
  }];
514
- readonly name: "setCreatorListed";
529
+ readonly name: "setCManager";
515
530
  readonly outputs: readonly [];
516
531
  readonly stateMutability: "nonpayable";
517
532
  }, {
@@ -541,25 +556,21 @@ export declare const fPolicyBaseAbi: readonly [{
541
556
  }, {
542
557
  readonly type: "function";
543
558
  readonly inputs: readonly [{
544
- readonly name: "curated";
545
- readonly internalType: "bool";
546
- readonly type: "bool";
559
+ readonly name: "rate";
560
+ readonly internalType: "uint256";
561
+ readonly type: "uint256";
547
562
  }];
548
- readonly name: "setMintFeeCurated";
563
+ readonly name: "setIncomeTaxRate";
549
564
  readonly outputs: readonly [];
550
565
  readonly stateMutability: "nonpayable";
551
566
  }, {
552
567
  readonly type: "function";
553
568
  readonly inputs: readonly [{
554
- readonly name: "mintFee";
569
+ readonly name: "ratio";
555
570
  readonly internalType: "uint256";
556
571
  readonly type: "uint256";
557
- }, {
558
- readonly name: "listed";
559
- readonly internalType: "bool";
560
- readonly type: "bool";
561
572
  }];
562
- readonly name: "setMintFeeListed";
573
+ readonly name: "setMinQuoteRatio";
563
574
  readonly outputs: readonly [];
564
575
  readonly stateMutability: "nonpayable";
565
576
  }, {
@@ -602,18 +613,14 @@ export declare const fPolicyBaseAbi: readonly [{
602
613
  readonly stateMutability: "nonpayable";
603
614
  }, {
604
615
  readonly type: "function";
605
- readonly inputs: readonly [{
606
- readonly name: "_keepQuote";
607
- readonly internalType: "uint256";
608
- readonly type: "uint256";
609
- }, {
610
- readonly name: "_minQuoteAtSeed";
611
- readonly internalType: "uint256";
612
- readonly type: "uint256";
616
+ readonly inputs: readonly [];
617
+ readonly name: "sponsor";
618
+ readonly outputs: readonly [{
619
+ readonly name: "";
620
+ readonly internalType: "address";
621
+ readonly type: "address";
613
622
  }];
614
- readonly name: "setRules";
615
- readonly outputs: readonly [];
616
- readonly stateMutability: "nonpayable";
623
+ readonly stateMutability: "view";
617
624
  }, {
618
625
  readonly type: "event";
619
626
  readonly anonymous: false;
@@ -658,27 +665,12 @@ export declare const fPolicyBaseAbi: readonly [{
658
665
  readonly type: "event";
659
666
  readonly anonymous: false;
660
667
  readonly inputs: readonly [{
661
- readonly name: "curated";
662
- readonly internalType: "bool";
663
- readonly type: "bool";
664
- readonly indexed: false;
665
- }];
666
- readonly name: "CreatorCuratedSet";
667
- }, {
668
- readonly type: "event";
669
- readonly anonymous: false;
670
- readonly inputs: readonly [{
671
- readonly name: "creator";
668
+ readonly name: "manager";
672
669
  readonly internalType: "address";
673
670
  readonly type: "address";
674
671
  readonly indexed: true;
675
- }, {
676
- readonly name: "listed";
677
- readonly internalType: "bool";
678
- readonly type: "bool";
679
- readonly indexed: false;
680
672
  }];
681
- readonly name: "CreatorListed";
673
+ readonly name: "CManagerSet";
682
674
  }, {
683
675
  readonly type: "event";
684
676
  readonly anonymous: false;
@@ -708,27 +700,22 @@ export declare const fPolicyBaseAbi: readonly [{
708
700
  readonly type: "event";
709
701
  readonly anonymous: false;
710
702
  readonly inputs: readonly [{
711
- readonly name: "curated";
712
- readonly internalType: "bool";
713
- readonly type: "bool";
703
+ readonly name: "rate";
704
+ readonly internalType: "uint256";
705
+ readonly type: "uint256";
714
706
  readonly indexed: false;
715
707
  }];
716
- readonly name: "MintFeeCuratedSet";
708
+ readonly name: "IncomeTaxRateSet";
717
709
  }, {
718
710
  readonly type: "event";
719
711
  readonly anonymous: false;
720
712
  readonly inputs: readonly [{
721
- readonly name: "mintFee";
713
+ readonly name: "ratio";
722
714
  readonly internalType: "uint256";
723
715
  readonly type: "uint256";
724
- readonly indexed: true;
725
- }, {
726
- readonly name: "listed";
727
- readonly internalType: "bool";
728
- readonly type: "bool";
729
716
  readonly indexed: false;
730
717
  }];
731
- readonly name: "MintFeeListed";
718
+ readonly name: "MinQuoteRatioSet";
732
719
  }, {
733
720
  readonly type: "event";
734
721
  readonly anonymous: false;
@@ -769,21 +756,6 @@ export declare const fPolicyBaseAbi: readonly [{
769
756
  readonly indexed: false;
770
757
  }];
771
758
  readonly name: "QuoteListed";
772
- }, {
773
- readonly type: "event";
774
- readonly anonymous: false;
775
- readonly inputs: readonly [{
776
- readonly name: "keepQuote";
777
- readonly internalType: "uint256";
778
- readonly type: "uint256";
779
- readonly indexed: false;
780
- }, {
781
- readonly name: "minQuoteAtSeed";
782
- readonly internalType: "uint256";
783
- readonly type: "uint256";
784
- readonly indexed: false;
785
- }];
786
- readonly name: "RulesSet";
787
759
  }, {
788
760
  readonly type: "error";
789
761
  readonly inputs: readonly [];
@@ -792,14 +764,6 @@ export declare const fPolicyBaseAbi: readonly [{
792
764
  readonly type: "error";
793
765
  readonly inputs: readonly [];
794
766
  readonly name: "BadRate";
795
- }, {
796
- readonly type: "error";
797
- readonly inputs: readonly [{
798
- readonly name: "creator";
799
- readonly internalType: "address";
800
- readonly type: "address";
801
- }];
802
- readonly name: "CreatorNotListed";
803
767
  }, {
804
768
  readonly type: "error";
805
769
  readonly inputs: readonly [{
@@ -808,14 +772,6 @@ export declare const fPolicyBaseAbi: readonly [{
808
772
  readonly type: "uint256";
809
773
  }];
810
774
  readonly name: "FeeNotListed";
811
- }, {
812
- readonly type: "error";
813
- readonly inputs: readonly [{
814
- readonly name: "mintFee";
815
- readonly internalType: "uint256";
816
- readonly type: "uint256";
817
- }];
818
- readonly name: "MintFeeNotListed";
819
775
  }, {
820
776
  readonly type: "error";
821
777
  readonly inputs: readonly [];
@@ -836,6 +792,10 @@ export declare const fPolicyBaseAbi: readonly [{
836
792
  readonly type: "error";
837
793
  readonly inputs: readonly [];
838
794
  readonly name: "NotRegistry";
795
+ }, {
796
+ readonly type: "error";
797
+ readonly inputs: readonly [];
798
+ readonly name: "NotSponsor";
839
799
  }, {
840
800
  readonly type: "error";
841
801
  readonly inputs: readonly [];
@@ -877,7 +837,7 @@ export interface FPoolState {
877
837
  L: bigint;
878
838
  /** The swap fee, WAD (`phi` before F version 25, decisions 059). 0 is no fee (F version 26, decisions 065), admitted only if the policy lists it. */
879
839
  swapFee: bigint;
880
- /** The pool's mint fee, WAD of newly-minted L: proposed at birth, the policy's answer from its menu (F version 26, decisions 065). */
840
+ /** The pool's mint fee, WAD of newly-minted L: the creator-selected key field, fixed for life (F 38, decision 078): `2 * swapFee <= mintFee <= MINT_FEE_MAX`. */
881
841
  mintFee: bigint;
882
842
  /** θ₀, the reference log floor: where the floor stood at the seed (re-based by a capital harvest and at each step); income is counted from it. `theta0` before F version 25. */
883
843
  refLogFloor: bigint;
@@ -888,13 +848,13 @@ export interface FPoolState {
888
848
  /** This generation's income still in the pool, quote: L·(θ₀ − θ). */
889
849
  unharvested: bigint;
890
850
  /**
891
- * The common cap as a log distance (decisions 061): ln(cap price / floor price) in 1e-6 log units,
892
- * the key's `lnCapOverFloor`; 0 is uncapped (cap ∞). Leverage at the floor is 1/(1 − e^{−value}):
893
- * {@link fPoolLeverageOfCap}.
851
+ * The pool's one cap as a log ratio (decisions 061, 075): ln(cap price / seed price) in 1e-6 log units, set by the
852
+ * generation's `deployLiquidity`; each asset's maximum price is its own seed price times it. 0 is uncapped (cap ∞).
853
+ * The liquidity per unit of base value is 1/(1 − e^{−value}): {@link fPoolLeverageOfCap}.
894
854
  */
895
- lnCapOverFloor: number;
855
+ lnCapOverSeed: number;
896
856
  /** Σ = ∫ Σ_j w_j (dx_j)², accrued even though the fee is fixed — the kernel stays calculable. */
897
- bigSigma: bigint;
857
+ realizedVariance: bigint;
898
858
  /**
899
859
  * The pool's policy: the contract the key names, holding the pool's roles
900
860
  * and answering every question the manager does not decide itself. Read its roles with
@@ -909,12 +869,13 @@ export interface FPoolState {
909
869
  restructureTime: number;
910
870
  /** What the pool is — its POLICY's self-description; see {@link FPoolKind}. */
911
871
  kind: FPoolKind;
912
- /** False before the first seed — and between a retire and the next one. */
872
+ /** False before the first `deployLiquidity` — and between a `close` and the next one. */
913
873
  seeded: boolean;
914
874
  /**
915
- * The live GENERATION. Every retire freezes one into a bundle its shares redeem
916
- * ({@link fPoolRedeem}) and opens the next; since F version 21 so does every `regenerate`
917
- * (the generation step, {@link fPoolRegenerate}): the carried holder and the dead shares go on
875
+ * The live GENERATION. Every `close` freezes one into a bundle its shares redeem
876
+ * ({@link fPoolRedeem}) and opens the next; so does every `regenerate`
877
+ * (the generation step, {@link fPoolRegenerate}) and every live-pool `deployLiquidity`
878
+ * ({@link fPoolDeploy}): the carried holder and the dead shares go on
918
879
  * as `gen + 1`, every other holder of `gen` is frozen out into its bundle. The share id carries
919
880
  * it ({@link fPoolShareId}), so generations `0 … gen-1` are claims ({@link fPoolClaimsOf}) and
920
881
  * `gen` is the pool. On a pad, `gen` is the graduation count — the rung.
@@ -968,13 +929,18 @@ export interface FPoolRoles {
968
929
  authority: Address;
969
930
  /** The proposed next authority, until it accepts — zero when nothing is pending. */
970
931
  pendingAuthority: Address;
932
+ /** The desk's optional pool operator (decision 073): one delegate besides the authority, zero when none. */
971
933
  operator: Address;
972
- pendingOperator: Address;
973
934
  gateMint: boolean;
974
- gateSwap: boolean;
935
+ /** The desk's swap admission (decision 073): open to all, listed takers/minters only, or one cached executor. */
936
+ swapMode: FPoolSwapMode;
937
+ /** The executor in `executor` mode, zero otherwise. */
938
+ swapExecutor: Address;
975
939
  /** The policy's own ceiling on a harvest now — the bid ({@link FPoolDescription.harvestable}) narrowed by the policy's rule. */
976
940
  maxHarvest: bigint;
977
941
  }
942
+ /** `PrivatePolicy.SwapMode`: Open = 0, Listed = 1, Executor = 2. */
943
+ export type FPoolSwapMode = "open" | "listed" | "executor";
978
944
  /** Read a pool's roles from its policy. `state` saves the `getPool` round trip when already in hand. */
979
945
  export declare function getFPoolRoles(c: LogswapClient, poolId: Hex, state?: Pick<FPoolState, "policy" | "kind">): Promise<FPoolRoles>;
980
946
  /** Which of the two products a pool is configured as — a pad is a launch, anything else a basket/pool. A UI has to choose what to render. */
@@ -994,12 +960,12 @@ export interface FPoolDescription {
994
960
  /**
995
961
  * The most a harvest may take now by the MANAGER's rule: the bid, `Q` once seeded (0 before).
996
962
  * The manager's `harvestable()` getter was cut in F version 21; this is the same number, read
997
- * off `getPool`. The policy may allow less (a pad: the income; a POL: above `keepQuote`) —
963
+ * off `getPool`. The policy may allow less (a pad: the income; a POL: above `minQuoteRatio`·L) —
998
964
  * {@link FPoolRoles.maxHarvest}.
999
965
  */
1000
966
  harvestable: bigint;
1001
- /** The dead shares' banked dividend — a pad's pot, the creator's income until a rung is climbed. */
1002
- pot: bigint;
967
+ /** The dead shares' banked dividend — a pad's income, the creator's until a rung is climbed (decision 085: formerly the pot). */
968
+ income: bigint;
1003
969
  }
1004
970
  export declare function describeFPool(c: LogswapClient, s: FPoolState): Promise<FPoolDescription>;
1005
971
  /** `p_j = e^{x_j}`, lossy the way any float conversion is. Compare in log space when it matters. */
@@ -1162,7 +1128,7 @@ export declare function fPoolPreviewRollIn(c: LogswapClient, poolId: Hex, gen: b
1162
1128
  }>;
1163
1129
  /**
1164
1130
  * Remove quote, lifting θ — price-neutral, no base moves, and a DIVIDEND to
1165
- * every share: the amount goes into the pool's pot and each holder's slice is settled lazily on
1131
+ * every share: the amount goes into the pool's held income and each holder's slice is settled lazily on
1166
1132
  * their next transfer, mint or burn, or pulled with {@link fPoolClaim}. The sponsor's own slice —
1167
1133
  * its shares' and the locked seed's at 0xdead — is pushed to `to` at once. On a pad
1168
1134
  * the lift stops at the seed floor θ₀ (income only); nothing else bounds it — an
@@ -1317,28 +1283,16 @@ export declare function fPoolQuoteSwap(c: LogswapClient, a: {
1317
1283
  }): Promise<bigint>;
1318
1284
  export interface FPoolCreateArgs {
1319
1285
  quote: Address;
1320
- /** Legs in any order; sorted (with weights and marks kept aligned) before the call. */
1286
+ /** The pool's assets, in any order; sorted into the key's canonical order before the call. The set is fixed for the pool's life. */
1321
1287
  bases: Address[];
1322
- /** WAD each; must sum to 1e18 — validated here so the revert is readable. */
1323
- weights: bigint[];
1324
- /** The swap fee, WAD (`phi` before F version 25). The base-for-base fee is pinned at 2φ on-chain. A curated policy admits only its listed tiers (decisions 059). */
1288
+ /** The swap fee, WAD. The base-for-base fee is pinned at 2φ on-chain. A curated policy admits only its listed tiers (decisions 059). */
1325
1289
  swapFee: bigint;
1326
1290
  /**
1327
- * The pool's mint fee, WAD of newly-minted L — the creator's pick from the policy's menu (F version
1328
- * 26, decisions 065; a curated menu refuses anything else with `MintFeeNotListed`). Defaults to
1329
- * {@link presetMintFee}: twice the swap fee, capped at `FEE_MAX`.
1291
+ * The pool's mint fee, WAD of newly-minted L — the creator's pick, a key field fixed for life (F 38, decision
1292
+ * 078): `2 * swapFee <= mintFee <= MINT_FEE_MAX`, checked by the manager (`BadParam`). Defaults to
1293
+ * {@link presetMintFee}: twice the swap fee.
1330
1294
  */
1331
1295
  mintFee?: bigint;
1332
- /**
1333
- * The common cap as a log distance (decisions 061): ln(cap price / floor price) in 1e-6 log units,
1334
- * the key's `lnCapOverFloor`; 0 or absent is uncapped (cap ∞). Pass `lnCapOverFloor` or `leverage`, not both.
1335
- */
1336
- lnCapOverFloor?: number;
1337
- /**
1338
- * The leverage at the floor λ (decisions 061), converted to `lnCapOverFloor` by {@link fPoolCapOfLeverage}:
1339
- * 1 is uncapped (cap ∞, `lnCapOverFloor` 0), 2 puts the cap at twice the floor price.
1340
- */
1341
- leverage?: number;
1342
1296
  /**
1343
1297
  * Which of the protocol's four the pool is — see {@link FPoolKind}. NOT a key field (decisions
1344
1298
  * 049: the manager knows no kind): it selects the deployment's policy of that kind when `policy`
@@ -1370,35 +1324,34 @@ export declare function sortFPoolLegs<T>(bases: Address[], ...companions: T[][])
1370
1324
  bases: Address[];
1371
1325
  companions: T[][];
1372
1326
  };
1373
- /** The key as the manager hashes it: legs sorted, the kind's policy filled in when none is named; no kind in it (049). */
1374
1327
  /**
1375
1328
  * The tuple an F pool's id hashes — `src/types/FPoolKey.sol`, field order load-bearing (it is
1376
1329
  * the ABI encoding order). Stored by the manager at `initialize` and never in calldata again,
1377
- * except `PolicyRegistry.migrate` (F version 20), which is handed it to check against the id.
1330
+ * except `PolicyRegistry.migrate`, which is handed it to check against the id. Since F 38 it holds no weights and no
1331
+ * cap: those belong to a generation's `deployLiquidity` (decision 075), and the mint fee is part of identity (078).
1378
1332
  */
1379
1333
  export interface FPoolKey {
1380
1334
  quote: Address;
1381
- /** Sorted ascending, unique. */
1335
+ /** Sorted ascending, unique; fixed for the pool's life. */
1382
1336
  bases: Address[];
1383
- /** WAD, aligned with `bases`, summing to 1e18. */
1384
- weights: bigint[];
1385
1337
  swapFee: bigint;
1386
1338
  /** The policy AT BIRTH — not the live one after a move. */
1387
1339
  policy: Address;
1388
1340
  creator: Address;
1389
1341
  salt: Hex;
1390
- /** The common cap as ln(cap price / floor price), in 1e-6 log units; 0 uncapped, cap ∞ (decisions 061). Appended in F version 25 as `cap`; renamed in F version 27 (no id moved). */
1391
- lnCapOverFloor: number;
1342
+ /** The creator-selected mint fee, WAD, fixed for life: `2 * swapFee <= mintFee <= MINT_FEE_MAX`. */
1343
+ mintFee: bigint;
1392
1344
  }
1393
1345
  /**
1394
1346
  * An F pool's id: `keccak256(abi.encode(key))`, offline — what `initialize` computes inline. The
1395
1347
  * manager's `idOf(FPoolKey)` getter was cut in F version 21; this is the same hash (checked
1396
1348
  * against Foundry's encoder and the local deployment's pools in the tests). The key must be the
1397
- * one the pool was initialized with: legs sorted ({@link fPoolKeyOf} sorts them), the birth policy.
1349
+ * one the pool was initialized with: bases sorted ({@link fPoolKeyOf} sorts them), the birth policy.
1398
1350
  */
1399
1351
  export declare function fPoolIdOfKey(key: FPoolKey): Hex;
1352
+ /** The key as the manager hashes it: bases sorted, the kind's policy filled in when none is named, the mint fee preset when none is given. No kind in it (049). */
1400
1353
  export declare function fPoolKeyOf(c: LogswapClient, a: Omit<FPoolCreateArgs, "account">): FPoolKey;
1401
- /** Create the pool (no funds move — `seed` arms it). Returns the tx hash; read the id with `fPoolIdOf`. */
1354
+ /** Create the pool (no funds move — `deployLiquidity` funds it). Returns the tx hash; read the id with `fPoolIdOf`. */
1402
1355
  export declare function fPoolInitialize(c: LogswapClient, a: FPoolCreateArgs): Promise<`0x${string}`>;
1403
1356
  /**
1404
1357
  * The pool id is the key's hash — pure, so it can be read before or after creation. Computed
@@ -1418,153 +1371,170 @@ export declare function fPoolKeyOfPool(c: LogswapClient, poolId: Hex, opts?: {
1418
1371
  indexer?: string;
1419
1372
  }): Promise<FPoolKey>;
1420
1373
  /**
1421
- * The reserve a leg holds at a mark: `R = Lj·e^{−x}`, WAD math. The seed names RESERVES —
1422
- * the sponsor states holdings and the price follows, `p = Lj / R` — so this is
1423
- * the one conversion from a price to what the pool will hold, done here, on the way in. Float
1424
- * precision (~1e-16 relative) is what a seed needs: any reserve is a legal seed, and the mark
1374
+ * The reserve a leg holds at a mark: `R = Lj·e^{−x}`, WAD math. A deployment names the TOTAL base
1375
+ * reserve and the price that values it, and the price follows from the pair, `p = Lj / R` — so this is
1376
+ * the one conversion from a wanted mark to what the pool will hold, done here, on the way in. Float
1377
+ * precision (~1e-16 relative) is what a deployment needs: any reserve is legal, and the mark
1425
1378
  * the pool derives from it is the one the sponsor meant to within that.
1426
1379
  */
1427
1380
  export declare function fPoolReserveAt(Lj: bigint, x: bigint, k?: number): bigint;
1428
1381
  /**
1429
- * The seed's cap constant k = e^{Q0/L0 − d} (decisions 061): every leg's phantom is c_j = r_j·k/(1 − k).
1430
- * 0 on an uncapped pool. Throws when the seed would be priced at or above its cap (Q0/L0 ≥ d), which
1431
- * the manager refuses.
1382
+ * The cap constant k = e^{−lnCapOverSeed} (decisions 061, 075): every leg's phantom is c_j = r_j·k/(1 − k), and the
1383
+ * generation's liquidity is its base value over 1 − k. 0 on an uncapped pool. It no longer depends on the bid:
1384
+ * the cap is a ratio of the cap price to each asset's own seed price.
1432
1385
  */
1433
- export declare function fPoolCapK(lnCapOverFloor: number, Q0: bigint, L0: bigint): number;
1386
+ export declare function fPoolCapK(lnCapOverSeed: number): number;
1434
1387
  /**
1435
- * The key's `lnCapOverFloor` = ln(cap/floor) (1e-6 log units) for a leverage λ at the floor: ln(λ/(λ − 1))
1436
- * (decisions 061), so λ = 1/(1 − floor/cap) and the cap sits λ/(λ − 1) × the floor — λ = 2 puts it at twice.
1437
- * **λ = 1 is uncapped**: cap ∞, `lnCapOverFloor` 0. A λ under 1, or one so close to
1388
+ * The pool's `lnCapOverSeed` = ln(cap price / seed price) (1e-6 log units) for a leverage λ: ln(λ/(λ − 1))
1389
+ * (decisions 061), so λ = 1/(1 − seed/cap) = L / (base value) and the cap sits λ/(λ − 1) × the seed price — λ = 2
1390
+ * puts it at twice. **λ = 1 is uncapped**: cap ∞, `lnCapOverSeed` 0. A λ under 1, or one so close to
1438
1391
  * 1 (or so large) that d leaves a uint24 of 1e-6 units, is refused.
1439
1392
  */
1440
1393
  export declare function fPoolCapOfLeverage(lambda: number): number;
1441
- /** The leverage at the floor λ = 1/(1 − e^{−x}) for x = `lnCapOverFloor` (1e-6 log units); 1 for an uncapped pool (cap ∞). */
1442
- export declare function fPoolLeverageOfCap(lnCapOverFloor: number): number;
1443
- /** A pool's leverage, ready to tag: `capped` false and `capOverFloor` Infinity for an uncapped pool. */
1394
+ /** The leverage λ = 1/(1 − e^{−x}) for x = `lnCapOverSeed` (1e-6 log units); 1 for an uncapped pool (cap ∞). */
1395
+ export declare function fPoolLeverageOfCap(lnCapOverSeed: number): number;
1396
+ /** A pool's leverage, ready to tag: `capped` false and `capOverSeed` Infinity for an uncapped pool. */
1444
1397
  export interface FPoolLeverage {
1445
- /** λ at the floor; exactly 1 when uncapped. */
1398
+ /** λ at the seed; exactly 1 when uncapped. */
1446
1399
  lambda: number;
1447
1400
  capped: boolean;
1448
- /** The cap's price over the floor's, e^d = λ/(λ − 1): 2 at λ = 2; Infinity when uncapped. */
1449
- capOverFloor: number;
1401
+ /** The cap's price over the seed's, e^d = λ/(λ − 1): 2 at λ = 2; Infinity when uncapped. */
1402
+ capOverSeed: number;
1450
1403
  /** "1×" uncapped; otherwise λ to two decimals, trailing zeros dropped ("2×", "1.5×"), never "1×" for a capped pool ("1.01×" at least shown as "≈1×"). */
1451
1404
  label: string;
1452
1405
  }
1453
1406
  /**
1454
- * The leverage tag of a pool from its key's `lnCapOverFloor` (decisions 061): `1×` means no cap — the only way a tag
1407
+ * The leverage tag of a pool from its `lnCapOverSeed` (decisions 061): `1×` means no cap — the only way a tag
1455
1408
  * reads 1× — and a capped pool always reads above it, so the two can never be confused on screen.
1456
1409
  */
1457
- export declare function fPoolLeverage(lnCapOverFloor: number): FPoolLeverage;
1458
- /** The key's `lnCapOverFloor` from creation args: as given, else from `leverage`, else 0 (uncapped, cap ∞). Both given and disagreeing is refused. */
1410
+ export declare function fPoolLeverage(lnCapOverSeed: number): FPoolLeverage;
1411
+ /** The `lnCapOverSeed` from deployment args: as given, else from `leverage`, else 0 (uncapped, cap ∞). Both given and disagreeing is refused. */
1459
1412
  export declare function fPoolCapOfArgs(a: {
1460
- lnCapOverFloor?: number;
1413
+ lnCapOverSeed?: number;
1461
1414
  leverage?: number;
1462
1415
  }): number;
1463
1416
  /**
1464
- * Arm the pool: deposit `r0[j]` of each base plus `Q0` of quote against exposure `L0`. Pass either
1465
- * the reserves outright (`r0`) or the marks the pool should open at (`x0`, converted here with
1466
- * {@link fPoolReserveAt} against the key's weights). Authority-only on-chain (an open seed lets
1467
- * anyone front-run the creator for the strike). Arrays align with the SORTED bases — use
1468
- * {@link sortFPoolLegs} on (bases, weights, x0) together when building forms.
1417
+ * One entry of `deployLiquidity`'s input (F 38, decision 084): the TOTAL base reserve the asset has after the call
1418
+ * (0 leaves it out) and the price that values it, quote atomic units per base atomic unit, 1e36-scaled.
1469
1419
  */
1470
- export declare function fPoolSeed(c: LogswapClient, a: {
1471
- poolId: Hex;
1420
+ export interface BaseAsset {
1421
+ base: Address;
1422
+ amount: bigint;
1423
+ priceX36: bigint;
1424
+ }
1425
+ /** The book a deployment names, from the sponsor's terms: weights, total liquidity `L0`, and either the wanted marks `x0` or the reserves `r0`. */
1426
+ export type FPoolBookSpec = {
1427
+ /** The pool's assets, in any order; the result is sorted into the key's order. */
1428
+ bases: Address[];
1429
+ /** WAD, one per asset, summing to 1e18; 0 leaves the asset out (not in generation 0). `L_j = w_j · L0`. */
1430
+ weights: bigint[];
1431
+ /** The book's total liquidity, quote units. */
1472
1432
  L0: bigint;
1473
- Q0: bigint;
1474
- account: Address;
1433
+ /** The pool's one cap, or the leverage it stands for; absent is uncapped. */
1434
+ lnCapOverSeed?: number;
1435
+ leverage?: number;
1475
1436
  } & ({
1476
- r0: bigint[];
1477
- } | {
1478
1437
  x0: bigint[];
1479
- weights: bigint[];
1480
- })): Promise<`0x${string}`>;
1438
+ } | {
1439
+ r0: bigint[];
1440
+ });
1481
1441
  /**
1482
- * Retire the live generation — the raw entry (`dissolve` before F
1483
- * version 14). Allowed only at an empty bid, Q ≤ L/1e9, on every pool: the market took it, or the
1484
- * operator harvested it out first ({@link fPoolRetire} does both in one transaction). The live
1485
- * (S, Q, R_j) become a frozen bundle every share of this generation redeems ({@link fPoolRedeem})
1486
- * or rolls ({@link fPoolRollIn}), forever; the pool is unseeded until the next {@link fPoolSeed},
1487
- * which opens generation `gen + 1` under the same id, policy, roles, gates and lists.
1442
+ * The `baseAssets` (and cap) a deployment sends for a wanted book — what the old seed did with reserves and
1443
+ * marks, as the amounts and prices the manager takes now. Per asset: the reserve `r_j` (given as `r0`, or
1444
+ * {@link fPoolReserveAt} the wanted mark `x0`) and the price that makes its value `L_j · (1 − k)`:
1445
+ * `priceX36 = ceil(L_j(1 − k) · 1e36 / r_j)`. A zero weight is an asset left out. Sorted by base address, the
1446
+ * key's order, with the companions carried along.
1488
1447
  */
1489
- export declare function fPoolRetireRaw(c: LogswapClient, a: {
1448
+ export declare function fPoolBook(a: FPoolBookSpec): {
1449
+ baseAssets: BaseAsset[];
1450
+ lnCapOverSeed: number;
1451
+ };
1452
+ /**
1453
+ * The allocation a `deployLiquidity` book implies: asset `j`'s value `amount_j · priceX36_j / 1e36` over the sum,
1454
+ * normalized as the manager does it (cumulative shares, floored), so the weights sum to exactly 1e18. A zero-value
1455
+ * book has no allocation (`[]`). What an indexer derives from `LiquidityDeployed` instead of reading the weights.
1456
+ */
1457
+ export declare function fPoolBookWeights(baseAssets: readonly BaseAsset[]): bigint[];
1458
+ /**
1459
+ * The book's total liquidity `L` from a `LiquidityDeployed` input: the values' sum over `1 − k`, `k = e^{−cap}`.
1460
+ * Exact when uncapped; with a cap it carries the float error of `k` (~1e-16 relative) — read the pool for the wei.
1461
+ */
1462
+ export declare function fPoolBookL(baseAssets: readonly BaseAsset[], lnCapOverSeed: number): bigint;
1463
+ /**
1464
+ * Put liquidity into the pool, the authority's: `deployLiquidity` (F 38, decisions 083, 084). It SETS THE BOOK:
1465
+ * `baseAssets[j].amount` is the total base reserve of asset `j` after the call (0 removes it), `quoteAmount` the
1466
+ * total bid, and the manager settles each figure against what the pool holds — a larger total is pulled from the
1467
+ * caller, a smaller one pushed to `to` — so one call can replace an asset by another. Pass the book outright
1468
+ * (`baseAssets`, `lnCapOverSeed`) or the sponsor's terms ({@link fPoolBook}: `weights`, `L0` and marks `x0` or
1469
+ * reserves `r0`, in any order). On an UNFUNDED pool (new, or after {@link fPoolClose}) it funds the first or the next
1470
+ * generation. On a LIVE pool it is a regeneration that sets the book: income settles to `to`, the policy picks the
1471
+ * carried holder, every other holder is frozen into the closing generation's bundle ({@link fPoolRedeem}), and the
1472
+ * carried book becomes the one named, at the supplied prices. A pad is forward-only ({@link fPoolRegenerate}).
1473
+ */
1474
+ export declare function fPoolDeploy(c: LogswapClient, a: {
1475
+ poolId: Hex;
1476
+ quoteAmount: bigint;
1477
+ to?: Address;
1478
+ account: Address;
1479
+ } & ({
1480
+ baseAssets: BaseAsset[];
1481
+ lnCapOverSeed: number;
1482
+ } | FPoolBookSpec)): Promise<`0x${string}`>;
1483
+ /**
1484
+ * Close the pool — the raw entry (`retire` before F 38). Allowed only at an empty bid, Q ≤ L/1e9, on every pool but a
1485
+ * pad: the market took it, or the operator harvested it out first ({@link fPoolClose} does both in one transaction).
1486
+ * Income settles to `to` first. The live (S, Q, R_j) become a frozen bundle every share of this generation redeems
1487
+ * ({@link fPoolRedeem}), forever; the pool is unfunded until the next {@link fPoolDeploy}, which opens generation
1488
+ * `gen + 1` under the same id, policy, roles, gates and lists. Whoever runs the pool.
1489
+ */
1490
+ export declare function fPoolCloseRaw(c: LogswapClient, a: {
1490
1491
  poolId: Hex;
1492
+ to?: Address;
1491
1493
  account: Address;
1492
1494
  }): Promise<`0x${string}`>;
1493
1495
  /**
1494
- * Retire the live generation as ONE transaction: the harvest that empties the bid
1496
+ * Close the pool as ONE transaction: the harvest that empties the bid
1495
1497
  * ({@link fPoolEmptyingHarvests} — a dividend to every share; none when it is already empty),
1496
- * then `retire` — the manager's `multicall`, the operator as sender. What a sponsor's
1497
- * "retire" button should call. Throws before sending on a pad: a pad never retires (F version 21).
1498
+ * then `close` — the manager's `multicall`, the operator as sender. What a sponsor's "close" button
1499
+ * should call. Throws before sending on a pad: a pad never closes.
1498
1500
  */
1499
- export declare function fPoolRetire(c: LogswapClient, a: {
1501
+ export declare function fPoolClose(c: LogswapClient, a: {
1500
1502
  poolId: Hex;
1503
+ to?: Address;
1501
1504
  account: Address;
1502
1505
  }): Promise<`0x${string}`>;
1503
1506
  /**
1504
- * The harvests that empty an unlocked pool's bid, in order — what a relaunch sends before its
1505
- * `retire` (a retire needs an empty bid on every pool). Since F version 14 one
1506
- * `harvest(Q)` does it: the protocol's cut leaves the pool with the amount (with no treasury
1507
- * there is no cut). `[]` when the bid is already empty. Throws on a pad (F version 21: a pad
1508
- * never retires, whatever its bid), and when the pool's policy keeps a floor on the bid
1509
- * (`PolPolicy.keepQuote`): a `retire` under that policy waits for the market.
1507
+ * The harvests that empty an unlocked pool's bid, in order — what a close sends before its
1508
+ * `close` (a close needs an empty bid on every pool). One `harvest(Q)` does it: the income tax leaves the pool with
1509
+ * the income part (with no treasury there is none). `[]` when the bid is already empty. Throws on a pad (a pad
1510
+ * never closes, whatever its bid), and when the pool's policy keeps a floor on the bid
1511
+ * (`PolPolicy.minQuoteRatio`): a `close` under that policy waits for the market.
1510
1512
  */
1511
1513
  export declare function fPoolEmptyingHarvests(c: LogswapClient, poolId: Hex): Promise<bigint[]>;
1512
1514
  /**
1513
- * The GENERATION STEP (F version 21) — on a pad, its graduation. The manager harvests the
1514
- * generation's income first, releases the dead shares' pot, and asks the policy
1515
+ * The GENERATION STEP — on a pad, its graduation (F 38: `deployLiquidity` with nothing changed). The manager
1516
+ * harvests the generation's income first, releases the dead shares' income, and asks the policy
1515
1517
  * (`onRegenerate`), whose {@link FPolicyTerms} name a `carried` holder. Then, for live
1516
1518
  * generation `g`:
1517
1519
  *
1518
1520
  * - the carried holder's and the dead shares' `g` shares are re-minted 1:1 as `g + 1`: they go on
1519
1521
  * as the pool;
1520
- * - every OTHER holder of `g` is frozen out pro rata into generation `g`'s bundle (`Retired(g, …)`)
1522
+ * - every OTHER holder of `g` is frozen out pro rata into generation `g`'s bundle (`GenerationRetired`)
1521
1523
  * and redeems it with {@link fPoolRedeem} / rolls it with {@link fPoolRollIn} (`gen: g`); their
1522
1524
  * dividends on `g` stay claimable ({@link fPoolClaim} with `gen: g`). {@link fPoolClaimsOf}
1523
1525
  * lists them;
1524
- * - the pot, all in quote (decisions 057): `toPayee` to the payee, `protocolCut` to the treasury,
1525
- * `burn` spent buying base at the curve and burning it (the price up, the floor held), and the
1526
- * rest into the bid (the floor down). No share is minted; L does not move.
1526
+ * - the income released (`IncomeReleased`), all in quote: `toPayee` to the payee and the rest into the bid
1527
+ * (the floor down). No share is minted; L does not move. The book keeps its reserves, marks and cap.
1527
1528
  *
1528
1529
  * A pad's gate is `threshold(poolId, gen)`, in its quote (`PadPolicy.NotGraduated` below it); POL and private carry the
1529
- * authority and send it the whole pot; a public pool refuses (`Refused`). A carried holder with no
1530
- * share is `BadTerms`. Whoever runs the pool.
1530
+ * authority and send it the whole income; a public pool refuses (`Refused`). A carried holder with no
1531
+ * share is `BadTerms`. Whoever runs the pool. To change the book (reserves, prices, cap) use {@link fPoolDeploy}.
1531
1532
  */
1532
1533
  export declare function fPoolRegenerate(c: LogswapClient, a: {
1533
1534
  poolId: Hex;
1534
1535
  to?: Address;
1535
1536
  account: Address;
1536
1537
  }): Promise<`0x${string}`>;
1537
- /**
1538
- * The relaunch as ONE transaction: `harvest` the bid out — a
1539
- * dividend to every share, {@link fPoolEmptyingHarvests} — `retire` the live generation at the
1540
- * empty bid, `redeem` the caller's own shares of it (when `shares` > 0), optionally `setLegs` the
1541
- * next generation's composition (`legs`: a private pool's reshape — retire, admit, reweight), and
1542
- * `seed` it with what came back — the manager's `multicall`, one sender throughout, the same
1543
- * pool. The operator's when one is appointed and the seed's inventory is its own; by default the
1544
- * authority's. The policy, its roles, gates, allowlist and the name carry over; anything else goes
1545
- * in `extra`, pre-encoded against {@link fPoolManagerAbi}. The seed names reserves (decisions
1546
- * 029): `r0` outright — one per leg of the NEXT table, 0 for a retired leg — or `x0` marks
1547
- * against the next table's `weights`.
1548
- */
1549
- export declare function fPoolRelaunch(c: LogswapClient, a: {
1550
- poolId: Hex;
1551
- /** the caller's shares of the retiring generation to redeem inside the batch — its whole balance, usually; 0 to keep the claim */
1552
- shares: bigint;
1553
- L0: bigint;
1554
- Q0: bigint;
1555
- /** the next generation's composition: one weight per existing leg (0 retires it), then one per new base */
1556
- legs?: {
1557
- weights: bigint[];
1558
- newBases?: Address[];
1559
- };
1560
- extra?: Hex[];
1561
- account: Address;
1562
- } & ({
1563
- r0: bigint[];
1564
- } | {
1565
- x0: bigint[];
1566
- weights: bigint[];
1567
- })): Promise<`0x${string}`>;
1568
1538
  /** Where a pad's seed lives: `seed` mints every share of a pad here itself. */
1569
1539
  export declare const DEAD_ADDRESS: Address;
1570
1540
  /** The manager's `MIN_SHARES`: the seed mints this much to 0xdead on every pool, the rest to the seeder — or, on a pad, to 0xdead too. */
@@ -1591,9 +1561,15 @@ export interface FPoolGenesisTransfer {
1591
1561
  amount: bigint;
1592
1562
  }
1593
1563
  export interface FPoolLaunchArgs extends Omit<FPoolCreateArgs, "account"> {
1564
+ /** WAD, one per asset (in `bases` order), summing to 1e18; `L_j = w_j · L0`. The generation's allocation (F 38: not in the key). */
1565
+ weights: bigint[];
1566
+ /** The generation's total liquidity, quote units. */
1594
1567
  L0: bigint;
1595
- /** Quote the seed pulls. A pad seeds at 0 — pure float, a resting ask, nothing raised. */
1596
- Q0: bigint;
1568
+ /** The pool's one cap as ln(cap price / seed price), 1e-6 log units, or the leverage it stands for; absent is uncapped. A pad is always uncapped (`PadUncapped`). */
1569
+ lnCapOverSeed?: number;
1570
+ leverage?: number;
1571
+ /** The bid the deployment pulls (`quoteAmount`). A pad deploys at 0 — pure float, a resting ask, nothing raised. */
1572
+ quoteAmount: bigint;
1597
1573
  /**
1598
1574
  * An opening buy of leg `j` (an index into `bases` AS GIVEN) for `amountIn` of quote, ON THE
1599
1575
  * MANAGER — the same sender, a plain allowance to the manager, the router nowhere near it. A
@@ -1725,11 +1701,22 @@ export declare function fPoolAcceptAuthority(c: LogswapClient, a: {
1725
1701
  account: Address;
1726
1702
  policy?: Address;
1727
1703
  }): Promise<`0x${string}`>;
1728
- /** Turn the mint / swap gates on or off (the authority, on the desk's policy). `burn` is never gated. */
1729
- export declare function fPoolSetGates(c: LogswapClient, a: {
1704
+ /**
1705
+ * Set the desk's swap admission (the authority, on the desk's policy; decision 073): `open`, `listed` (the minters and takers
1706
+ * lists) or `executor` (one address, cached on the manager, no policy call per swap). `executor` is required in `executor` mode
1707
+ * and must be omitted otherwise. Preserves mint admission. `burn` is never gated.
1708
+ */
1709
+ export declare function fPoolSetSwapMode(c: LogswapClient, a: {
1710
+ poolId: Hex;
1711
+ mode: FPoolSwapMode;
1712
+ executor?: Address;
1713
+ account: Address;
1714
+ policy?: Address;
1715
+ }): Promise<`0x${string}`>;
1716
+ /** Turn mint admission on or off (the authority, on the desk's policy), preserving the swap mode and its executor. */
1717
+ export declare function fPoolSetMintGate(c: LogswapClient, a: {
1730
1718
  poolId: Hex;
1731
- gateMint: boolean;
1732
- gateSwap: boolean;
1719
+ gated: boolean;
1733
1720
  account: Address;
1734
1721
  policy?: Address;
1735
1722
  }): Promise<`0x${string}`>;
@@ -1781,39 +1768,19 @@ export declare function fPoolSetSponsorName(c: LogswapClient, a: {
1781
1768
  export declare function fPoolSponsorName(c: LogswapClient, who: Address): Promise<string>;
1782
1769
  /** The registry the manager asks at every birth — `addresses.policyRegistry`, else the manager's word; zero on a bare deployment. */
1783
1770
  export declare function fPoolRegistryOf(c: LogswapClient): Promise<Address>;
1784
- /** Who runs the pool: the appointed operator, or the authority until one is. */
1785
- export declare function fPoolOperatorOf(s: Pick<FPoolRoles, "authority" | "operator">): Address;
1771
+ /** Who may run the pool (decision 073): the authority always, and the optional delegate. */
1772
+ export declare function fPoolRunners(s: Pick<FPoolRoles, "authority" | "operator">): Address[];
1786
1773
  /**
1787
- * Propose the operator (the authority, on the desk's policy) — the hot key that runs the pool:
1788
- * `harvest`, `retire`, `regenerate`, `setLegs`. Two-step: the proposed address takes the role with
1789
- * {@link fPoolAcceptOperator}. The zero address clears at once — the role returns to the authority.
1774
+ * Grant, replace or revoke the pool operator (the authority, on the desk's policy; decision 073): one optional delegate who may
1775
+ * `harvest`, `retire`, `regenerate` and `setLegs` besides the authority. Immediate, with no acceptance step, so check the
1776
+ * address; the zero address revokes. A handover or a policy move clears it.
1790
1777
  */
1791
- export declare function fPoolAppointOperator(c: LogswapClient, a: {
1778
+ export declare function fPoolSetPoolOperator(c: LogswapClient, a: {
1792
1779
  poolId: Hex;
1793
1780
  operator: Address;
1794
1781
  account: Address;
1795
1782
  policy?: Address;
1796
1783
  }): Promise<`0x${string}`>;
1797
- /** The proposed operator takes the role. */
1798
- export declare function fPoolAcceptOperator(c: LogswapClient, a: {
1799
- poolId: Hex;
1800
- account: Address;
1801
- policy?: Address;
1802
- }): Promise<`0x${string}`>;
1803
- /**
1804
- * The next generation's composition (operator; private pools only; ONLY while the pool is
1805
- * unseeded — between a retire and the seed that prices it). `weights` has one
1806
- * entry per leg the pool has ever had, in index order (0 retires a leg; indices are never reused),
1807
- * then one per base in `newBases`, appended; they sum to 1e18 exactly. No value moves: the
1808
- * following {@link fPoolSeed} names every reserve. A live reshape is {@link fPoolRelaunch} with
1809
- * `legs` set.
1810
- */
1811
- export declare function fPoolSetLegs(c: LogswapClient, a: {
1812
- poolId: Hex;
1813
- weights: bigint[];
1814
- newBases?: Address[];
1815
- account: Address;
1816
- }): Promise<`0x${string}`>;
1817
1784
  /**
1818
1785
  * Move shares (ERC-6909 `transfer`) — to another holder, or to `0xdead` to lock them for good.
1819
1786
  * Burning to the dead address is a sponsor's way to make its liquidity permanent: the shares can
@@ -1830,10 +1797,13 @@ export interface DiscoveredFPool {
1830
1797
  poolId: Hex;
1831
1798
  quote: Address;
1832
1799
  bases: Address[];
1800
+ /** The generation-0 allocation, from the pool's first `LiquidityDeployed` ({@link fPoolBookWeights}); `[]` until it is deployed — F 38 keeps no weights in the key. */
1833
1801
  weights: bigint[];
1834
1802
  swapFee: bigint;
1835
- /** The common cap as ln(cap price / floor price), in 1e-6 log units; 0 uncapped, cap ∞ (decisions 061). */
1836
- lnCapOverFloor: number;
1803
+ /** The creator-selected mint fee, fixed for life (F 38, decision 078). */
1804
+ mintFee: bigint;
1805
+ /** The generation-0 cap as ln(cap price / seed price), in 1e-6 log units; 0 uncapped, cap ∞ (decisions 061); 0 until deployed. */
1806
+ lnCapOverSeed: number;
1837
1807
  kind: FPoolKind;
1838
1808
  /** The pool's policy AT BIRTH — the contract the key names. The LIVE one is {@link getFPool}'s `policy`: the registry's owner may have moved the pool (046, `PolicyMigrated`). */
1839
1809
  policy: Address;
@@ -1841,7 +1811,7 @@ export interface DiscoveredFPool {
1841
1811
  creator: Address;
1842
1812
  /** The block the pool was initialized in — its age, for annualising realized income. */
1843
1813
  block: bigint;
1844
- /** Whether `seed` has run; an unseeded pool has no floor and no float, so nothing to show. */
1814
+ /** Whether `deployLiquidity` has run; an unfunded pool has no floor and no float, so nothing to show. */
1845
1815
  seeded: boolean;
1846
1816
  /** The quote the pool was born with. Zero is the launchpad's signature. */
1847
1817
  q0: bigint;
@@ -1855,8 +1825,8 @@ export interface DiscoveredFPool {
1855
1825
  }
1856
1826
  /**
1857
1827
  * Every F pool ever created, from `PoolCreated` logs alone — plus one `kind()` read per distinct
1858
- * policy, cached. Possible only because the event carries the full key preimage (bases,
1859
- * weights, swapFee, policy, lnCapOverFloor) — the poolId is a hash and could never be inverted; contracts PR #17
1828
+ * policy, cached. Possible only because the event carries the full key preimage (quote, creator, bases,
1829
+ * swapFee, policy, mintFee) — the poolId is a hash and could never be inverted; contracts PR #17
1860
1830
  * exists for exactly this call. With `indexer`, the logs come from it (the node when it fails):
1861
1831
  * a scan from block 0 per call is what made the first load wait on the node.
1862
1832
  */
@@ -1880,38 +1850,38 @@ export type FPoolRules = {
1880
1850
  gen: number;
1881
1851
  /** @deprecated Equal to {@link gen} since F version 21, kept for callers; read `gen`. */
1882
1852
  rung: number;
1883
- /** The pot the next graduation needs, in the pad's quote: `PadPolicy.threshold(poolId, gen)` (T(0) is per quote, decision 070). */
1853
+ /** The income the next graduation needs, in the pad's quote: `PadPolicy.threshold(poolId, gen)` (T(0) is per quote, decision 070). */
1884
1854
  threshold: bigint;
1885
- pot: bigint;
1886
- /** This pad's split, recorded at its birth from the key's salt and never changed (decisions 056, 057, 067): the creator's cut of the pot and the protocol's, fractions of the pot. The rest deepens the bid; nothing is bought or burnt (067). */
1855
+ /** The dead shares' income held for the next graduation, in the pad's quote. */
1856
+ income: bigint;
1857
+ /** This pad's creator share, recorded at its birth from the key's salt and never changed (decisions 056, 057, 067): a fraction of the income released. The rest deepens the bid; nothing is bought or burnt (067). */
1887
1858
  creatorShare: bigint;
1888
- protocolShare: bigint;
1859
+ /** The income tax the dead shares pay on their own new income dividend (decisions 073, 085), WAD. */
1860
+ incomeTaxRate: bigint;
1889
1861
  /** The ranges the LOG Authority set on the policy NOW for the pads born after this read: what a new creator may choose. */
1890
1862
  ranges: PadRanges;
1891
1863
  } | {
1892
- kind: "pol";
1893
- keepQuote: bigint;
1894
- minQuoteAtSeed: bigint;
1864
+ kind: "pol"; /** The reserve a harvest leaves in the bid and a redeployment must keep, a multiple of L (WAD). */
1865
+ minQuoteRatio: bigint; /** The income tax the pool's authority pays on its own new income dividend (decisions 073, 085), WAD. */
1866
+ incomeTaxRate: bigint;
1895
1867
  } | {
1896
1868
  kind: "public";
1897
- curated: boolean;
1898
1869
  } | {
1899
1870
  kind: "private";
1900
1871
  gateMint: boolean;
1901
- gateSwap: boolean;
1872
+ swapMode: FPoolSwapMode;
1873
+ swapExecutor: Address;
1902
1874
  operator: Address;
1903
1875
  };
1904
- /** The LOG Authority's range on a pad's creator choice (`PadPolicy`, decisions 056, 067), WAD fractions of the pot. */
1876
+ /** The LOG Authority's range on a pad's creator choice (`PadPolicy`, decisions 056, 067), WAD fractions of the income released. */
1905
1877
  export interface PadRanges {
1906
- /** The protocol's share of the pot, recorded into each pad at birth. */
1907
- protocolShare: bigint;
1908
1878
  creatorShareMin: bigint;
1909
1879
  /** At most the F manager's `PAYEE_CUT_MAX` (50%), which bounds a pad's payee whatever the policy (067). */
1910
1880
  creatorShareMax: bigint;
1911
1881
  }
1912
1882
  /**
1913
1883
  * The salt that carries a pad's split (`PadPolicy.pack(creatorShare, nonce)`, decisions 056, 067): `creatorShare` in the top 64
1914
- * bits (a WAD fraction of the pot), zero in the next 64 — the burn share's place before F version 28, refused by the policy if
1884
+ * bits (a WAD fraction of the income), zero in the next 64 — the burn share's place before F version 28, refused by the policy if
1915
1885
  * set — and a nonce in the low 128 that tells two otherwise identical pads apart. It is part of the pool's identity, so it is
1916
1886
  * chosen at launch (`FPoolLaunchArgs.salt`) and never changes; the policy refuses a cut outside its range.
1917
1887
  */
@@ -1955,7 +1925,7 @@ export declare function fPoolShareHolders(c: LogswapClient, poolIdHex: Hex, opts
1955
1925
  /**
1956
1926
  * What a policy answers `onRegenerate` with: `IFPolicy.Terms` — four words, exactly 128 bytes since F version 28 (decision 067
1957
1927
  * removed `burn`). `carried` is the holder the next generation carries beside the dead shares; on a pad the manager requires
1958
- * `0xdead` and caps `toPayee` at `PAYEE_CUT_MAX` of the pot.
1928
+ * `0xdead` and caps `toPayee` at `PAYEE_CUT_MAX` of the income.
1959
1929
  */
1960
1930
  export interface FPolicyTerms {
1961
1931
  payee: Address;
@@ -1963,7 +1933,7 @@ export interface FPolicyTerms {
1963
1933
  protocolCut: bigint;
1964
1934
  carried: Address;
1965
1935
  }
1966
- /** Every F pool's raw state in one lens call (the manager's `Pool` struct: quote, swapFee, policy, seeded, gen, n, restructureTime, asks, lnCapOverFloor, Q, bigSigma, L, shares, refLogFloor). */
1936
+ /** Every F pool's raw state in one lens call (the manager's `Pool` struct: quote, swapFee, policy, seeded, gen, n, restructureTime, asks, lnCapOverSeed, Q, realizedVariance, L, shares, refLogFloor). */
1967
1937
  export declare function getFPoolsRaw(c: LogswapClient, poolIds: Hex[]): Promise<readonly unknown[]>;
1968
1938
  /** Share value from the lens — (L + Q)/shares, WAD per share — the same figure as `fPoolShareValue`, from one source. */
1969
1939
  export declare function shareValueOnChain(c: LogswapClient, poolId: Hex): Promise<bigint>;