@logswap/sdk 0.5.70 → 0.5.72
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 +21 -2
- package/dist/admin.d.ts +38 -16
- package/dist/admin.js +47 -18
- package/dist/client.d.ts +7 -2
- package/dist/client.js +15 -2
- package/dist/fees.d.ts +1 -1
- package/dist/fees.js +2 -2
- package/dist/fpool.d.ts +207 -27
- package/dist/fpool.js +190 -115
- package/dist/generated.d.ts +812 -446
- package/dist/generated.js +486 -246
- package/dist/indexer.js +1 -1
- package/dist/keys.d.ts +4 -3
- package/dist/keys.js +3 -3
- package/dist/pools.d.ts +5 -4
- package/dist/pools.js +7 -6
- package/dist/positions.d.ts +3 -2
- package/dist/positions.js +3 -2
- package/package.json +1 -1
- package/src/admin.ts +51 -18
- package/src/client.ts +15 -2
- package/src/fees.ts +2 -2
- package/src/fpool.ts +249 -155
- package/src/generated.ts +486 -246
- package/src/indexer.ts +1 -1
- package/src/keys.ts +6 -5
- package/src/pools.ts +7 -6
- package/src/positions.ts +3 -2
package/dist/fpool.d.ts
CHANGED
|
@@ -90,6 +90,30 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
90
90
|
readonly type: "address";
|
|
91
91
|
}];
|
|
92
92
|
readonly stateMutability: "view";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "function";
|
|
95
|
+
readonly inputs: readonly [];
|
|
96
|
+
readonly name: "feeCurated";
|
|
97
|
+
readonly outputs: readonly [{
|
|
98
|
+
readonly name: "";
|
|
99
|
+
readonly internalType: "bool";
|
|
100
|
+
readonly type: "bool";
|
|
101
|
+
}];
|
|
102
|
+
readonly stateMutability: "view";
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
readonly inputs: readonly [{
|
|
106
|
+
readonly name: "";
|
|
107
|
+
readonly internalType: "uint256";
|
|
108
|
+
readonly type: "uint256";
|
|
109
|
+
}];
|
|
110
|
+
readonly name: "feeListed";
|
|
111
|
+
readonly outputs: readonly [{
|
|
112
|
+
readonly name: "";
|
|
113
|
+
readonly internalType: "bool";
|
|
114
|
+
readonly type: "bool";
|
|
115
|
+
}];
|
|
116
|
+
readonly stateMutability: "view";
|
|
93
117
|
}, {
|
|
94
118
|
readonly type: "function";
|
|
95
119
|
readonly inputs: readonly [];
|
|
@@ -232,7 +256,7 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
232
256
|
readonly internalType: "uint256[]";
|
|
233
257
|
readonly type: "uint256[]";
|
|
234
258
|
}, {
|
|
235
|
-
readonly name: "
|
|
259
|
+
readonly name: "swapFee";
|
|
236
260
|
readonly internalType: "uint256";
|
|
237
261
|
readonly type: "uint256";
|
|
238
262
|
}, {
|
|
@@ -247,6 +271,10 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
247
271
|
readonly name: "salt";
|
|
248
272
|
readonly internalType: "bytes32";
|
|
249
273
|
readonly type: "bytes32";
|
|
274
|
+
}, {
|
|
275
|
+
readonly name: "cap";
|
|
276
|
+
readonly internalType: "uint24";
|
|
277
|
+
readonly type: "uint24";
|
|
250
278
|
}];
|
|
251
279
|
}];
|
|
252
280
|
readonly name: "onInitialize";
|
|
@@ -410,6 +438,30 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
410
438
|
readonly type: "bool";
|
|
411
439
|
}];
|
|
412
440
|
readonly stateMutability: "view";
|
|
441
|
+
}, {
|
|
442
|
+
readonly type: "function";
|
|
443
|
+
readonly inputs: readonly [{
|
|
444
|
+
readonly name: "curated";
|
|
445
|
+
readonly internalType: "bool";
|
|
446
|
+
readonly type: "bool";
|
|
447
|
+
}];
|
|
448
|
+
readonly name: "setFeeCurated";
|
|
449
|
+
readonly outputs: readonly [];
|
|
450
|
+
readonly stateMutability: "nonpayable";
|
|
451
|
+
}, {
|
|
452
|
+
readonly type: "function";
|
|
453
|
+
readonly inputs: readonly [{
|
|
454
|
+
readonly name: "fee";
|
|
455
|
+
readonly internalType: "uint256";
|
|
456
|
+
readonly type: "uint256";
|
|
457
|
+
}, {
|
|
458
|
+
readonly name: "listed";
|
|
459
|
+
readonly internalType: "bool";
|
|
460
|
+
readonly type: "bool";
|
|
461
|
+
}];
|
|
462
|
+
readonly name: "setFeeListed";
|
|
463
|
+
readonly outputs: readonly [];
|
|
464
|
+
readonly stateMutability: "nonpayable";
|
|
413
465
|
}, {
|
|
414
466
|
readonly type: "function";
|
|
415
467
|
readonly inputs: readonly [{
|
|
@@ -502,6 +554,31 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
502
554
|
readonly indexed: true;
|
|
503
555
|
}];
|
|
504
556
|
readonly name: "AuthoritySet";
|
|
557
|
+
}, {
|
|
558
|
+
readonly type: "event";
|
|
559
|
+
readonly anonymous: false;
|
|
560
|
+
readonly inputs: readonly [{
|
|
561
|
+
readonly name: "curated";
|
|
562
|
+
readonly internalType: "bool";
|
|
563
|
+
readonly type: "bool";
|
|
564
|
+
readonly indexed: false;
|
|
565
|
+
}];
|
|
566
|
+
readonly name: "FeeCuratedSet";
|
|
567
|
+
}, {
|
|
568
|
+
readonly type: "event";
|
|
569
|
+
readonly anonymous: false;
|
|
570
|
+
readonly inputs: readonly [{
|
|
571
|
+
readonly name: "fee";
|
|
572
|
+
readonly internalType: "uint256";
|
|
573
|
+
readonly type: "uint256";
|
|
574
|
+
readonly indexed: true;
|
|
575
|
+
}, {
|
|
576
|
+
readonly name: "listed";
|
|
577
|
+
readonly internalType: "bool";
|
|
578
|
+
readonly type: "bool";
|
|
579
|
+
readonly indexed: false;
|
|
580
|
+
}];
|
|
581
|
+
readonly name: "FeeListed";
|
|
505
582
|
}, {
|
|
506
583
|
readonly type: "event";
|
|
507
584
|
readonly anonymous: false;
|
|
@@ -565,6 +642,14 @@ export declare const fPolicyBaseAbi: readonly [{
|
|
|
565
642
|
readonly type: "error";
|
|
566
643
|
readonly inputs: readonly [];
|
|
567
644
|
readonly name: "BadRate";
|
|
645
|
+
}, {
|
|
646
|
+
readonly type: "error";
|
|
647
|
+
readonly inputs: readonly [{
|
|
648
|
+
readonly name: "fee";
|
|
649
|
+
readonly internalType: "uint256";
|
|
650
|
+
readonly type: "uint256";
|
|
651
|
+
}];
|
|
652
|
+
readonly name: "FeeNotListed";
|
|
568
653
|
}, {
|
|
569
654
|
readonly type: "error";
|
|
570
655
|
readonly inputs: readonly [];
|
|
@@ -624,14 +709,21 @@ export interface FPoolState {
|
|
|
624
709
|
Q: bigint;
|
|
625
710
|
/** Total exposure. Grows on mint, shrinks on burn; never moves on a swap. */
|
|
626
711
|
L: bigint;
|
|
627
|
-
/**
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
|
|
631
|
-
/** θ = X − Q/L, the
|
|
632
|
-
|
|
712
|
+
/** The swap fee, WAD (`phi` before F version 25, decisions 059). At or above `FEE_MIN` — a zero-fee basket is not constructible. */
|
|
713
|
+
swapFee: bigint;
|
|
714
|
+
/** θ₀, 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. */
|
|
715
|
+
refLogFloor: bigint;
|
|
716
|
+
/** θ = X − Q/L, the log of the pool's current floor price: where the bid runs out. Derived, never stored. `theta` before F version 25. */
|
|
717
|
+
logFloor: bigint;
|
|
633
718
|
/** X = Σ w_j x_j, the composite index. */
|
|
634
719
|
compositeX: bigint;
|
|
720
|
+
/** This generation's income still in the pool, quote: L·(θ₀ − θ). */
|
|
721
|
+
unharvested: bigint;
|
|
722
|
+
/**
|
|
723
|
+
* The common cap (decisions 061): d = ln(cap price / floor price) in 1e-6 log units, from the key;
|
|
724
|
+
* 0 is uncapped. Leverage at the floor is 1/(1 − e^{−d}): {@link fPoolLeverageOfCap}.
|
|
725
|
+
*/
|
|
726
|
+
cap: number;
|
|
635
727
|
/** Σ = ∫ Σ_j w_j (dx_j)², accrued even though the fee is fixed — the kernel stays calculable. */
|
|
636
728
|
bigSigma: bigint;
|
|
637
729
|
/**
|
|
@@ -662,8 +754,12 @@ export interface FPoolState {
|
|
|
662
754
|
totalSupply: bigint;
|
|
663
755
|
/** What the pool holds of each base — the STATE; the mark `x` is derived from it. */
|
|
664
756
|
reserves: bigint[];
|
|
757
|
+
/** The reserve every price reads: `reserves[j] + L_j·κ_j` on a capped pool (061), `reserves[j]` otherwise. */
|
|
758
|
+
virtualReserves: bigint[];
|
|
759
|
+
/** κ_j = e^{−μ_j}, WAD: each leg's phantom reserve per unit of its liquidity. 0 uncapped. */
|
|
760
|
+
kappa: bigint[];
|
|
665
761
|
}
|
|
666
|
-
/** Read a basket pool whole
|
|
762
|
+
/** Read a basket pool whole: one lens call (`fPool`, F version 25) plus the policy's kind and name. */
|
|
667
763
|
export declare function getFPool(c: LogswapClient, poolId: Hex): Promise<FPoolState>;
|
|
668
764
|
/**
|
|
669
765
|
* The kind of pool — the POLICY's self-description (the manager knows no kind; the
|
|
@@ -739,7 +835,11 @@ export interface FPoolDescription {
|
|
|
739
835
|
export declare function describeFPool(c: LogswapClient, s: FPoolState): Promise<FPoolDescription>;
|
|
740
836
|
/** `p_j = e^{x_j}`, lossy the way any float conversion is. Compare in log space when it matters. */
|
|
741
837
|
export declare function fPoolPriceOf(x: bigint, scale?: number): number;
|
|
742
|
-
/**
|
|
838
|
+
/**
|
|
839
|
+
* Value per share at the pool's own marks, WAD. Uncapped, `V = L + Q`. Capped (decisions 061), leg
|
|
840
|
+
* j's base is worth `L_j·R_j/R̃_j`, less than `L_j` by the phantom the cap removed — the lens's
|
|
841
|
+
* `shareValue`, without the call.
|
|
842
|
+
*/
|
|
743
843
|
export declare function fPoolShareValue(s: FPoolState): bigint;
|
|
744
844
|
export interface FPoolSwapArgs {
|
|
745
845
|
poolId: Hex;
|
|
@@ -916,8 +1016,65 @@ export declare function fPoolClaim(c: LogswapClient, a: {
|
|
|
916
1016
|
to?: Address;
|
|
917
1017
|
account: Address;
|
|
918
1018
|
}): Promise<`0x${string}`>;
|
|
919
|
-
/**
|
|
1019
|
+
/**
|
|
1020
|
+
* A holder's claimable dividend as of now on generation `gen` (the live one by default) — banked
|
|
1021
|
+
* plus pending on the current balance; under a lien, the free fraction's only: the locked
|
|
1022
|
+
* fraction's is the lien's ({@link fPoolLienOf}, decisions 063).
|
|
1023
|
+
*/
|
|
920
1024
|
export declare function fPoolDividendOf(c: LogswapClient, poolId: Hex, holder: Address, gen?: bigint | number): Promise<bigint>;
|
|
1025
|
+
/** A lien on one share id: the locker, the amount locked, and the dividend the lien holds (banked). */
|
|
1026
|
+
export interface FPoolLien {
|
|
1027
|
+
locker: Address;
|
|
1028
|
+
amount: bigint;
|
|
1029
|
+
owed: bigint;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* The lien on `owner`'s shares of `poolId`'s generation `gen` (the live one by default). `owed` counts
|
|
1033
|
+
* what has been banked into it; the locked fraction of the owner's pending since its last bank is
|
|
1034
|
+
* not yet in it — {@link fPoolBankLien} banks it.
|
|
1035
|
+
*/
|
|
1036
|
+
export declare function fPoolLienOf(c: LogswapClient, poolId: Hex, owner: Address, gen?: bigint | number): Promise<FPoolLien>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Lock `amount` of `owner`'s shares for the caller, the locker (`account`). Paid with the owner's
|
|
1039
|
+
* per-id allowance to the locker — the owner first sends `approve(locker, shareId, amount)` on the
|
|
1040
|
+
* F manager ({@link fPoolApproveShares}) — or an operator grant. One locker per (id, owner) while a
|
|
1041
|
+
* lien stands. In practice the lending contract calls `lock` itself; this is the EOA path.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare function fPoolLock(c: LogswapClient, a: {
|
|
1044
|
+
poolId: Hex;
|
|
1045
|
+
owner: Address;
|
|
1046
|
+
amount: bigint;
|
|
1047
|
+
gen?: bigint | number;
|
|
1048
|
+
account: Address;
|
|
1049
|
+
}): Promise<`0x${string}`>;
|
|
1050
|
+
/**
|
|
1051
|
+
* The locker's `unlock`: `amount` of the lien lifted with its share of the lien's dividend, credited
|
|
1052
|
+
* to `to` — the owner (a release) or anyone else (a seizure, the shares moving to `to`). It banks
|
|
1053
|
+
* first. The locker's alone.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare function fPoolUnlock(c: LogswapClient, a: {
|
|
1056
|
+
poolId: Hex;
|
|
1057
|
+
owner: Address;
|
|
1058
|
+
amount: bigint;
|
|
1059
|
+
to: Address;
|
|
1060
|
+
gen?: bigint | number;
|
|
1061
|
+
account: Address;
|
|
1062
|
+
}): Promise<`0x${string}`>;
|
|
1063
|
+
/** Bank the owner's pending into the lien now — `unlock(id, owner, 0, owner)`: dividends bank lazily. The locker's. */
|
|
1064
|
+
export declare function fPoolBankLien(c: LogswapClient, a: {
|
|
1065
|
+
poolId: Hex;
|
|
1066
|
+
owner: Address;
|
|
1067
|
+
gen?: bigint | number;
|
|
1068
|
+
account: Address;
|
|
1069
|
+
}): Promise<`0x${string}`>;
|
|
1070
|
+
/** The owner's per-id allowance to a locker on the F manager's ERC-6909 shares — what `lock` spends. */
|
|
1071
|
+
export declare function fPoolApproveShares(c: LogswapClient, a: {
|
|
1072
|
+
poolId: Hex;
|
|
1073
|
+
spender: Address;
|
|
1074
|
+
amount: bigint;
|
|
1075
|
+
gen?: bigint | number;
|
|
1076
|
+
account: Address;
|
|
1077
|
+
}): Promise<`0x${string}`>;
|
|
921
1078
|
/** Plain ERC-20 approval to the F manager — the allowance every DIRECT call pulls against. */
|
|
922
1079
|
export declare function approveTokenForFPoolManager(c: LogswapClient, token: Address): Promise<Hash>;
|
|
923
1080
|
/** Does `owner` have enough allowance on `token` for the MANAGER to pull `need`? */
|
|
@@ -995,8 +1152,13 @@ export interface FPoolCreateArgs {
|
|
|
995
1152
|
bases: Address[];
|
|
996
1153
|
/** WAD each; must sum to 1e18 — validated here so the revert is readable. */
|
|
997
1154
|
weights: bigint[];
|
|
998
|
-
/**
|
|
999
|
-
|
|
1155
|
+
/** 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). */
|
|
1156
|
+
swapFee: bigint;
|
|
1157
|
+
/**
|
|
1158
|
+
* The common cap (decisions 061): d = ln(cap price / floor price) in 1e-6 log units, a key field;
|
|
1159
|
+
* 0 or absent is uncapped. From a leverage λ: {@link fPoolCapOfLeverage}.
|
|
1160
|
+
*/
|
|
1161
|
+
cap?: number;
|
|
1000
1162
|
/**
|
|
1001
1163
|
* Which of the protocol's four the pool is — see {@link FPoolKind}. NOT a key field (decisions
|
|
1002
1164
|
* 049: the manager knows no kind): it selects the deployment's policy of that kind when `policy`
|
|
@@ -1040,11 +1202,13 @@ export interface FPoolKey {
|
|
|
1040
1202
|
bases: Address[];
|
|
1041
1203
|
/** WAD, aligned with `bases`, summing to 1e18. */
|
|
1042
1204
|
weights: bigint[];
|
|
1043
|
-
|
|
1205
|
+
swapFee: bigint;
|
|
1044
1206
|
/** The policy AT BIRTH — not the live one after a move. */
|
|
1045
1207
|
policy: Address;
|
|
1046
1208
|
creator: Address;
|
|
1047
1209
|
salt: Hex;
|
|
1210
|
+
/** The common cap, d in 1e-6 log units; 0 uncapped (decisions 061). Appended in F version 25: every pool id moved. */
|
|
1211
|
+
cap: number;
|
|
1048
1212
|
}
|
|
1049
1213
|
/**
|
|
1050
1214
|
* An F pool's id: `keccak256(abi.encode(key))`, offline — what `initialize` computes inline. The
|
|
@@ -1079,7 +1243,17 @@ export declare function fPoolKeyOfPool(c: LogswapClient, poolId: Hex, opts?: {
|
|
|
1079
1243
|
* precision (~1e-16 relative) is what a seed needs: any reserve is a legal seed, and the mark
|
|
1080
1244
|
* the pool derives from it is the one the sponsor meant to within that.
|
|
1081
1245
|
*/
|
|
1082
|
-
export declare function fPoolReserveAt(Lj: bigint, x: bigint): bigint;
|
|
1246
|
+
export declare function fPoolReserveAt(Lj: bigint, x: bigint, k?: number): bigint;
|
|
1247
|
+
/**
|
|
1248
|
+
* The seed's cap constant k = e^{Q0/L0 − d} (decisions 061): every leg's phantom is c_j = r_j·k/(1 − k).
|
|
1249
|
+
* 0 on an uncapped pool. Throws when the seed would be priced at or above its cap (Q0/L0 ≥ d), which
|
|
1250
|
+
* the manager refuses.
|
|
1251
|
+
*/
|
|
1252
|
+
export declare function fPoolCapK(cap: number, Q0: bigint, L0: bigint): number;
|
|
1253
|
+
/** The cap d (1e-6 log units) for a leverage λ > 1 at the floor: d = ln(λ/(λ − 1)) (decisions 061). λ = 2 puts the cap at twice the floor. */
|
|
1254
|
+
export declare function fPoolCapOfLeverage(lambda: number): number;
|
|
1255
|
+
/** The leverage at the floor λ = 1/(1 − e^{−d}) for a cap d in 1e-6 log units; Infinity is impossible, 1 is uncapped. */
|
|
1256
|
+
export declare function fPoolLeverageOfCap(cap: number): number;
|
|
1083
1257
|
/**
|
|
1084
1258
|
* Arm the pool: deposit `r0[j]` of each base plus `Q0` of quote against exposure `L0`. Pass either
|
|
1085
1259
|
* the reserves outright (`r0`) or the marks the pool should open at (`x0`, converted here with
|
|
@@ -1141,8 +1315,9 @@ export declare function fPoolEmptyingHarvests(c: LogswapClient, poolId: Hex): Pr
|
|
|
1141
1315
|
* and redeems it with {@link fPoolRedeem} / rolls it with {@link fPoolRollIn} (`gen: g`); their
|
|
1142
1316
|
* dividends on `g` stay claimable ({@link fPoolClaim} with `gen: g`). {@link fPoolClaimsOf}
|
|
1143
1317
|
* lists them;
|
|
1144
|
-
* - the pot: `toPayee` to the payee, `protocolCut` to the collector,
|
|
1145
|
-
*
|
|
1318
|
+
* - the pot, all in quote (decisions 057): `toPayee` to the payee, `protocolCut` to the collector,
|
|
1319
|
+
* `burn` spent buying base at the curve and burning it (the price up, the floor held), and the
|
|
1320
|
+
* rest into the bid (the floor down). No share is minted; L does not move.
|
|
1146
1321
|
*
|
|
1147
1322
|
* A pad's gate is `threshold(gen)` (`PadPolicy.NotGraduated` below it); POL and private carry the
|
|
1148
1323
|
* authority and send it the whole pot; a public pool refuses (`Refused`). A carried holder with no
|
|
@@ -1450,7 +1625,9 @@ export interface DiscoveredFPool {
|
|
|
1450
1625
|
quote: Address;
|
|
1451
1626
|
bases: Address[];
|
|
1452
1627
|
weights: bigint[];
|
|
1453
|
-
|
|
1628
|
+
swapFee: bigint;
|
|
1629
|
+
/** The common cap, d in 1e-6 log units; 0 uncapped (decisions 061). */
|
|
1630
|
+
cap: number;
|
|
1454
1631
|
kind: FPoolKind;
|
|
1455
1632
|
/** 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`). */
|
|
1456
1633
|
policy: Address;
|
|
@@ -1473,7 +1650,7 @@ export interface DiscoveredFPool {
|
|
|
1473
1650
|
/**
|
|
1474
1651
|
* Every F pool ever created, from `Initialize` logs alone — plus one `kind()` read per distinct
|
|
1475
1652
|
* policy, cached. Possible only because the event carries the full key preimage (bases,
|
|
1476
|
-
* weights,
|
|
1653
|
+
* weights, swapFee, policy, cap) — the poolId is a hash and could never be inverted; contracts PR #17
|
|
1477
1654
|
* exists for exactly this call. With `indexer`, the logs come from it (the node when it fails):
|
|
1478
1655
|
* a scan from block 0 per call is what made the first load wait on the node.
|
|
1479
1656
|
*/
|
|
@@ -1500,10 +1677,10 @@ export type FPoolRules = {
|
|
|
1500
1677
|
/** The pot the next graduation needs: `PadPolicy.threshold(gen)`. */
|
|
1501
1678
|
threshold: bigint;
|
|
1502
1679
|
pot: bigint;
|
|
1503
|
-
/** This pad's split, recorded at its birth from the key's salt and never changed (decisions 056): the creator's cut of the pot, the protocol's, and the burn
|
|
1680
|
+
/** This pad's split, recorded at its birth from the key's salt and never changed (decisions 056, 057): the creator's cut of the pot, the protocol's, and the burn — all fractions of the pot. The rest deepens the bid. */
|
|
1504
1681
|
creatorShare: bigint;
|
|
1505
1682
|
protocolShare: bigint;
|
|
1506
|
-
|
|
1683
|
+
burnShare: bigint;
|
|
1507
1684
|
/** The ranges the collector's policy holds NOW for the pads born after this read: what a new creator may choose. */
|
|
1508
1685
|
ranges: PadRanges;
|
|
1509
1686
|
} | {
|
|
@@ -1519,7 +1696,7 @@ export type FPoolRules = {
|
|
|
1519
1696
|
gateSwap: boolean;
|
|
1520
1697
|
operator: Address;
|
|
1521
1698
|
};
|
|
1522
|
-
/** The collector's ranges on a pad's creator choices (`PadPolicy`, decisions 056), WAD fractions
|
|
1699
|
+
/** The collector's ranges on a pad's creator choices (`PadPolicy`, decisions 056, 057), WAD fractions of the pot. */
|
|
1523
1700
|
export interface PadRanges {
|
|
1524
1701
|
/** The protocol's share of the pot, recorded into each pad at birth. */
|
|
1525
1702
|
protocolShare: bigint;
|
|
@@ -1529,19 +1706,19 @@ export interface PadRanges {
|
|
|
1529
1706
|
burnMax: bigint;
|
|
1530
1707
|
}
|
|
1531
1708
|
/**
|
|
1532
|
-
* The salt that carries a pad's split (`PadPolicy.pack`, decisions 056): `creatorShare` in the top 64 bits, `
|
|
1533
|
-
* the next 64 (WAD fractions), a nonce in the low 128 that tells two otherwise identical pads apart. It is part of the pool's
|
|
1709
|
+
* The salt that carries a pad's split (`PadPolicy.pack`, decisions 056, 057): `creatorShare` in the top 64 bits, `burnShare` in
|
|
1710
|
+
* the next 64 (WAD fractions of the pot), a nonce in the low 128 that tells two otherwise identical pads apart. It is part of the pool's
|
|
1534
1711
|
* identity, so it is chosen at launch (`FPoolLaunchArgs.salt`) and never changes; the policy refuses a split outside its ranges.
|
|
1535
1712
|
*/
|
|
1536
1713
|
export declare function padSalt(s: {
|
|
1537
1714
|
creatorShare: bigint;
|
|
1538
|
-
|
|
1715
|
+
burnShare: bigint;
|
|
1539
1716
|
nonce?: bigint;
|
|
1540
1717
|
}): Hex;
|
|
1541
1718
|
/** The inverse of {@link padSalt}. */
|
|
1542
1719
|
export declare function padSplitOfSalt(salt: Hex): {
|
|
1543
1720
|
creatorShare: bigint;
|
|
1544
|
-
|
|
1721
|
+
burnShare: bigint;
|
|
1545
1722
|
nonce: bigint;
|
|
1546
1723
|
};
|
|
1547
1724
|
/** The policy's terms for one pool, by its kind. */
|
|
@@ -1558,11 +1735,14 @@ export declare function fPoolsControlledBy(c: LogswapClient, who: Address, opts?
|
|
|
1558
1735
|
/**
|
|
1559
1736
|
* Every holder of a pool's shares, from the ERC-6909 Transfer stream — the id is an indexed
|
|
1560
1737
|
* topic, so one filtered log query aggregates the whole ledger. The 0xdead entry is the
|
|
1561
|
-
* MIN_SHARES lock from seeding; callers usually label rather than hide it.
|
|
1738
|
+
* MIN_SHARES lock from seeding; callers usually label rather than hide it. Pass `indexer`: a node
|
|
1739
|
+
* prunes its logs (anvil keeps about a day), and a ledger rebuilt from a pruned stream loses every
|
|
1740
|
+
* holder minted before the cut.
|
|
1562
1741
|
*/
|
|
1563
1742
|
export declare function fPoolShareHolders(c: LogswapClient, poolIdHex: Hex, opts?: {
|
|
1564
1743
|
fromBlock?: bigint;
|
|
1565
1744
|
gen?: bigint | number;
|
|
1745
|
+
indexer?: string;
|
|
1566
1746
|
}): Promise<Array<{
|
|
1567
1747
|
holder: Address;
|
|
1568
1748
|
shares: bigint;
|
|
@@ -1578,7 +1758,7 @@ export interface FPolicyTerms {
|
|
|
1578
1758
|
burn: bigint;
|
|
1579
1759
|
carried: Address;
|
|
1580
1760
|
}
|
|
1581
|
-
/** Every F pool's state in one lens call (the
|
|
1761
|
+
/** Every F pool's raw state in one lens call (the manager's `Pool` struct: quote, swapFee, policy, seeded, gen, n, restructureBlock, asks, cap, Q, bigSigma, L, shares, refLogFloor). */
|
|
1582
1762
|
export declare function getFPoolsRaw(c: LogswapClient, poolIds: Hex[]): Promise<readonly unknown[]>;
|
|
1583
1763
|
/** Share value from the lens — (L + Q)/shares, WAD per share — the same figure as `fPoolShareValue`, from one source. */
|
|
1584
1764
|
export declare function shareValueOnChain(c: LogswapClient, poolId: Hex): Promise<bigint>;
|