@logswap/sdk 0.5.80 → 0.5.82
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/README.md +35 -14
- package/dist/admin.d.ts +18 -47
- package/dist/admin.js +13 -31
- package/dist/client.d.ts +2 -2
- package/dist/client.js +13 -2
- package/dist/fpool.d.ts +174 -270
- package/dist/fpool.js +191 -175
- package/dist/generated.d.ts +484 -734
- package/dist/generated.js +251 -476
- package/dist/history.js +14 -3
- package/dist/indexer.d.ts +1 -1
- package/dist/indexer.js +3 -2
- package/dist/keys.d.ts +17 -1
- package/dist/keys.js +16 -0
- package/dist/liquidity.d.ts +0 -5
- package/dist/liquidity.js +1 -2
- package/dist/pools.d.ts +5 -8
- package/dist/pools.js +7 -7
- package/dist/positions.d.ts +4 -5
- package/dist/positions.js +6 -7
- package/dist/views.d.ts +6 -10
- package/dist/views.js +6 -6
- package/package.json +1 -1
- package/src/admin.ts +14 -36
- package/src/client.ts +13 -2
- package/src/fpool.ts +267 -245
- package/src/generated.ts +251 -476
- package/src/history.ts +17 -3
- package/src/indexer.ts +4 -3
- package/src/keys.ts +26 -1
- package/src/liquidity.ts +1 -7
- package/src/pools.ts +9 -11
- package/src/positions.ts +6 -7
- package/src/views.ts +12 -16
package/dist/fpool.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
131
131
|
readonly internalType: "bytes32";
|
|
132
132
|
readonly type: "bytes32";
|
|
133
133
|
}];
|
|
134
|
-
readonly name: "
|
|
134
|
+
readonly name: "incomeTax";
|
|
135
135
|
readonly outputs: readonly [{
|
|
136
136
|
readonly name: "";
|
|
137
137
|
readonly internalType: "address";
|
|
@@ -145,7 +145,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
145
145
|
}, {
|
|
146
146
|
readonly type: "function";
|
|
147
147
|
readonly inputs: readonly [];
|
|
148
|
-
readonly name: "
|
|
148
|
+
readonly name: "incomeTaxRate";
|
|
149
149
|
readonly outputs: readonly [{
|
|
150
150
|
readonly name: "";
|
|
151
151
|
readonly internalType: "uint256";
|
|
@@ -261,30 +261,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
261
261
|
readonly type: "uint256";
|
|
262
262
|
}];
|
|
263
263
|
readonly stateMutability: "view";
|
|
264
|
-
}, {
|
|
265
|
-
readonly type: "function";
|
|
266
|
-
readonly inputs: readonly [];
|
|
267
|
-
readonly name: "mintFeeCurated";
|
|
268
|
-
readonly outputs: readonly [{
|
|
269
|
-
readonly name: "";
|
|
270
|
-
readonly internalType: "bool";
|
|
271
|
-
readonly type: "bool";
|
|
272
|
-
}];
|
|
273
|
-
readonly stateMutability: "view";
|
|
274
|
-
}, {
|
|
275
|
-
readonly type: "function";
|
|
276
|
-
readonly inputs: readonly [{
|
|
277
|
-
readonly name: "";
|
|
278
|
-
readonly internalType: "uint256";
|
|
279
|
-
readonly type: "uint256";
|
|
280
|
-
}];
|
|
281
|
-
readonly name: "mintFeeListed";
|
|
282
|
-
readonly outputs: readonly [{
|
|
283
|
-
readonly name: "";
|
|
284
|
-
readonly internalType: "bool";
|
|
285
|
-
readonly type: "bool";
|
|
286
|
-
}];
|
|
287
|
-
readonly stateMutability: "view";
|
|
288
264
|
}, {
|
|
289
265
|
readonly type: "function";
|
|
290
266
|
readonly inputs: readonly [{
|
|
@@ -307,7 +283,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
307
283
|
readonly type: "address";
|
|
308
284
|
}, {
|
|
309
285
|
readonly name: "";
|
|
310
|
-
readonly internalType: "struct
|
|
286
|
+
readonly internalType: "struct CPoolKey";
|
|
311
287
|
readonly type: "tuple";
|
|
312
288
|
readonly components: readonly [{
|
|
313
289
|
readonly name: "base";
|
|
@@ -329,11 +305,11 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
329
305
|
readonly name: "swapFee";
|
|
330
306
|
readonly internalType: "uint256";
|
|
331
307
|
readonly type: "uint256";
|
|
308
|
+
}, {
|
|
309
|
+
readonly name: "mintFee";
|
|
310
|
+
readonly internalType: "uint256";
|
|
311
|
+
readonly type: "uint256";
|
|
332
312
|
}];
|
|
333
|
-
}, {
|
|
334
|
-
readonly name: "";
|
|
335
|
-
readonly internalType: "uint256";
|
|
336
|
-
readonly type: "uint256";
|
|
337
313
|
}];
|
|
338
314
|
readonly name: "onCInitialize";
|
|
339
315
|
readonly outputs: readonly [{
|
|
@@ -344,10 +320,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
344
320
|
readonly name: "";
|
|
345
321
|
readonly internalType: "uint256";
|
|
346
322
|
readonly type: "uint256";
|
|
347
|
-
}, {
|
|
348
|
-
readonly name: "";
|
|
349
|
-
readonly internalType: "uint256";
|
|
350
|
-
readonly type: "uint256";
|
|
351
323
|
}];
|
|
352
324
|
readonly stateMutability: "pure";
|
|
353
325
|
}, {
|
|
@@ -368,10 +340,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
368
340
|
readonly name: "bases";
|
|
369
341
|
readonly internalType: "address[]";
|
|
370
342
|
readonly type: "address[]";
|
|
371
|
-
}, {
|
|
372
|
-
readonly name: "weights";
|
|
373
|
-
readonly internalType: "uint256[]";
|
|
374
|
-
readonly type: "uint256[]";
|
|
375
343
|
}, {
|
|
376
344
|
readonly name: "swapFee";
|
|
377
345
|
readonly internalType: "uint256";
|
|
@@ -389,24 +357,16 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
389
357
|
readonly internalType: "bytes32";
|
|
390
358
|
readonly type: "bytes32";
|
|
391
359
|
}, {
|
|
392
|
-
readonly name: "
|
|
393
|
-
readonly internalType: "
|
|
394
|
-
readonly type: "
|
|
360
|
+
readonly name: "mintFee";
|
|
361
|
+
readonly internalType: "uint256";
|
|
362
|
+
readonly type: "uint256";
|
|
395
363
|
}];
|
|
396
|
-
}, {
|
|
397
|
-
readonly name: "mintFee";
|
|
398
|
-
readonly internalType: "uint256";
|
|
399
|
-
readonly type: "uint256";
|
|
400
364
|
}];
|
|
401
365
|
readonly name: "onInitialize";
|
|
402
366
|
readonly outputs: readonly [{
|
|
403
367
|
readonly name: "";
|
|
404
368
|
readonly internalType: "uint8";
|
|
405
369
|
readonly type: "uint8";
|
|
406
|
-
}, {
|
|
407
|
-
readonly name: "";
|
|
408
|
-
readonly internalType: "uint256";
|
|
409
|
-
readonly type: "uint256";
|
|
410
370
|
}];
|
|
411
371
|
readonly stateMutability: "nonpayable";
|
|
412
372
|
}, {
|
|
@@ -600,7 +560,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
600
560
|
readonly internalType: "uint256";
|
|
601
561
|
readonly type: "uint256";
|
|
602
562
|
}];
|
|
603
|
-
readonly name: "
|
|
563
|
+
readonly name: "setIncomeTaxRate";
|
|
604
564
|
readonly outputs: readonly [];
|
|
605
565
|
readonly stateMutability: "nonpayable";
|
|
606
566
|
}, {
|
|
@@ -613,30 +573,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
613
573
|
readonly name: "setMinQuoteRatio";
|
|
614
574
|
readonly outputs: readonly [];
|
|
615
575
|
readonly stateMutability: "nonpayable";
|
|
616
|
-
}, {
|
|
617
|
-
readonly type: "function";
|
|
618
|
-
readonly inputs: readonly [{
|
|
619
|
-
readonly name: "curated";
|
|
620
|
-
readonly internalType: "bool";
|
|
621
|
-
readonly type: "bool";
|
|
622
|
-
}];
|
|
623
|
-
readonly name: "setMintFeeCurated";
|
|
624
|
-
readonly outputs: readonly [];
|
|
625
|
-
readonly stateMutability: "nonpayable";
|
|
626
|
-
}, {
|
|
627
|
-
readonly type: "function";
|
|
628
|
-
readonly inputs: readonly [{
|
|
629
|
-
readonly name: "mintFee";
|
|
630
|
-
readonly internalType: "uint256";
|
|
631
|
-
readonly type: "uint256";
|
|
632
|
-
}, {
|
|
633
|
-
readonly name: "listed";
|
|
634
|
-
readonly internalType: "bool";
|
|
635
|
-
readonly type: "bool";
|
|
636
|
-
}];
|
|
637
|
-
readonly name: "setMintFeeListed";
|
|
638
|
-
readonly outputs: readonly [];
|
|
639
|
-
readonly stateMutability: "nonpayable";
|
|
640
576
|
}, {
|
|
641
577
|
readonly type: "function";
|
|
642
578
|
readonly inputs: readonly [{
|
|
@@ -769,7 +705,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
769
705
|
readonly type: "uint256";
|
|
770
706
|
readonly indexed: false;
|
|
771
707
|
}];
|
|
772
|
-
readonly name: "
|
|
708
|
+
readonly name: "IncomeTaxRateSet";
|
|
773
709
|
}, {
|
|
774
710
|
readonly type: "event";
|
|
775
711
|
readonly anonymous: false;
|
|
@@ -780,31 +716,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
780
716
|
readonly indexed: false;
|
|
781
717
|
}];
|
|
782
718
|
readonly name: "MinQuoteRatioSet";
|
|
783
|
-
}, {
|
|
784
|
-
readonly type: "event";
|
|
785
|
-
readonly anonymous: false;
|
|
786
|
-
readonly inputs: readonly [{
|
|
787
|
-
readonly name: "curated";
|
|
788
|
-
readonly internalType: "bool";
|
|
789
|
-
readonly type: "bool";
|
|
790
|
-
readonly indexed: false;
|
|
791
|
-
}];
|
|
792
|
-
readonly name: "MintFeeCuratedSet";
|
|
793
|
-
}, {
|
|
794
|
-
readonly type: "event";
|
|
795
|
-
readonly anonymous: false;
|
|
796
|
-
readonly inputs: readonly [{
|
|
797
|
-
readonly name: "mintFee";
|
|
798
|
-
readonly internalType: "uint256";
|
|
799
|
-
readonly type: "uint256";
|
|
800
|
-
readonly indexed: true;
|
|
801
|
-
}, {
|
|
802
|
-
readonly name: "listed";
|
|
803
|
-
readonly internalType: "bool";
|
|
804
|
-
readonly type: "bool";
|
|
805
|
-
readonly indexed: false;
|
|
806
|
-
}];
|
|
807
|
-
readonly name: "MintFeeListed";
|
|
808
719
|
}, {
|
|
809
720
|
readonly type: "event";
|
|
810
721
|
readonly anonymous: false;
|
|
@@ -861,14 +772,6 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
861
772
|
readonly type: "uint256";
|
|
862
773
|
}];
|
|
863
774
|
readonly name: "FeeNotListed";
|
|
864
|
-
}, {
|
|
865
|
-
readonly type: "error";
|
|
866
|
-
readonly inputs: readonly [{
|
|
867
|
-
readonly name: "mintFee";
|
|
868
|
-
readonly internalType: "uint256";
|
|
869
|
-
readonly type: "uint256";
|
|
870
|
-
}];
|
|
871
|
-
readonly name: "MintFeeNotListed";
|
|
872
775
|
}, {
|
|
873
776
|
readonly type: "error";
|
|
874
777
|
readonly inputs: readonly [];
|
|
@@ -934,7 +837,7 @@ export interface FPoolState {
|
|
|
934
837
|
L: bigint;
|
|
935
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. */
|
|
936
839
|
swapFee: bigint;
|
|
937
|
-
/** The pool's mint fee, WAD of newly-minted L:
|
|
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`. */
|
|
938
841
|
mintFee: bigint;
|
|
939
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. */
|
|
940
843
|
refLogFloor: bigint;
|
|
@@ -945,11 +848,11 @@ export interface FPoolState {
|
|
|
945
848
|
/** This generation's income still in the pool, quote: L·(θ₀ − θ). */
|
|
946
849
|
unharvested: bigint;
|
|
947
850
|
/**
|
|
948
|
-
* The
|
|
949
|
-
*
|
|
950
|
-
* {@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}.
|
|
951
854
|
*/
|
|
952
|
-
|
|
855
|
+
lnCapOverSeed: number;
|
|
953
856
|
/** Σ = ∫ Σ_j w_j (dx_j)², accrued even though the fee is fixed — the kernel stays calculable. */
|
|
954
857
|
realizedVariance: bigint;
|
|
955
858
|
/**
|
|
@@ -966,12 +869,13 @@ export interface FPoolState {
|
|
|
966
869
|
restructureTime: number;
|
|
967
870
|
/** What the pool is — its POLICY's self-description; see {@link FPoolKind}. */
|
|
968
871
|
kind: FPoolKind;
|
|
969
|
-
/** False before the first
|
|
872
|
+
/** False before the first `deployLiquidity` — and between a `close` and the next one. */
|
|
970
873
|
seeded: boolean;
|
|
971
874
|
/**
|
|
972
|
-
* The live GENERATION. Every
|
|
973
|
-
* ({@link fPoolRedeem}) and opens the next;
|
|
974
|
-
* (the generation step, {@link fPoolRegenerate})
|
|
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
|
|
975
879
|
* as `gen + 1`, every other holder of `gen` is frozen out into its bundle. The share id carries
|
|
976
880
|
* it ({@link fPoolShareId}), so generations `0 … gen-1` are claims ({@link fPoolClaimsOf}) and
|
|
977
881
|
* `gen` is the pool. On a pad, `gen` is the graduation count — the rung.
|
|
@@ -1060,8 +964,8 @@ export interface FPoolDescription {
|
|
|
1060
964
|
* {@link FPoolRoles.maxHarvest}.
|
|
1061
965
|
*/
|
|
1062
966
|
harvestable: bigint;
|
|
1063
|
-
/** The dead shares' banked dividend — a pad's
|
|
1064
|
-
|
|
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;
|
|
1065
969
|
}
|
|
1066
970
|
export declare function describeFPool(c: LogswapClient, s: FPoolState): Promise<FPoolDescription>;
|
|
1067
971
|
/** `p_j = e^{x_j}`, lossy the way any float conversion is. Compare in log space when it matters. */
|
|
@@ -1224,7 +1128,7 @@ export declare function fPoolPreviewRollIn(c: LogswapClient, poolId: Hex, gen: b
|
|
|
1224
1128
|
}>;
|
|
1225
1129
|
/**
|
|
1226
1130
|
* Remove quote, lifting θ — price-neutral, no base moves, and a DIVIDEND to
|
|
1227
|
-
* every share: the amount goes into the pool's
|
|
1131
|
+
* every share: the amount goes into the pool's held income and each holder's slice is settled lazily on
|
|
1228
1132
|
* their next transfer, mint or burn, or pulled with {@link fPoolClaim}. The sponsor's own slice —
|
|
1229
1133
|
* its shares' and the locked seed's at 0xdead — is pushed to `to` at once. On a pad
|
|
1230
1134
|
* the lift stops at the seed floor θ₀ (income only); nothing else bounds it — an
|
|
@@ -1379,28 +1283,16 @@ export declare function fPoolQuoteSwap(c: LogswapClient, a: {
|
|
|
1379
1283
|
}): Promise<bigint>;
|
|
1380
1284
|
export interface FPoolCreateArgs {
|
|
1381
1285
|
quote: Address;
|
|
1382
|
-
/**
|
|
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. */
|
|
1383
1287
|
bases: Address[];
|
|
1384
|
-
/** WAD
|
|
1385
|
-
weights: bigint[];
|
|
1386
|
-
/** 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). */
|
|
1387
1289
|
swapFee: bigint;
|
|
1388
1290
|
/**
|
|
1389
|
-
* The pool's mint fee, WAD of newly-minted L — the creator's pick
|
|
1390
|
-
*
|
|
1391
|
-
* {@link presetMintFee}: twice the swap fee
|
|
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.
|
|
1392
1294
|
*/
|
|
1393
1295
|
mintFee?: bigint;
|
|
1394
|
-
/**
|
|
1395
|
-
* The common cap as a log distance (decisions 061): ln(cap price / floor price) in 1e-6 log units,
|
|
1396
|
-
* the key's `lnCapOverFloor`; 0 or absent is uncapped (cap ∞). Pass `lnCapOverFloor` or `leverage`, not both.
|
|
1397
|
-
*/
|
|
1398
|
-
lnCapOverFloor?: number;
|
|
1399
|
-
/**
|
|
1400
|
-
* The leverage at the floor λ (decisions 061), converted to `lnCapOverFloor` by {@link fPoolCapOfLeverage}:
|
|
1401
|
-
* 1 is uncapped (cap ∞, `lnCapOverFloor` 0), 2 puts the cap at twice the floor price.
|
|
1402
|
-
*/
|
|
1403
|
-
leverage?: number;
|
|
1404
1296
|
/**
|
|
1405
1297
|
* Which of the protocol's four the pool is — see {@link FPoolKind}. NOT a key field (decisions
|
|
1406
1298
|
* 049: the manager knows no kind): it selects the deployment's policy of that kind when `policy`
|
|
@@ -1432,35 +1324,34 @@ export declare function sortFPoolLegs<T>(bases: Address[], ...companions: T[][])
|
|
|
1432
1324
|
bases: Address[];
|
|
1433
1325
|
companions: T[][];
|
|
1434
1326
|
};
|
|
1435
|
-
/** The key as the manager hashes it: legs sorted, the kind's policy filled in when none is named; no kind in it (049). */
|
|
1436
1327
|
/**
|
|
1437
1328
|
* The tuple an F pool's id hashes — `src/types/FPoolKey.sol`, field order load-bearing (it is
|
|
1438
1329
|
* the ABI encoding order). Stored by the manager at `initialize` and never in calldata again,
|
|
1439
|
-
* except `PolicyRegistry.migrate
|
|
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).
|
|
1440
1332
|
*/
|
|
1441
1333
|
export interface FPoolKey {
|
|
1442
1334
|
quote: Address;
|
|
1443
|
-
/** Sorted ascending, unique. */
|
|
1335
|
+
/** Sorted ascending, unique; fixed for the pool's life. */
|
|
1444
1336
|
bases: Address[];
|
|
1445
|
-
/** WAD, aligned with `bases`, summing to 1e18. */
|
|
1446
|
-
weights: bigint[];
|
|
1447
1337
|
swapFee: bigint;
|
|
1448
1338
|
/** The policy AT BIRTH — not the live one after a move. */
|
|
1449
1339
|
policy: Address;
|
|
1450
1340
|
creator: Address;
|
|
1451
1341
|
salt: Hex;
|
|
1452
|
-
/** The
|
|
1453
|
-
|
|
1342
|
+
/** The creator-selected mint fee, WAD, fixed for life: `2 * swapFee <= mintFee <= MINT_FEE_MAX`. */
|
|
1343
|
+
mintFee: bigint;
|
|
1454
1344
|
}
|
|
1455
1345
|
/**
|
|
1456
1346
|
* An F pool's id: `keccak256(abi.encode(key))`, offline — what `initialize` computes inline. The
|
|
1457
1347
|
* manager's `idOf(FPoolKey)` getter was cut in F version 21; this is the same hash (checked
|
|
1458
1348
|
* against Foundry's encoder and the local deployment's pools in the tests). The key must be the
|
|
1459
|
-
* one the pool was initialized with:
|
|
1349
|
+
* one the pool was initialized with: bases sorted ({@link fPoolKeyOf} sorts them), the birth policy.
|
|
1460
1350
|
*/
|
|
1461
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). */
|
|
1462
1353
|
export declare function fPoolKeyOf(c: LogswapClient, a: Omit<FPoolCreateArgs, "account">): FPoolKey;
|
|
1463
|
-
/** Create the pool (no funds move — `
|
|
1354
|
+
/** Create the pool (no funds move — `deployLiquidity` funds it). Returns the tx hash; read the id with `fPoolIdOf`. */
|
|
1464
1355
|
export declare function fPoolInitialize(c: LogswapClient, a: FPoolCreateArgs): Promise<`0x${string}`>;
|
|
1465
1356
|
/**
|
|
1466
1357
|
* The pool id is the key's hash — pure, so it can be read before or after creation. Computed
|
|
@@ -1480,153 +1371,170 @@ export declare function fPoolKeyOfPool(c: LogswapClient, poolId: Hex, opts?: {
|
|
|
1480
1371
|
indexer?: string;
|
|
1481
1372
|
}): Promise<FPoolKey>;
|
|
1482
1373
|
/**
|
|
1483
|
-
* The reserve a leg holds at a mark: `R = Lj·e^{−x}`, WAD math.
|
|
1484
|
-
* the
|
|
1485
|
-
* the one conversion from a
|
|
1486
|
-
* precision (~1e-16 relative) is what a
|
|
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
|
|
1487
1378
|
* the pool derives from it is the one the sponsor meant to within that.
|
|
1488
1379
|
*/
|
|
1489
1380
|
export declare function fPoolReserveAt(Lj: bigint, x: bigint, k?: number): bigint;
|
|
1490
1381
|
/**
|
|
1491
|
-
* The
|
|
1492
|
-
*
|
|
1493
|
-
* the
|
|
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.
|
|
1494
1385
|
*/
|
|
1495
|
-
export declare function fPoolCapK(
|
|
1386
|
+
export declare function fPoolCapK(lnCapOverSeed: number): number;
|
|
1496
1387
|
/**
|
|
1497
|
-
* The
|
|
1498
|
-
* (decisions 061), so λ = 1/(1 −
|
|
1499
|
-
* **λ = 1 is uncapped**: cap ∞, `
|
|
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
|
|
1500
1391
|
* 1 (or so large) that d leaves a uint24 of 1e-6 units, is refused.
|
|
1501
1392
|
*/
|
|
1502
1393
|
export declare function fPoolCapOfLeverage(lambda: number): number;
|
|
1503
|
-
/** The leverage
|
|
1504
|
-
export declare function fPoolLeverageOfCap(
|
|
1505
|
-
/** A pool's leverage, ready to tag: `capped` false and `
|
|
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. */
|
|
1506
1397
|
export interface FPoolLeverage {
|
|
1507
|
-
/** λ at the
|
|
1398
|
+
/** λ at the seed; exactly 1 when uncapped. */
|
|
1508
1399
|
lambda: number;
|
|
1509
1400
|
capped: boolean;
|
|
1510
|
-
/** The cap's price over the
|
|
1511
|
-
|
|
1401
|
+
/** The cap's price over the seed's, e^d = λ/(λ − 1): 2 at λ = 2; Infinity when uncapped. */
|
|
1402
|
+
capOverSeed: number;
|
|
1512
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×"). */
|
|
1513
1404
|
label: string;
|
|
1514
1405
|
}
|
|
1515
1406
|
/**
|
|
1516
|
-
* The leverage tag of a pool from its
|
|
1407
|
+
* The leverage tag of a pool from its `lnCapOverSeed` (decisions 061): `1×` means no cap — the only way a tag
|
|
1517
1408
|
* reads 1× — and a capped pool always reads above it, so the two can never be confused on screen.
|
|
1518
1409
|
*/
|
|
1519
|
-
export declare function fPoolLeverage(
|
|
1520
|
-
/** The
|
|
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. */
|
|
1521
1412
|
export declare function fPoolCapOfArgs(a: {
|
|
1522
|
-
|
|
1413
|
+
lnCapOverSeed?: number;
|
|
1523
1414
|
leverage?: number;
|
|
1524
1415
|
}): number;
|
|
1525
1416
|
/**
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1528
|
-
* {@link fPoolReserveAt} against the key's weights). Authority-only on-chain (an open seed lets
|
|
1529
|
-
* anyone front-run the creator for the strike). Arrays align with the SORTED bases — use
|
|
1530
|
-
* {@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.
|
|
1531
1419
|
*/
|
|
1532
|
-
export
|
|
1533
|
-
|
|
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. */
|
|
1534
1432
|
L0: bigint;
|
|
1535
|
-
|
|
1536
|
-
|
|
1433
|
+
/** The pool's one cap, or the leverage it stands for; absent is uncapped. */
|
|
1434
|
+
lnCapOverSeed?: number;
|
|
1435
|
+
leverage?: number;
|
|
1537
1436
|
} & ({
|
|
1538
|
-
r0: bigint[];
|
|
1539
|
-
} | {
|
|
1540
1437
|
x0: bigint[];
|
|
1541
|
-
|
|
1542
|
-
|
|
1438
|
+
} | {
|
|
1439
|
+
r0: bigint[];
|
|
1440
|
+
});
|
|
1543
1441
|
/**
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1546
|
-
*
|
|
1547
|
-
* (
|
|
1548
|
-
*
|
|
1549
|
-
* 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.
|
|
1550
1447
|
*/
|
|
1551
|
-
export declare function
|
|
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: {
|
|
1552
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: {
|
|
1491
|
+
poolId: Hex;
|
|
1492
|
+
to?: Address;
|
|
1553
1493
|
account: Address;
|
|
1554
1494
|
}): Promise<`0x${string}`>;
|
|
1555
1495
|
/**
|
|
1556
|
-
*
|
|
1496
|
+
* Close the pool as ONE transaction: the harvest that empties the bid
|
|
1557
1497
|
* ({@link fPoolEmptyingHarvests} — a dividend to every share; none when it is already empty),
|
|
1558
|
-
* then `
|
|
1559
|
-
*
|
|
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.
|
|
1560
1500
|
*/
|
|
1561
|
-
export declare function
|
|
1501
|
+
export declare function fPoolClose(c: LogswapClient, a: {
|
|
1562
1502
|
poolId: Hex;
|
|
1503
|
+
to?: Address;
|
|
1563
1504
|
account: Address;
|
|
1564
1505
|
}): Promise<`0x${string}`>;
|
|
1565
1506
|
/**
|
|
1566
|
-
* The harvests that empty an unlocked pool's bid, in order — what a
|
|
1567
|
-
* `
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
1570
|
-
*
|
|
1571
|
-
* (`PolPolicy.minQuoteRatio`): 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.
|
|
1572
1512
|
*/
|
|
1573
1513
|
export declare function fPoolEmptyingHarvests(c: LogswapClient, poolId: Hex): Promise<bigint[]>;
|
|
1574
1514
|
/**
|
|
1575
|
-
* The GENERATION STEP
|
|
1576
|
-
* generation's income first, releases the dead shares'
|
|
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
|
|
1577
1517
|
* (`onRegenerate`), whose {@link FPolicyTerms} name a `carried` holder. Then, for live
|
|
1578
1518
|
* generation `g`:
|
|
1579
1519
|
*
|
|
1580
1520
|
* - the carried holder's and the dead shares' `g` shares are re-minted 1:1 as `g + 1`: they go on
|
|
1581
1521
|
* as the pool;
|
|
1582
|
-
* - every OTHER holder of `g` is frozen out pro rata into generation `g`'s bundle (`
|
|
1522
|
+
* - every OTHER holder of `g` is frozen out pro rata into generation `g`'s bundle (`GenerationRetired`)
|
|
1583
1523
|
* and redeems it with {@link fPoolRedeem} / rolls it with {@link fPoolRollIn} (`gen: g`); their
|
|
1584
1524
|
* dividends on `g` stay claimable ({@link fPoolClaim} with `gen: g`). {@link fPoolClaimsOf}
|
|
1585
1525
|
* lists them;
|
|
1586
|
-
* - the
|
|
1587
|
-
*
|
|
1588
|
-
* 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.
|
|
1589
1528
|
*
|
|
1590
1529
|
* A pad's gate is `threshold(poolId, gen)`, in its quote (`PadPolicy.NotGraduated` below it); POL and private carry the
|
|
1591
|
-
* authority and send it the whole
|
|
1592
|
-
* 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}.
|
|
1593
1532
|
*/
|
|
1594
1533
|
export declare function fPoolRegenerate(c: LogswapClient, a: {
|
|
1595
1534
|
poolId: Hex;
|
|
1596
1535
|
to?: Address;
|
|
1597
1536
|
account: Address;
|
|
1598
1537
|
}): Promise<`0x${string}`>;
|
|
1599
|
-
/**
|
|
1600
|
-
* The relaunch as ONE transaction: `harvest` the bid out — a
|
|
1601
|
-
* dividend to every share, {@link fPoolEmptyingHarvests} — `retire` the live generation at the
|
|
1602
|
-
* empty bid, `redeem` the caller's own shares of it (when `shares` > 0), optionally `setLegs` the
|
|
1603
|
-
* next generation's composition (`legs`: a private pool's reshape — retire, admit, reweight), and
|
|
1604
|
-
* `seed` it with what came back — the manager's `multicall`, one sender throughout, the same
|
|
1605
|
-
* pool. The operator's when one is appointed and the seed's inventory is its own; by default the
|
|
1606
|
-
* authority's. The policy, its roles, gates, allowlist and the name carry over; anything else goes
|
|
1607
|
-
* in `extra`, pre-encoded against {@link fPoolManagerAbi}. The seed names reserves (decisions
|
|
1608
|
-
* 029): `r0` outright — one per leg of the NEXT table, 0 for a retired leg — or `x0` marks
|
|
1609
|
-
* against the next table's `weights`.
|
|
1610
|
-
*/
|
|
1611
|
-
export declare function fPoolRelaunch(c: LogswapClient, a: {
|
|
1612
|
-
poolId: Hex;
|
|
1613
|
-
/** the caller's shares of the retiring generation to redeem inside the batch — its whole balance, usually; 0 to keep the claim */
|
|
1614
|
-
shares: bigint;
|
|
1615
|
-
L0: bigint;
|
|
1616
|
-
Q0: bigint;
|
|
1617
|
-
/** the next generation's composition: one weight per existing leg (0 retires it), then one per new base */
|
|
1618
|
-
legs?: {
|
|
1619
|
-
weights: bigint[];
|
|
1620
|
-
newBases?: Address[];
|
|
1621
|
-
};
|
|
1622
|
-
extra?: Hex[];
|
|
1623
|
-
account: Address;
|
|
1624
|
-
} & ({
|
|
1625
|
-
r0: bigint[];
|
|
1626
|
-
} | {
|
|
1627
|
-
x0: bigint[];
|
|
1628
|
-
weights: bigint[];
|
|
1629
|
-
})): Promise<`0x${string}`>;
|
|
1630
1538
|
/** Where a pad's seed lives: `seed` mints every share of a pad here itself. */
|
|
1631
1539
|
export declare const DEAD_ADDRESS: Address;
|
|
1632
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. */
|
|
@@ -1653,9 +1561,15 @@ export interface FPoolGenesisTransfer {
|
|
|
1653
1561
|
amount: bigint;
|
|
1654
1562
|
}
|
|
1655
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. */
|
|
1656
1567
|
L0: bigint;
|
|
1657
|
-
/**
|
|
1658
|
-
|
|
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;
|
|
1659
1573
|
/**
|
|
1660
1574
|
* An opening buy of leg `j` (an index into `bases` AS GIVEN) for `amountIn` of quote, ON THE
|
|
1661
1575
|
* MANAGER — the same sender, a plain allowance to the manager, the router nowhere near it. A
|
|
@@ -1867,20 +1781,6 @@ export declare function fPoolSetPoolOperator(c: LogswapClient, a: {
|
|
|
1867
1781
|
account: Address;
|
|
1868
1782
|
policy?: Address;
|
|
1869
1783
|
}): Promise<`0x${string}`>;
|
|
1870
|
-
/**
|
|
1871
|
-
* The next generation's composition (operator; private pools only; ONLY while the pool is
|
|
1872
|
-
* unseeded — between a retire and the seed that prices it). `weights` has one
|
|
1873
|
-
* entry per leg the pool has ever had, in index order (0 retires a leg; indices are never reused),
|
|
1874
|
-
* then one per base in `newBases`, appended; they sum to 1e18 exactly. No value moves: the
|
|
1875
|
-
* following {@link fPoolSeed} names every reserve. A live reshape is {@link fPoolRelaunch} with
|
|
1876
|
-
* `legs` set.
|
|
1877
|
-
*/
|
|
1878
|
-
export declare function fPoolSetLegs(c: LogswapClient, a: {
|
|
1879
|
-
poolId: Hex;
|
|
1880
|
-
weights: bigint[];
|
|
1881
|
-
newBases?: Address[];
|
|
1882
|
-
account: Address;
|
|
1883
|
-
}): Promise<`0x${string}`>;
|
|
1884
1784
|
/**
|
|
1885
1785
|
* Move shares (ERC-6909 `transfer`) — to another holder, or to `0xdead` to lock them for good.
|
|
1886
1786
|
* Burning to the dead address is a sponsor's way to make its liquidity permanent: the shares can
|
|
@@ -1897,10 +1797,13 @@ export interface DiscoveredFPool {
|
|
|
1897
1797
|
poolId: Hex;
|
|
1898
1798
|
quote: Address;
|
|
1899
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. */
|
|
1900
1801
|
weights: bigint[];
|
|
1901
1802
|
swapFee: bigint;
|
|
1902
|
-
/** The
|
|
1903
|
-
|
|
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;
|
|
1904
1807
|
kind: FPoolKind;
|
|
1905
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`). */
|
|
1906
1809
|
policy: Address;
|
|
@@ -1908,7 +1811,7 @@ export interface DiscoveredFPool {
|
|
|
1908
1811
|
creator: Address;
|
|
1909
1812
|
/** The block the pool was initialized in — its age, for annualising realized income. */
|
|
1910
1813
|
block: bigint;
|
|
1911
|
-
/** Whether `
|
|
1814
|
+
/** Whether `deployLiquidity` has run; an unfunded pool has no floor and no float, so nothing to show. */
|
|
1912
1815
|
seeded: boolean;
|
|
1913
1816
|
/** The quote the pool was born with. Zero is the launchpad's signature. */
|
|
1914
1817
|
q0: bigint;
|
|
@@ -1922,8 +1825,8 @@ export interface DiscoveredFPool {
|
|
|
1922
1825
|
}
|
|
1923
1826
|
/**
|
|
1924
1827
|
* Every F pool ever created, from `PoolCreated` logs alone — plus one `kind()` read per distinct
|
|
1925
|
-
* policy, cached. Possible only because the event carries the full key preimage (bases,
|
|
1926
|
-
*
|
|
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
|
|
1927
1830
|
* exists for exactly this call. With `indexer`, the logs come from it (the node when it fails):
|
|
1928
1831
|
* a scan from block 0 per call is what made the first load wait on the node.
|
|
1929
1832
|
*/
|
|
@@ -1947,19 +1850,20 @@ export type FPoolRules = {
|
|
|
1947
1850
|
gen: number;
|
|
1948
1851
|
/** @deprecated Equal to {@link gen} since F version 21, kept for callers; read `gen`. */
|
|
1949
1852
|
rung: number;
|
|
1950
|
-
/** The
|
|
1853
|
+
/** The income the next graduation needs, in the pad's quote: `PadPolicy.threshold(poolId, gen)` (T(0) is per quote, decision 070). */
|
|
1951
1854
|
threshold: bigint;
|
|
1952
|
-
|
|
1953
|
-
|
|
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). */
|
|
1954
1858
|
creatorShare: bigint;
|
|
1955
|
-
/** The income
|
|
1956
|
-
|
|
1859
|
+
/** The income tax the dead shares pay on their own new income dividend (decisions 073, 085), WAD. */
|
|
1860
|
+
incomeTaxRate: bigint;
|
|
1957
1861
|
/** The ranges the LOG Authority set on the policy NOW for the pads born after this read: what a new creator may choose. */
|
|
1958
1862
|
ranges: PadRanges;
|
|
1959
1863
|
} | {
|
|
1960
|
-
kind: "pol"; /** The reserve a harvest leaves in the bid and a
|
|
1961
|
-
minQuoteRatio: bigint; /** The income
|
|
1962
|
-
|
|
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;
|
|
1963
1867
|
} | {
|
|
1964
1868
|
kind: "public";
|
|
1965
1869
|
} | {
|
|
@@ -1969,7 +1873,7 @@ export type FPoolRules = {
|
|
|
1969
1873
|
swapExecutor: Address;
|
|
1970
1874
|
operator: Address;
|
|
1971
1875
|
};
|
|
1972
|
-
/** The LOG Authority's range on a pad's creator choice (`PadPolicy`, decisions 056, 067), WAD fractions of the
|
|
1876
|
+
/** The LOG Authority's range on a pad's creator choice (`PadPolicy`, decisions 056, 067), WAD fractions of the income released. */
|
|
1973
1877
|
export interface PadRanges {
|
|
1974
1878
|
creatorShareMin: bigint;
|
|
1975
1879
|
/** At most the F manager's `PAYEE_CUT_MAX` (50%), which bounds a pad's payee whatever the policy (067). */
|
|
@@ -1977,7 +1881,7 @@ export interface PadRanges {
|
|
|
1977
1881
|
}
|
|
1978
1882
|
/**
|
|
1979
1883
|
* The salt that carries a pad's split (`PadPolicy.pack(creatorShare, nonce)`, decisions 056, 067): `creatorShare` in the top 64
|
|
1980
|
-
* bits (a WAD fraction of the
|
|
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
|
|
1981
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
|
|
1982
1886
|
* chosen at launch (`FPoolLaunchArgs.salt`) and never changes; the policy refuses a cut outside its range.
|
|
1983
1887
|
*/
|
|
@@ -2021,7 +1925,7 @@ export declare function fPoolShareHolders(c: LogswapClient, poolIdHex: Hex, opts
|
|
|
2021
1925
|
/**
|
|
2022
1926
|
* What a policy answers `onRegenerate` with: `IFPolicy.Terms` — four words, exactly 128 bytes since F version 28 (decision 067
|
|
2023
1927
|
* removed `burn`). `carried` is the holder the next generation carries beside the dead shares; on a pad the manager requires
|
|
2024
|
-
* `0xdead` and caps `toPayee` at `PAYEE_CUT_MAX` of the
|
|
1928
|
+
* `0xdead` and caps `toPayee` at `PAYEE_CUT_MAX` of the income.
|
|
2025
1929
|
*/
|
|
2026
1930
|
export interface FPolicyTerms {
|
|
2027
1931
|
payee: Address;
|
|
@@ -2029,7 +1933,7 @@ export interface FPolicyTerms {
|
|
|
2029
1933
|
protocolCut: bigint;
|
|
2030
1934
|
carried: Address;
|
|
2031
1935
|
}
|
|
2032
|
-
/** Every F pool's raw state in one lens call (the manager's `Pool` struct: quote, swapFee, policy, seeded, gen, n, restructureTime, asks,
|
|
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). */
|
|
2033
1937
|
export declare function getFPoolsRaw(c: LogswapClient, poolIds: Hex[]): Promise<readonly unknown[]>;
|
|
2034
1938
|
/** Share value from the lens — (L + Q)/shares, WAD per share — the same figure as `fPoolShareValue`, from one source. */
|
|
2035
1939
|
export declare function shareValueOnChain(c: LogswapClient, poolId: Hex): Promise<bigint>;
|