@logswap/sdk 0.5.85 → 0.5.87
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/client.js +1 -1
- package/dist/fpool.d.ts +7 -7
- package/dist/fpool.js +3 -3
- package/dist/generated.d.ts +0 -14
- package/dist/generated.js +0 -7
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/fpool.ts +7 -7
- package/src/generated.ts +0 -7
package/dist/client.js
CHANGED
|
@@ -193,7 +193,7 @@ export const EXPECTED_VERSION = 12n;
|
|
|
193
193
|
// `MINT_FEE()` → `mintFee()`, the policies' fee tiers, a canonical public pool (059).
|
|
194
194
|
// 25 (logswap-contract#59): the views moved behind `extsload` (062) — this SDK reads them through the
|
|
195
195
|
// lens (`fPool`, `getFPools`, `fBundleOf`, `fDividendOf`, `fLienOf`); the capped F pool, `FPoolKey.cap` (`lnCapOverFloor` since 27)
|
|
196
|
-
// appended so every pool id moved (061); the lien, `lock` / `unlock` (063);
|
|
196
|
+
// appended so every pool id moved (061); the lien, `lock` / `unlock` (063); the floor is `logFloor`, its reference `refLogFloor`.
|
|
197
197
|
// 26 (logswap-contract#60): the mint fee is per pool, proposed at `initialize(key, mintFee)` and answered
|
|
198
198
|
// by the policy's `onInitialize` from its menu (065); `MINT_FEE` is gone; a fee of 0 is no fee; the
|
|
199
199
|
// policies curate creators, a public pool is uncapped, one pad per base (064). No pool id moved.
|
package/dist/fpool.d.ts
CHANGED
|
@@ -839,13 +839,13 @@ export interface FPoolState {
|
|
|
839
839
|
swapFee: bigint;
|
|
840
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`. */
|
|
841
841
|
mintFee: bigint;
|
|
842
|
-
/**
|
|
842
|
+
/** The reference log floor (`refLogFloor`): 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. */
|
|
843
843
|
refLogFloor: bigint;
|
|
844
|
-
/**
|
|
844
|
+
/** logFloor = 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. */
|
|
845
845
|
logFloor: bigint;
|
|
846
846
|
/** X = Σ w_j x_j, the composite index. */
|
|
847
847
|
compositeX: bigint;
|
|
848
|
-
/** This generation's income still in the pool, quote: L·(
|
|
848
|
+
/** This generation's income still in the pool, quote: L·(refLogFloor − logFloor). */
|
|
849
849
|
unharvested: bigint;
|
|
850
850
|
/**
|
|
851
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
|
|
@@ -952,7 +952,7 @@ export interface FPoolDescription {
|
|
|
952
952
|
/** True when the pool holds no quote: an all-base resting ask. base→quote is the one blocked path. */
|
|
953
953
|
atFloor: boolean;
|
|
954
954
|
/**
|
|
955
|
-
* This generation's fee income still in the pool, quote: `L·(
|
|
955
|
+
* This generation's fee income still in the pool, quote: `L·(refLogFloor − logFloor)` (F version 14 —
|
|
956
956
|
* `feePerL` before, per unit L). A harvest of capital moves the reference floor, so this counts
|
|
957
957
|
* from the first wei after it.
|
|
958
958
|
*/
|
|
@@ -1003,7 +1003,7 @@ export declare function fPoolSwapBaseIn(c: LogswapClient, a: FPoolSwapArgs): Pro
|
|
|
1003
1003
|
export declare function fPoolSwapBaseForBase(c: LogswapClient, a: FPoolSwapArgs & {
|
|
1004
1004
|
k: number;
|
|
1005
1005
|
}): Promise<`0x${string}`>;
|
|
1006
|
-
/** Deposit dL/L of every reserve, receive shares ∝ dL.
|
|
1006
|
+
/** Deposit dL/L of every reserve, receive shares ∝ dL. logFloor is untouched by construction. */
|
|
1007
1007
|
export declare function fPoolMint(c: LogswapClient,
|
|
1008
1008
|
/** `maxQuoteIn` is required: the quote leg is Q·dL/L at landing, and Q moves with every swap. */
|
|
1009
1009
|
a: {
|
|
@@ -1127,11 +1127,11 @@ export declare function fPoolPreviewRollIn(c: LogswapClient, poolId: Hex, gen: b
|
|
|
1127
1127
|
quoteExcess: bigint;
|
|
1128
1128
|
}>;
|
|
1129
1129
|
/**
|
|
1130
|
-
* Remove quote, lifting
|
|
1130
|
+
* Remove quote, lifting logFloor — price-neutral, no base moves, and a DIVIDEND to
|
|
1131
1131
|
* every share: the amount goes into the pool's held income and each holder's slice is settled lazily on
|
|
1132
1132
|
* their next transfer, mint or burn, or pulled with {@link fPoolClaim}. The sponsor's own slice —
|
|
1133
1133
|
* its shares' and the locked seed's at 0xdead — is pushed to `to` at once. On a pad
|
|
1134
|
-
* the lift stops at the seed floor
|
|
1134
|
+
* the lift stops at the seed floor, refLogFloor (income only); nothing else bounds it — an
|
|
1135
1135
|
* unlocked pool's authority may take Q to zero.
|
|
1136
1136
|
*/
|
|
1137
1137
|
export declare function fPoolHarvest(c: LogswapClient, a: {
|
package/dist/fpool.js
CHANGED
|
@@ -242,7 +242,7 @@ export async function fPoolSwapBaseForBase(c, a) {
|
|
|
242
242
|
return fSwap(c, a, FPoolQuoteKind.BaseForBase, a.k);
|
|
243
243
|
}
|
|
244
244
|
// ─── liquidity ────────────────────────────────────────────────────────────────
|
|
245
|
-
/** Deposit dL/L of every reserve, receive shares ∝ dL.
|
|
245
|
+
/** Deposit dL/L of every reserve, receive shares ∝ dL. logFloor is untouched by construction. */
|
|
246
246
|
export async function fPoolMint(c,
|
|
247
247
|
/** `maxQuoteIn` is required: the quote leg is Q·dL/L at landing, and Q moves with every swap. */
|
|
248
248
|
a) {
|
|
@@ -365,11 +365,11 @@ export async function fPoolPreviewRollIn(c, poolId, gen, holder, shares) {
|
|
|
365
365
|
}
|
|
366
366
|
// ─── the floor lever (authority only) ─────────────────────────────────────────
|
|
367
367
|
/**
|
|
368
|
-
* Remove quote, lifting
|
|
368
|
+
* Remove quote, lifting logFloor — price-neutral, no base moves, and a DIVIDEND to
|
|
369
369
|
* every share: the amount goes into the pool's held income and each holder's slice is settled lazily on
|
|
370
370
|
* their next transfer, mint or burn, or pulled with {@link fPoolClaim}. The sponsor's own slice —
|
|
371
371
|
* its shares' and the locked seed's at 0xdead — is pushed to `to` at once. On a pad
|
|
372
|
-
* the lift stops at the seed floor
|
|
372
|
+
* the lift stops at the seed floor, refLogFloor (income only); nothing else bounds it — an
|
|
373
373
|
* unlocked pool's authority may take Q to zero.
|
|
374
374
|
*/
|
|
375
375
|
export async function fPoolHarvest(c, a) {
|
package/dist/generated.d.ts
CHANGED
|
@@ -2566,20 +2566,6 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
2566
2566
|
readonly type: "uint256";
|
|
2567
2567
|
}];
|
|
2568
2568
|
readonly stateMutability: "nonpayable";
|
|
2569
|
-
}, {
|
|
2570
|
-
readonly type: "function";
|
|
2571
|
-
readonly inputs: readonly [{
|
|
2572
|
-
readonly name: "poolId";
|
|
2573
|
-
readonly internalType: "bytes32";
|
|
2574
|
-
readonly type: "bytes32";
|
|
2575
|
-
}];
|
|
2576
|
-
readonly name: "swapFeeB4B";
|
|
2577
|
-
readonly outputs: readonly [{
|
|
2578
|
-
readonly name: "";
|
|
2579
|
-
readonly internalType: "uint256";
|
|
2580
|
-
readonly type: "uint256";
|
|
2581
|
-
}];
|
|
2582
|
-
readonly stateMutability: "view";
|
|
2583
2569
|
}, {
|
|
2584
2570
|
readonly type: "function";
|
|
2585
2571
|
readonly inputs: readonly [{
|
package/dist/generated.js
CHANGED
|
@@ -1586,13 +1586,6 @@ export const fPoolManagerAbi = [
|
|
|
1586
1586
|
outputs: [{ name: 'amountOut', internalType: 'uint256', type: 'uint256' }],
|
|
1587
1587
|
stateMutability: 'nonpayable',
|
|
1588
1588
|
},
|
|
1589
|
-
{
|
|
1590
|
-
type: 'function',
|
|
1591
|
-
inputs: [{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' }],
|
|
1592
|
-
name: 'swapFeeB4B',
|
|
1593
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1594
|
-
stateMutability: 'view',
|
|
1595
|
-
},
|
|
1596
1589
|
{
|
|
1597
1590
|
type: 'function',
|
|
1598
1591
|
inputs: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logswap/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.87",
|
|
4
4
|
"description": "TypeScript SDK for Logswap, the liquidity primitive introducing the logarithmic invariant — typed wrappers over the CPoolManager / FPoolManager / Router / Lens surface.",
|
|
5
5
|
"license": "GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
package/src/client.ts
CHANGED
|
@@ -260,7 +260,7 @@ export const EXPECTED_VERSION = 12n;
|
|
|
260
260
|
// `MINT_FEE()` → `mintFee()`, the policies' fee tiers, a canonical public pool (059).
|
|
261
261
|
// 25 (logswap-contract#59): the views moved behind `extsload` (062) — this SDK reads them through the
|
|
262
262
|
// lens (`fPool`, `getFPools`, `fBundleOf`, `fDividendOf`, `fLienOf`); the capped F pool, `FPoolKey.cap` (`lnCapOverFloor` since 27)
|
|
263
|
-
// appended so every pool id moved (061); the lien, `lock` / `unlock` (063);
|
|
263
|
+
// appended so every pool id moved (061); the lien, `lock` / `unlock` (063); the floor is `logFloor`, its reference `refLogFloor`.
|
|
264
264
|
// 26 (logswap-contract#60): the mint fee is per pool, proposed at `initialize(key, mintFee)` and answered
|
|
265
265
|
// by the policy's `onInitialize` from its menu (065); `MINT_FEE` is gone; a fee of 0 is no fee; the
|
|
266
266
|
// policies curate creators, a public pool is uncapped, one pad per base (064). No pool id moved.
|
package/src/fpool.ts
CHANGED
|
@@ -79,13 +79,13 @@ export interface FPoolState {
|
|
|
79
79
|
swapFee: bigint;
|
|
80
80
|
/** 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`. */
|
|
81
81
|
mintFee: bigint;
|
|
82
|
-
/**
|
|
82
|
+
/** The reference log floor (`refLogFloor`): 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. */
|
|
83
83
|
refLogFloor: bigint;
|
|
84
|
-
/**
|
|
84
|
+
/** logFloor = 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. */
|
|
85
85
|
logFloor: bigint;
|
|
86
86
|
/** X = Σ w_j x_j, the composite index. */
|
|
87
87
|
compositeX: bigint;
|
|
88
|
-
/** This generation's income still in the pool, quote: L·(
|
|
88
|
+
/** This generation's income still in the pool, quote: L·(refLogFloor − logFloor). */
|
|
89
89
|
unharvested: bigint;
|
|
90
90
|
/**
|
|
91
91
|
* 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
|
|
@@ -306,7 +306,7 @@ export interface FPoolDescription {
|
|
|
306
306
|
/** True when the pool holds no quote: an all-base resting ask. base→quote is the one blocked path. */
|
|
307
307
|
atFloor: boolean;
|
|
308
308
|
/**
|
|
309
|
-
* This generation's fee income still in the pool, quote: `L·(
|
|
309
|
+
* This generation's fee income still in the pool, quote: `L·(refLogFloor − logFloor)` (F version 14 —
|
|
310
310
|
* `feePerL` before, per unit L). A harvest of capital moves the reference floor, so this counts
|
|
311
311
|
* from the first wei after it.
|
|
312
312
|
*/
|
|
@@ -419,7 +419,7 @@ export async function fPoolSwapBaseForBase(c: LogswapClient, a: FPoolSwapArgs &
|
|
|
419
419
|
|
|
420
420
|
// ─── liquidity ────────────────────────────────────────────────────────────────
|
|
421
421
|
|
|
422
|
-
/** Deposit dL/L of every reserve, receive shares ∝ dL.
|
|
422
|
+
/** Deposit dL/L of every reserve, receive shares ∝ dL. logFloor is untouched by construction. */
|
|
423
423
|
export async function fPoolMint(
|
|
424
424
|
c: LogswapClient,
|
|
425
425
|
/** `maxQuoteIn` is required: the quote leg is Q·dL/L at landing, and Q moves with every swap. */
|
|
@@ -601,11 +601,11 @@ export async function fPoolPreviewRollIn(
|
|
|
601
601
|
// ─── the floor lever (authority only) ─────────────────────────────────────────
|
|
602
602
|
|
|
603
603
|
/**
|
|
604
|
-
* Remove quote, lifting
|
|
604
|
+
* Remove quote, lifting logFloor — price-neutral, no base moves, and a DIVIDEND to
|
|
605
605
|
* every share: the amount goes into the pool's held income and each holder's slice is settled lazily on
|
|
606
606
|
* their next transfer, mint or burn, or pulled with {@link fPoolClaim}. The sponsor's own slice —
|
|
607
607
|
* its shares' and the locked seed's at 0xdead — is pushed to `to` at once. On a pad
|
|
608
|
-
* the lift stops at the seed floor
|
|
608
|
+
* the lift stops at the seed floor, refLogFloor (income only); nothing else bounds it — an
|
|
609
609
|
* unlocked pool's authority may take Q to zero.
|
|
610
610
|
*/
|
|
611
611
|
export async function fPoolHarvest(c: LogswapClient, a: { poolId: Hex; amount: bigint; to?: Address; account: Address }) {
|
package/src/generated.ts
CHANGED
|
@@ -1589,13 +1589,6 @@ export const fPoolManagerAbi = [
|
|
|
1589
1589
|
outputs: [{ name: 'amountOut', internalType: 'uint256', type: 'uint256' }],
|
|
1590
1590
|
stateMutability: 'nonpayable',
|
|
1591
1591
|
},
|
|
1592
|
-
{
|
|
1593
|
-
type: 'function',
|
|
1594
|
-
inputs: [{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' }],
|
|
1595
|
-
name: 'swapFeeB4B',
|
|
1596
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1597
|
-
stateMutability: 'view',
|
|
1598
|
-
},
|
|
1599
1592
|
{
|
|
1600
1593
|
type: 'function',
|
|
1601
1594
|
inputs: [
|