@logswap/sdk 0.5.71 → 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 +203 -26
- package/dist/fpool.js +186 -107
- 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 +244 -146
- 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/README.md
CHANGED
|
@@ -36,14 +36,33 @@ Both are computed **offline** — no RPC, no deployment needed to address a mark
|
|
|
36
36
|
`update(...)` / `harvest(...)` / `burn(...)` / `claimFees(...)` act on it.
|
|
37
37
|
- F side: `discoverFPools(c)` (shape, and the `block` the pool was initialized in), `getFPool`,
|
|
38
38
|
`fPoolShareBalance`, `fPoolShareValue`; `previewZapIn` reads the **lens** (the router's F flows
|
|
39
|
-
live in a facet, its previews moved to the lens).
|
|
39
|
+
live in a facet, its previews moved to the lens). Since F version 25 every F state read goes
|
|
40
|
+
through the lens (`fPool`, `getFPools`, `fBundleOf`, `fDividendOf`, `fLienOf`): the manager's
|
|
41
|
+
typed views are behind `extsload` (decisions 062), and the lens decodes them with the contracts'
|
|
42
|
+
`FPoolState`, so the SDK never hard-codes the storage layout.
|
|
43
|
+
- F pool state names (F version 25): `swapFee` (was `phi`), `logFloor` θ — the log of the current
|
|
44
|
+
floor price (was `theta`), `refLogFloor` θ₀ — the reference floor income counts from (was
|
|
45
|
+
`theta0`), `cap` (d in 1e-6 log units, 0 uncapped), and per leg `virtualReserves` and `kappa`.
|
|
46
|
+
|
|
47
|
+
## Capped F pools and the lien (F version 25)
|
|
48
|
+
|
|
49
|
+
- **The cap** (decisions 061) is a key field: `FPoolKey.cap` / `FPoolCreateArgs.cap`, d =
|
|
50
|
+
ln(cap/floor) in 1e-6 log units. `fPoolCapOfLeverage(λ)` gives d for a leverage at the floor
|
|
51
|
+
(λ = 2 → the cap at twice the floor), `fPoolLeverageOfCap(d)` the inverse. Seeding by marks
|
|
52
|
+
(`x0`) on a capped pool scales each reserve by (1 − k), k = `fPoolCapK(cap, Q0, L0)`: the mark
|
|
53
|
+
reads the virtual reserve R̃ = R + c. A seed priced at or above its cap is refused.
|
|
54
|
+
- **The lien** (decisions 063): a lending contract locks an owner's shares in place.
|
|
55
|
+
`fPoolApproveShares` (the owner's per-id allowance), `fPoolLock` / `fPoolUnlock` (the locker's;
|
|
56
|
+
`to` = owner is a release, anyone else a seizure), `fPoolBankLien` (bank the locked dividend
|
|
57
|
+
now), `fPoolLienOf` (locker, amount, and the dividend the lien holds). The dividend the locked
|
|
58
|
+
amount earns is held by the lien: a repaid loan gets it back, a seizer takes it.
|
|
40
59
|
|
|
41
60
|
## Conventions
|
|
42
61
|
|
|
43
62
|
- **The SDK hides the manager/router/lens split.** Which contract hosts which action is currently
|
|
44
63
|
decided by EIP-170 headroom, not by design — so a future re-homing must be an SDK patch, not a
|
|
45
64
|
breaking change for consumers.
|
|
46
|
-
- **Zero is not the default.** A `
|
|
65
|
+
- **Zero is not the default.** A `swapFee` of `0n` (`phi` before C version 6) resolves to `DEFAULT_FEE` at *read* time, so a key
|
|
47
66
|
carrying `0n` and one carrying the resolved value are **different markets with different ids**.
|
|
48
67
|
Always address a market by the key it was initialized with.
|
|
49
68
|
- **Split every ERC-6909 `Transfer` on bit 255.** Clear means a token claim, not a position; an
|
package/dist/admin.d.ts
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* admin — the protocol's writes: the C
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* admin — the protocol's writes: the C swap-fee tax (decisions 060), the policies a pool may be
|
|
3
|
+
* born with (the registry's), the policies' own numbers (the quote list, the fee tiers, a pad's
|
|
4
|
+
* schedule, a POL's rules), and the two-step collector handover. Plain writes to the managers, the
|
|
5
|
+
* registry and the policies; no router.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* policy (`PadPolicy.setSchedule`: the protocol's pot share and the ranges a creator chooses inside) and capped by the manager (`POT_CUT_MAX`, `BURN_MAX`; a harvest has no cut, decisions 056); the release's
|
|
11
|
-
* protocol share likewise (`POT_CUT_MAX`).
|
|
7
|
+
* The mint fee has no cut to set since C version 6 / F version 24 (decisions 058): the whole fee
|
|
8
|
+
* is the protocol's on both managers. A harvest has no cut (056); a pad's protocol share of the pot
|
|
9
|
+
* is the policy's (`PadPolicy.setSchedule`), capped by the manager at `POT_CUT_MAX`.
|
|
12
10
|
*/
|
|
13
11
|
import type { Address, Hash } from "viem";
|
|
14
12
|
import type { LogswapClient } from "./client.js";
|
|
15
13
|
import { type FPoolKey, type FPoolKind } from "./fpool.js";
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The C manager's swap-fee tax (decisions 060): the protocol's share of every swap fee a C position
|
|
16
|
+
* is paid (claims and the burn's auto-claim), WAD. 0 at deployment.
|
|
17
|
+
*/
|
|
18
|
+
export declare function cSwapFeeTax(c: LogswapClient): Promise<{
|
|
19
|
+
tax: bigint;
|
|
20
|
+
max: bigint;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* `CPoolManager.setSwapFeeTax`: the collector's, at most `SWAP_FEE_TAX_MAX` (25%). Read at payout,
|
|
24
|
+
* so a raise reaches fee income already earned and not yet claimed (decisions 060).
|
|
25
|
+
*/
|
|
26
|
+
export declare function setCSwapFeeTax(c: LogswapClient, taxWad: bigint): Promise<Hash>;
|
|
20
27
|
/**
|
|
21
28
|
* The policy registry the F manager asks at every birth — `addresses.policyRegistry` when the
|
|
22
29
|
* deployment carries it, else read once from the manager. The zero address is a deployment with
|
|
@@ -90,9 +97,10 @@ export declare function fPoolMigrate(c: LogswapClient, a: {
|
|
|
90
97
|
*/
|
|
91
98
|
export declare function registryKindOf(c: LogswapClient, policy: Address): Promise<FPoolKind | "">;
|
|
92
99
|
/**
|
|
93
|
-
* `PadPolicy.setSchedule` (decisions 056): `T(0)`, the rung's growth, the protocol's share of the pot (≤ `POT_CUT_MAX`,
|
|
94
|
-
* recorded into each pad at birth), and the RANGES a creator chooses inside at creation — his cut of the pot and the burn
|
|
95
|
-
*
|
|
100
|
+
* `PadPolicy.setSchedule` (decisions 056, 057): `T(0)`, the rung's growth, the protocol's share of the pot (≤ `POT_CUT_MAX`,
|
|
101
|
+
* recorded into each pad at birth), and the RANGES a creator chooses inside at creation — his cut of the pot and the burn, a
|
|
102
|
+
* fraction of the pot spent buying the token and burning it. The burn's top plus the protocol's share is at most the pot,
|
|
103
|
+
* and each pad's three shares together are. A change applies to pads born after it. The rung is the pool's generation.
|
|
96
104
|
*/
|
|
97
105
|
export declare function padSetSchedule(c: LogswapClient, policy: Address, s: {
|
|
98
106
|
thresholdBase: bigint;
|
|
@@ -118,6 +126,20 @@ export declare function policyQuoteAllowed(c: LogswapClient, policy: Address, qu
|
|
|
118
126
|
listed: boolean;
|
|
119
127
|
allowed: boolean;
|
|
120
128
|
}>;
|
|
129
|
+
/**
|
|
130
|
+
* `setFeeListed` on any protocol policy (decisions 059): a swap-fee tier a pool of that kind may be
|
|
131
|
+
* born with while the policy curates fees. Within the family's domain (`FEE_MIN` ≤ fee ≤ `FEE_MAX`).
|
|
132
|
+
* The collector's.
|
|
133
|
+
*/
|
|
134
|
+
export declare function policySetFeeListed(c: LogswapClient, policy: Address, fee: bigint, listed: boolean): Promise<Hash>;
|
|
135
|
+
/** `setFeeCurated` on any protocol policy: on, a birth with an unlisted swap fee is refused (`FeeNotListed`). The collector's. */
|
|
136
|
+
export declare function policySetFeeCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
137
|
+
/** Whether `fee` passes `policy`'s birth check now: listed, or the policy does not curate fees (the desk's never does). */
|
|
138
|
+
export declare function policyFeeAllowed(c: LogswapClient, policy: Address, fee: bigint): Promise<{
|
|
139
|
+
curated: boolean;
|
|
140
|
+
listed: boolean;
|
|
141
|
+
allowed: boolean;
|
|
142
|
+
}>;
|
|
121
143
|
/** `PublicPolicy.setListed`: an asset a curated seed may hold. */
|
|
122
144
|
export declare function publicSetListed(c: LogswapClient, policy: Address, token: Address, listed: boolean): Promise<Hash>;
|
|
123
145
|
/** `PublicPolicy.setCurated`: whether every public seed is checked against the list. */
|
package/dist/admin.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* admin — the protocol's writes: the C
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* admin — the protocol's writes: the C swap-fee tax (decisions 060), the policies a pool may be
|
|
3
|
+
* born with (the registry's), the policies' own numbers (the quote list, the fee tiers, a pad's
|
|
4
|
+
* schedule, a POL's rules), and the two-step collector handover. Plain writes to the managers, the
|
|
5
|
+
* registry and the policies; no router.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* policy (`PadPolicy.setSchedule`: the protocol's pot share and the ranges a creator chooses inside) and capped by the manager (`POT_CUT_MAX`, `BURN_MAX`; a harvest has no cut, decisions 056); the release's
|
|
11
|
-
* protocol share likewise (`POT_CUT_MAX`).
|
|
7
|
+
* The mint fee has no cut to set since C version 6 / F version 24 (decisions 058): the whole fee
|
|
8
|
+
* is the protocol's on both managers. A harvest has no cut (056); a pad's protocol share of the pot
|
|
9
|
+
* is the policy's (`PadPolicy.setSchedule`), capped by the manager at `POT_CUT_MAX`.
|
|
12
10
|
*/
|
|
13
11
|
import { cPoolManagerAbi, fPoolManagerAbi, padPolicyAbi, polPolicyAbi, policyRegistryAbi, publicPolicyAbi } from "./generated.js";
|
|
14
12
|
import { bytes32ToText, fPolicyBaseAbi, fPoolKeyOfPool, fPoolKindOfPolicy, textToBytes32 } from "./fpool.js";
|
|
@@ -20,13 +18,23 @@ function wallet(c) {
|
|
|
20
18
|
function write(c, address, abi, functionName, args) {
|
|
21
19
|
return wallet(c).writeContract({ address, abi, functionName, args, chain: c.wallet.chain, account: c.wallet.account });
|
|
22
20
|
}
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The C manager's swap-fee tax (decisions 060): the protocol's share of every swap fee a C position
|
|
23
|
+
* is paid (claims and the burn's auto-claim), WAD. 0 at deployment.
|
|
24
|
+
*/
|
|
25
|
+
export async function cSwapFeeTax(c) {
|
|
26
|
+
const [tax, max] = await Promise.all([
|
|
27
|
+
c.public.readContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "swapFeeTax" }),
|
|
28
|
+
c.public.readContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "SWAP_FEE_TAX_MAX" }),
|
|
29
|
+
]);
|
|
30
|
+
return { tax, max };
|
|
26
31
|
}
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `CPoolManager.setSwapFeeTax`: the collector's, at most `SWAP_FEE_TAX_MAX` (25%). Read at payout,
|
|
34
|
+
* so a raise reaches fee income already earned and not yet claimed (decisions 060).
|
|
35
|
+
*/
|
|
36
|
+
export async function setCSwapFeeTax(c, taxWad) {
|
|
37
|
+
return write(c, c.addresses.cPoolManager, cPoolManagerAbi, "setSwapFeeTax", [taxWad]);
|
|
30
38
|
}
|
|
31
39
|
// ─── the registry: the LOG authority's, not the collector's ─────────────────
|
|
32
40
|
const ZERO = "0x0000000000000000000000000000000000000000";
|
|
@@ -141,9 +149,10 @@ export async function registryKindOf(c, policy) {
|
|
|
141
149
|
}
|
|
142
150
|
// ─── the policies' numbers (the collector's; each bounded where it reaches the manager) ─────
|
|
143
151
|
/**
|
|
144
|
-
* `PadPolicy.setSchedule` (decisions 056): `T(0)`, the rung's growth, the protocol's share of the pot (≤ `POT_CUT_MAX`,
|
|
145
|
-
* recorded into each pad at birth), and the RANGES a creator chooses inside at creation — his cut of the pot and the burn
|
|
146
|
-
*
|
|
152
|
+
* `PadPolicy.setSchedule` (decisions 056, 057): `T(0)`, the rung's growth, the protocol's share of the pot (≤ `POT_CUT_MAX`,
|
|
153
|
+
* recorded into each pad at birth), and the RANGES a creator chooses inside at creation — his cut of the pot and the burn, a
|
|
154
|
+
* fraction of the pot spent buying the token and burning it. The burn's top plus the protocol's share is at most the pot,
|
|
155
|
+
* and each pad's three shares together are. A change applies to pads born after it. The rung is the pool's generation.
|
|
147
156
|
*/
|
|
148
157
|
export async function padSetSchedule(c, policy, s) {
|
|
149
158
|
return write(c, policy, padPolicyAbi, "setSchedule", [
|
|
@@ -176,6 +185,26 @@ export async function policyQuoteAllowed(c, policy, quote) {
|
|
|
176
185
|
]);
|
|
177
186
|
return { curated, listed, allowed: !curated || listed };
|
|
178
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* `setFeeListed` on any protocol policy (decisions 059): a swap-fee tier a pool of that kind may be
|
|
190
|
+
* born with while the policy curates fees. Within the family's domain (`FEE_MIN` ≤ fee ≤ `FEE_MAX`).
|
|
191
|
+
* The collector's.
|
|
192
|
+
*/
|
|
193
|
+
export async function policySetFeeListed(c, policy, fee, listed) {
|
|
194
|
+
return write(c, policy, fPolicyBaseAbi, "setFeeListed", [fee, listed]);
|
|
195
|
+
}
|
|
196
|
+
/** `setFeeCurated` on any protocol policy: on, a birth with an unlisted swap fee is refused (`FeeNotListed`). The collector's. */
|
|
197
|
+
export async function policySetFeeCurated(c, policy, curated) {
|
|
198
|
+
return write(c, policy, fPolicyBaseAbi, "setFeeCurated", [curated]);
|
|
199
|
+
}
|
|
200
|
+
/** Whether `fee` passes `policy`'s birth check now: listed, or the policy does not curate fees (the desk's never does). */
|
|
201
|
+
export async function policyFeeAllowed(c, policy, fee) {
|
|
202
|
+
const [curated, listed] = await Promise.all([
|
|
203
|
+
c.public.readContract({ address: policy, abi: fPolicyBaseAbi, functionName: "feeCurated" }),
|
|
204
|
+
c.public.readContract({ address: policy, abi: fPolicyBaseAbi, functionName: "feeListed", args: [fee] }),
|
|
205
|
+
]);
|
|
206
|
+
return { curated, listed, allowed: !curated || listed };
|
|
207
|
+
}
|
|
179
208
|
/** `PublicPolicy.setListed`: an asset a curated seed may hold. */
|
|
180
209
|
export async function publicSetListed(c, policy, token, listed) {
|
|
181
210
|
return write(c, policy, publicPolicyAbi, "setListed", [token, listed]);
|
package/dist/client.d.ts
CHANGED
|
@@ -70,8 +70,13 @@ export declare function createLogswapClient(args: {
|
|
|
70
70
|
* the variance kernel and its two key fields are gone, so every pool id changed; `phiEff` is
|
|
71
71
|
* `phiOf`; `getPool` lost `sigma2Ema`; `Initialize` lost two fields; the cut is
|
|
72
72
|
* `MINT_FEE_PROTOCOL_CUT` / `setFeeParams`.
|
|
73
|
+
*
|
|
74
|
+
* **6** since 2026-10-09 (logswap-contract#58): the whole mint fee is the protocol's
|
|
75
|
+
* (`MINT_FEE_PROTOCOL_CUT` and `setFeeParams` are gone, decisions 058); the swap-fee tax at payout,
|
|
76
|
+
* `swapFeeTax` / `setSwapFeeTax` (060); `phi` is `swapFee` and `phiOf` `swapFeeOf` (059) — field
|
|
77
|
+
* names only, no pool id moved.
|
|
73
78
|
*/
|
|
74
|
-
export declare const EXPECTED_VERSION =
|
|
79
|
+
export declare const EXPECTED_VERSION = 6n;
|
|
75
80
|
/**
|
|
76
81
|
* The F manager's own tag (5 — the key's salt, pool names, the sponsor registry;
|
|
77
82
|
* 4 was the income-only harvest cut).
|
|
@@ -83,7 +88,7 @@ export declare const EXPECTED_VERSION = 5n;
|
|
|
83
88
|
* passes it; when one lands, raise this constant in the same change, which is the discipline
|
|
84
89
|
* `EXPECTED_VERSION` enforces mechanically and this one asks for.
|
|
85
90
|
*/
|
|
86
|
-
export declare const EXPECTED_F_VERSION =
|
|
91
|
+
export declare const EXPECTED_F_VERSION = 25n;
|
|
87
92
|
export declare function assertVersion(c: LogswapClient, expected?: bigint): Promise<void>;
|
|
88
93
|
/**
|
|
89
94
|
* The versions say the managers are the right code; this says the rest of the addresses belong
|
package/dist/client.js
CHANGED
|
@@ -64,8 +64,13 @@ function guardChain(wallet, pub) {
|
|
|
64
64
|
* the variance kernel and its two key fields are gone, so every pool id changed; `phiEff` is
|
|
65
65
|
* `phiOf`; `getPool` lost `sigma2Ema`; `Initialize` lost two fields; the cut is
|
|
66
66
|
* `MINT_FEE_PROTOCOL_CUT` / `setFeeParams`.
|
|
67
|
+
*
|
|
68
|
+
* **6** since 2026-10-09 (logswap-contract#58): the whole mint fee is the protocol's
|
|
69
|
+
* (`MINT_FEE_PROTOCOL_CUT` and `setFeeParams` are gone, decisions 058); the swap-fee tax at payout,
|
|
70
|
+
* `swapFeeTax` / `setSwapFeeTax` (060); `phi` is `swapFee` and `phiOf` `swapFeeOf` (059) — field
|
|
71
|
+
* names only, no pool id moved.
|
|
67
72
|
*/
|
|
68
|
-
export const EXPECTED_VERSION =
|
|
73
|
+
export const EXPECTED_VERSION = 6n;
|
|
69
74
|
/**
|
|
70
75
|
* The F manager's own tag (5 — the key's salt, pool names, the sponsor registry;
|
|
71
76
|
* 4 was the income-only harvest cut).
|
|
@@ -135,7 +140,15 @@ export const EXPECTED_VERSION = 5n;
|
|
|
135
140
|
// next threshold `threshold(gen)`. A pad never retires; a public pool refuses `regenerate`.
|
|
136
141
|
// 23: a harvest asks `may(Harvest)` and takes no terms and no cut (decisions 056): `onHarvest`, `HARVEST_CUT_MAX`,
|
|
137
142
|
// `harvestCut`, `setHarvestCut` are gone; a pad's split (creator's cut, token burn) rides in the key's salt.
|
|
138
|
-
|
|
143
|
+
// 24 (logswap-contract#58): the pot splits in quote — `Terms.burn` is quote spent on a buy-and-burn, the
|
|
144
|
+
// rest deepens the bid, no buy-in, `Regenerated` is (pot, payee, toPayee, cut, burnt, deepened), a pad's
|
|
145
|
+
// salt carries `burnShare` of the pot (057); the mint fee all to the collector (058); `phi` → `swapFee`,
|
|
146
|
+
// `MINT_FEE()` → `mintFee()`, the policies' fee tiers, a canonical public pool (059).
|
|
147
|
+
// 25 (logswap-contract#59): the views moved behind `extsload` (062) — this SDK reads them through the
|
|
148
|
+
// lens (`fPool`, `getFPools`, `fBundleOf`, `fDividendOf`, `fLienOf`); the capped F pool, `FPoolKey.cap`
|
|
149
|
+
// appended so every pool id moved (061); the lien, `lock` / `unlock` (063); θ is `logFloor`, θ₀ `refLogFloor`.
|
|
150
|
+
// A breaking bump: raised in the same change.
|
|
151
|
+
export const EXPECTED_F_VERSION = 25n;
|
|
139
152
|
export async function assertVersion(c, expected = EXPECTED_VERSION) {
|
|
140
153
|
const { cPoolManagerAbi, fPoolManagerAbi } = await import("./generated.js");
|
|
141
154
|
// three independent reads: one round trip, not three in a row
|
package/dist/fees.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function swapFeeOf(e: {
|
|
|
22
22
|
baseIn: boolean;
|
|
23
23
|
amountIn: bigint;
|
|
24
24
|
amountOut: bigint;
|
|
25
|
-
},
|
|
25
|
+
}, swapFee: bigint): bigint;
|
|
26
26
|
/** Swap fees paid over a window, in the market's quote units. */
|
|
27
27
|
export interface SwapFeeWindow {
|
|
28
28
|
fromBlock: bigint;
|
package/dist/fees.js
CHANGED
|
@@ -19,8 +19,8 @@ const YEAR_SECONDS = 31_536_000;
|
|
|
19
19
|
* @deprecated The C `Swap` event carries its `fee` since C version 5 (decisions 050); read that.
|
|
20
20
|
* This reconstruction from φ rounds where the contract does not, and is kept for older logs.
|
|
21
21
|
*/
|
|
22
|
-
export function swapFeeOf(e,
|
|
23
|
-
return e.baseIn ? (e.amountOut *
|
|
22
|
+
export function swapFeeOf(e, swapFee) {
|
|
23
|
+
return e.baseIn ? (e.amountOut * swapFee) / (WAD - swapFee) : (e.amountIn * swapFee) / (WAD + swapFee);
|
|
24
24
|
}
|
|
25
25
|
/** Probes per round of {@link blockAtOrAfter}: 15 splits the bracket 16 ways. */
|
|
26
26
|
const PROBES = 15n;
|