liquid-sdk 1.5.4 → 1.5.6

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/AGENT_README.md CHANGED
@@ -507,11 +507,11 @@ When calling `deployToken`, all fields except `name` and `symbol` are optional.
507
507
  | `image` | `""` | Empty string |
508
508
  | `metadata` | `""` | Empty string |
509
509
  | `context` | `'{"interface":"SDK"}'` | Auto-set via `buildContext()` |
510
- | `hook` | `ADDRESSES.HOOK_STATIC_FEE_V2` | Static 1% buy fee |
510
+ | `hook` | `ADDRESSES.HOOK_STATIC_FEE_V2` | Static 1% buy + 1% sell |
511
511
  | `pairedToken` | `EXTERNAL.WETH` | Base WETH |
512
512
  | `tickIfToken0IsLiquid` | `-230400` | ≈10 ETH market cap |
513
513
  | `tickSpacing` | `200` | Uniswap V4 tick spacing |
514
- | `poolData` | `encodeStaticFeePoolData(0, 100)` | 0% sell, 1% buy |
514
+ | `poolData` | `encodeStaticFeePoolData(100, 100)` | 1% sell, 1% buy |
515
515
  | `locker` | `ADDRESSES.LP_LOCKER_FEE_CONVERSION` | LP locker with fee conversion to ETH |
516
516
  | `rewardAdmins` | `[walletAddress]` | Deployer is admin |
517
517
  | `rewardRecipients` | `[walletAddress]` | Deployer gets rewards |
package/README.md CHANGED
@@ -8,7 +8,17 @@ TypeScript SDK for the Liquid Protocol token launcher on Base. Deploy tokens, ma
8
8
  npm install liquid-sdk viem
9
9
  ```
10
10
 
11
- > **Defaults**: Static 1% fee, 3-tranche liquidity (40%/50%/10% at $500K/$10M/$1B), Sniper Auction MEV (80%→40% over 32s), tick spacing 200, starting tick -230400 (~10 ETH market cap).
11
+ > **Defaults**: Static 1% fee (both buy and sell), 5-position Liquid layout, Sniper Auction MEV (80%→40% over 32s, 5 rounds), tick spacing 200, starting tick -230400 (~10 ETH market cap).
12
+
13
+ ### Default Liquidity Positions
14
+
15
+ | # | Supply | Tick Range | Market Cap Range (@$2,000/ETH) |
16
+ |---|--------|-----------|-------------------------------|
17
+ | 1 | 10% | -230,400 → -216,000 | ~$20K → ~$83K |
18
+ | 2 | 50% | -216,000 → -155,000 | ~$83K → ~$37M |
19
+ | 3 | 15% | -202,000 → -155,000 | ~$338K → ~$37M |
20
+ | 4 | 20% | -155,000 → -120,000 | ~$37M → ~$1.2B |
21
+ | 5 | 5% | -141,000 → -120,000 | ~$151M → ~$1.2B |
12
22
 
13
23
  ## Quick Start
14
24
 
@@ -95,78 +105,113 @@ const result2 = await liquid.deployToken({
95
105
  });
96
106
  ```
97
107
 
98
- ## Read Token Info
108
+ ## Sniper Auction (MEV Bidding)
99
109
 
100
- ```typescript
101
- // Get ERC20 info + deployment details
102
- const info = await liquid.getTokenInfo(tokenAddress);
103
- console.log(info.name, info.symbol, info.decimals);
104
- console.log("Hook:", info.deployment.hook);
105
- console.log("Locker:", info.deployment.locker);
110
+ Bid for early access to newly launched tokens. The SDK handles WETH wrapping, approvals, gas price encoding, and timing automatically.
106
111
 
107
- // Get deployment info only
108
- const deployment = await liquid.getDeploymentInfo(tokenAddress);
112
+ ```typescript
113
+ import { LiquidSDK, EXTERNAL } from "liquid-sdk";
114
+
115
+ // 1. Get auction state & pool key
116
+ const auction = await liquid.getAuctionState(poolId);
117
+ const rewards = await liquid.getTokenRewards(tokenAddress);
118
+ const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
119
+
120
+ // 2. Calculate gas price for your bid
121
+ const gasPrice = await liquid.getAuctionGasPriceForBid(auction.gasPeg, parseEther("0.001"));
122
+
123
+ // 3. Wait for auction block, then fire
124
+ const result = await liquid.bidInAuction({
125
+ poolKey: rewards.poolKey,
126
+ zeroForOne,
127
+ amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped)
128
+ amountOutMinimum: 0n,
129
+ round: auction.round,
130
+ bidAmount: parseEther("0.0005"), // ETH bid (msg.value)
131
+ }, gasPrice);
109
132
  ```
110
133
 
111
- ## Pool Information
134
+ ## Token Discovery
112
135
 
113
136
  ```typescript
114
- // Get pool fee configuration (dynamic fee hook)
115
- const config = await liquid.getPoolConfig(poolId);
116
- console.log("Base fee:", config.baseFee);
117
- console.log("Max LP fee:", config.maxLpFee);
137
+ // Get all tokens
138
+ const allTokens = await liquid.getTokens();
118
139
 
119
- // Get current fee state
120
- const feeState = await liquid.getPoolFeeState(poolId);
121
- console.log("Reference tick:", feeState.referenceTick);
122
- console.log("Last swap:", feeState.lastSwapTimestamp);
140
+ // Get tokens by deployer
141
+ const myTokens = await liquid.getTokens({ deployer: myAddress });
123
142
 
124
- // Check pool creation time
125
- const created = await liquid.getPoolCreationTimestamp(poolId);
143
+ // Look up a single token (fast, indexed)
144
+ const token = await liquid.getTokenEvent(tokenAddress);
126
145
 
127
- // Check token ordering
128
- const isToken0 = await liquid.isLiquidToken0(poolId);
146
+ // Paginate with block ranges
147
+ const page = await liquid.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
129
148
  ```
130
149
 
131
- ## Claim Fees
150
+ ## Read Token Info
132
151
 
133
152
  ```typescript
134
- // Check available fees
135
- const available = await liquid.getAvailableFees(ownerAddress, tokenAddress);
136
- const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
153
+ const info = await liquid.getTokenInfo(tokenAddress);
154
+ console.log(info.name, info.symbol, info.decimals);
155
+ console.log("Hook:", info.deployment.hook);
156
+ console.log("Locker:", info.deployment.locker);
157
+ ```
158
+
159
+ ## Claim Fees & Rewards
137
160
 
138
- console.log("Available:", available);
139
- console.log("Claimable:", claimable);
161
+ ```typescript
162
+ // LP Rewards
163
+ const rewards = await liquid.getTokenRewards(tokenAddress);
164
+ await liquid.collectRewards(tokenAddress);
140
165
 
141
- // Claim fees
142
- const txHash = await liquid.claimFees(ownerAddress, tokenAddress);
166
+ // Fee claims
167
+ const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
168
+ await liquid.claimFees(ownerAddress, tokenAddress);
143
169
  ```
144
170
 
145
171
  ## Vault (Token Vesting)
146
172
 
147
173
  ```typescript
148
- // Check vault allocation
149
174
  const allocation = await liquid.getVaultAllocation(tokenAddress);
150
- console.log("Total:", allocation.amountTotal);
151
- console.log("Claimed:", allocation.amountClaimed);
152
- console.log("Lockup ends:", new Date(Number(allocation.lockupEndTime) * 1000));
153
-
154
- // Check claimable amount
155
175
  const claimable = await liquid.getVaultClaimable(tokenAddress);
156
-
157
- // Claim vested tokens
158
- const txHash = await liquid.claimVault(tokenAddress);
176
+ await liquid.claimVault(tokenAddress);
159
177
  ```
160
178
 
161
- ## Factory Status
179
+ ## Agent Skills
180
+
181
+ The SDK ships with **agent skill files** — self-contained markdown guides that AI agents can load into their context to autonomously use the SDK. Find them in `node_modules/liquid-sdk/skills/` after install.
182
+
183
+ | Skill | File | What it teaches |
184
+ |-------|------|-----------------|
185
+ | **Deploy Token** | `skills/deploy-token.md` | Full deployment workflows — minimal deploy, dev buy, custom fees, custom positions, reward splits, validation rules |
186
+ | **Bid in Auction** | `skills/bid-in-auction.md` | MEV sniper auction — WETH handling, gas price encoding, block timing, automated sniper example |
187
+ | **Index Tokens** | `skills/index-tokens.md` | Token discovery — bulk queries, single lookup, pagination, real-time monitoring, data enrichment |
188
+
189
+ ### Using Skills with Your Agent
190
+
191
+ ```python
192
+ # Python — load a skill into your agent's context
193
+ with open("node_modules/liquid-sdk/skills/deploy-token.md") as f:
194
+ agent.system_prompt += f.read()
195
+ ```
162
196
 
163
197
  ```typescript
164
- // Check if factory is accepting new deployments
165
- const deprecated = await liquid.isFactoryDeprecated();
198
+ // TypeScript read skill for an MCP server or agent framework
199
+ import { readFileSync } from "fs";
200
+ const skill = readFileSync("node_modules/liquid-sdk/skills/bid-in-auction.md", "utf-8");
201
+ ```
166
202
 
167
- // Check if a locker/hook pair is enabled
168
- const enabled = await liquid.isLockerEnabled(lockerAddress, hookAddress);
203
+ For Claude Code, reference skills in your `CLAUDE.md`:
169
204
  ```
205
+ For token deployment, follow the instructions in node_modules/liquid-sdk/skills/deploy-token.md
206
+ ```
207
+
208
+ ### Additional Agent Docs
209
+
210
+ | File | Purpose |
211
+ |------|---------|
212
+ | `AGENT_README.md` | Complete API reference with every method, type, and default (700+ lines) |
213
+ | `llms.txt` | Compact summary for LLM context windows |
214
+ | `CLAUDE.md` | Agent guide with architecture, defaults, and invariants |
170
215
 
171
216
  ## Constants & ABIs
172
217
 
@@ -202,7 +247,15 @@ import {
202
247
  LiquidFactoryAbi,
203
248
  LiquidFeeLockerAbi,
204
249
  LiquidHookDynamicFeeV2Abi,
250
+ LiquidLpLockerAbi,
205
251
  LiquidVaultAbi,
252
+ LiquidSniperAuctionV2Abi,
253
+ LiquidSniperUtilV2Abi,
254
+ LiquidAirdropV2Abi,
255
+ LiquidTokenAbi,
256
+ LiquidUniv4EthDevBuyAbi,
257
+ LiquidPoolExtensionAllowlistAbi,
258
+ LiquidMevBlockDelayAbi,
206
259
  ERC20Abi,
207
260
  } from "liquid-sdk";
208
261
  ```
@@ -222,23 +275,57 @@ new LiquidSDK({ walletClient, publicClient? })
222
275
 
223
276
  #### Methods
224
277
 
225
- | Method | Description | Requires Wallet |
226
- |--------|-------------|:-:|
227
- | `deployToken(params)` | Deploy a new token + pool | Yes |
228
- | `getDeploymentInfo(token)` | Get deployment info (hook, locker, extensions) | No |
229
- | `getTokenInfo(token)` | Get ERC20 info + deployment details | No |
230
- | `getPoolConfig(poolId, hook?)` | Get dynamic fee pool configuration | No |
231
- | `getPoolFeeState(poolId, hook?)` | Get current fee state variables | No |
232
- | `getPoolCreationTimestamp(poolId, hook?)` | Get pool creation timestamp | No |
233
- | `isLiquidToken0(poolId, hook?)` | Check if Liquid token is currency0 | No |
234
- | `getAvailableFees(owner, token)` | Get available fee balance | No |
235
- | `getFeesToClaim(owner, token)` | Get claimable fee balance | No |
278
+ | Method | Description | Wallet |
279
+ |--------|-------------|:------:|
280
+ | **Deployment** | | |
281
+ | `deployToken(params)` | Deploy token + Uniswap V4 pool | Yes |
282
+ | `buildDevBuyExtension(devBuy)` | Build dev buy extension config | No |
283
+ | **Token Discovery** | | |
284
+ | `getTokens(options?)` | Query deployed tokens with filters | No |
285
+ | `getTokenEvent(token)` | Look up single token (indexed, fast) | No |
286
+ | `getDeployedTokens(deployer)` | Get tokens by deployer | No |
287
+ | **Token Info** | | |
288
+ | `getDeploymentInfo(token)` | Hook, locker, extensions | No |
289
+ | `getTokenInfo(token)` | ERC20 info + deployment details | No |
290
+ | **Token Updates** | | |
291
+ | `updateImage(token, url)` | Update token image (admin) | Yes |
292
+ | `updateMetadata(token, json)` | Update token metadata (admin) | Yes |
293
+ | **Pool State** | | |
294
+ | `getPoolConfig(poolId)` | Dynamic fee pool configuration | No |
295
+ | `getPoolFeeState(poolId)` | Current fee state variables | No |
296
+ | `getPoolCreationTimestamp(poolId)` | Pool creation timestamp | No |
297
+ | `isLiquidToken0(poolId)` | Token sort order in pool | No |
298
+ | **Fee Claims** | | |
299
+ | `getAvailableFees(owner, token)` | Total unlocked fees | No |
300
+ | `getFeesToClaim(owner, token)` | Claimable fee balance | No |
236
301
  | `claimFees(owner, token)` | Claim accumulated fees | Yes |
237
- | `getVaultAllocation(token)` | Get vault vesting allocation | No |
238
- | `getVaultClaimable(token)` | Get vested amount available to claim | No |
239
- | `claimVault(token)` | Claim vested tokens from vault | Yes |
240
- | `isFactoryDeprecated()` | Check if factory is deprecated | No |
241
- | `isLockerEnabled(locker, hook)` | Check if locker/hook pair is enabled | No |
302
+ | **LP Rewards** | | |
303
+ | `getTokenRewards(token)` | Reward config (recipients, bps, poolKey) | No |
304
+ | `collectRewards(token)` | Collect + unlock LP fees | Yes |
305
+ | `collectRewardsWithoutUnlock(token)` | Collect fees only | Yes |
306
+ | `updateRewardRecipient(token, idx, addr)` | Change reward recipient | Yes |
307
+ | **Vault** | | |
308
+ | `getVaultAllocation(token)` | Vault vesting state | No |
309
+ | `getVaultClaimable(token)` | Vested amount available | No |
310
+ | `claimVault(token)` | Claim vested tokens | Yes |
311
+ | **Airdrop** | | |
312
+ | `getAirdropInfo(token)` | Airdrop state | No |
313
+ | `getAirdropClaimable(token, recipient, amount)` | Claimable for recipient | No |
314
+ | `claimAirdrop(token, recipient, amount, proof)` | Claim airdrop | Yes |
315
+ | **Sniper Auction** | | |
316
+ | `getAuctionState(poolId)` | Round, gasPeg, fee, nextBlock | No |
317
+ | `getAuctionFeeConfig(poolId)` | Fee decay parameters | No |
318
+ | `getAuctionDecayStartTime(poolId)` | When fee decay started | No |
319
+ | `getAuctionMaxRounds()` | Max auction rounds | No |
320
+ | `getAuctionGasPriceForBid(gasPeg, bid)` | Calculate gas price for bid | No |
321
+ | `bidInAuction(params, gasPrice)` | Bid + swap (auto-wraps WETH) | Yes |
322
+ | **MEV Protection** | | |
323
+ | `getMevBlockDelay()` | Configured block delay | No |
324
+ | `getPoolUnlockTime(poolId)` | When MEV lock expires | No |
325
+ | **Factory** | | |
326
+ | `isFactoryDeprecated()` | Factory still active? | No |
327
+ | `isLockerEnabled(locker, hook)` | Locker/hook pair enabled? | No |
328
+ | `isExtensionEnabled(extension)` | Extension on allowlist? | No |
242
329
 
243
330
  ## Production Addresses
244
331
 
package/dist/index.d.mts CHANGED
@@ -429,7 +429,7 @@ declare const POOL_POSITIONS: {
429
429
  /**
430
430
  * Liquid protocol defaults.
431
431
  *
432
- * - Hook: Static fee V2, 1% on buys only (fees in ETH), 0% on sells
432
+ * - Hook: Static fee V2, 1% on both buys and sells
433
433
  * - MEV: Sniper Auction V2 — 80% → 40% decaying over 32 seconds
434
434
  * - Tick spacing: 200
435
435
  * - Starting tick: -230400 (≈10 ETH market cap)
@@ -441,10 +441,10 @@ declare const DEFAULTS: {
441
441
  readonly LOCKER: `0x${string}`;
442
442
  readonly TICK_SPACING: 200;
443
443
  readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
444
- /** Static fee on buys (ETH → token): 1% (100 bps). Fees collected in ETH. */
444
+ /** Static fee on buys (ETH → token): 1% (100 bps) */
445
445
  readonly PAIRED_FEE_BPS: 100;
446
- /** Static fee on sells (token → ETH): 0%. No fees in liquid token. */
447
- readonly LIQUID_FEE_BPS: 0;
446
+ /** Static fee on sells (token → ETH): 1% (100 bps) */
447
+ readonly LIQUID_FEE_BPS: 100;
448
448
  /** MEV module: Sniper Auction V2 */
449
449
  readonly MEV_MODULE: `0x${string}`;
450
450
  /** Sniper auction starting fee: 80% (800,000 uniBps) */
package/dist/index.d.ts CHANGED
@@ -429,7 +429,7 @@ declare const POOL_POSITIONS: {
429
429
  /**
430
430
  * Liquid protocol defaults.
431
431
  *
432
- * - Hook: Static fee V2, 1% on buys only (fees in ETH), 0% on sells
432
+ * - Hook: Static fee V2, 1% on both buys and sells
433
433
  * - MEV: Sniper Auction V2 — 80% → 40% decaying over 32 seconds
434
434
  * - Tick spacing: 200
435
435
  * - Starting tick: -230400 (≈10 ETH market cap)
@@ -441,10 +441,10 @@ declare const DEFAULTS: {
441
441
  readonly LOCKER: `0x${string}`;
442
442
  readonly TICK_SPACING: 200;
443
443
  readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
444
- /** Static fee on buys (ETH → token): 1% (100 bps). Fees collected in ETH. */
444
+ /** Static fee on buys (ETH → token): 1% (100 bps) */
445
445
  readonly PAIRED_FEE_BPS: 100;
446
- /** Static fee on sells (token → ETH): 0%. No fees in liquid token. */
447
- readonly LIQUID_FEE_BPS: 0;
446
+ /** Static fee on sells (token → ETH): 1% (100 bps) */
447
+ readonly LIQUID_FEE_BPS: 100;
448
448
  /** MEV module: Sniper Auction V2 */
449
449
  readonly MEV_MODULE: `0x${string}`;
450
450
  /** Sniper auction starting fee: 80% (800,000 uniBps) */
package/dist/index.js CHANGED
@@ -164,10 +164,10 @@ var DEFAULTS = {
164
164
  LOCKER: ADDRESSES.LP_LOCKER_FEE_CONVERSION,
165
165
  TICK_SPACING: 200,
166
166
  TICK_IF_TOKEN0_IS_LIQUID: -230400,
167
- /** Static fee on buys (ETH → token): 1% (100 bps). Fees collected in ETH. */
167
+ /** Static fee on buys (ETH → token): 1% (100 bps) */
168
168
  PAIRED_FEE_BPS: 100,
169
- /** Static fee on sells (token → ETH): 0%. No fees in liquid token. */
170
- LIQUID_FEE_BPS: 0,
169
+ /** Static fee on sells (token → ETH): 1% (100 bps) */
170
+ LIQUID_FEE_BPS: 100,
171
171
  /** MEV module: Sniper Auction V2 */
172
172
  MEV_MODULE: ADDRESSES.SNIPER_AUCTION_V2,
173
173
  /** Sniper auction starting fee: 80% (800,000 uniBps) */