liquid-sdk 1.5.3 → 1.5.5

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
@@ -428,10 +428,31 @@ const maxRounds = await sdk.getAuctionMaxRounds();
428
428
  ```typescript
429
429
  const gasPrice = await sdk.getAuctionGasPriceForBid(
430
430
  auction.gasPeg,
431
- parseEther("1"), // desired bid
431
+ parseEther("0.001"), // desired bid
432
432
  );
433
433
  ```
434
434
 
435
+ #### `sdk.bidInAuction(params, gasPrice)` — Bid in auction and swap tokens
436
+
437
+ Requires wallet. Auto-wraps ETH → WETH and approves SniperUtilV2 if needed. Sets gas manually (800K) and both `maxFeePerGas`/`maxPriorityFeePerGas` to the auction gas price.
438
+
439
+ ```typescript
440
+ const rewards = await sdk.getTokenRewards(tokenAddress);
441
+ const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
442
+
443
+ const result = await sdk.bidInAuction({
444
+ poolKey: rewards.poolKey,
445
+ zeroForOne, // depends on token sort order vs WETH
446
+ amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped from ETH)
447
+ amountOutMinimum: 0n, // set slippage in production
448
+ round: auction.round, // must match current on-chain round
449
+ bidAmount: parseEther("0.0005"), // ETH bid (sent as msg.value)
450
+ }, gasPrice);
451
+ // result.txHash — transaction hash
452
+ ```
453
+
454
+ **Important:** The bid is valid only at `nextAuctionBlock`. Submit when `currentBlock === nextAuctionBlock - 1`. The `amountIn` is pulled from your WETH balance (separate from the bid's `msg.value`). Auction runs 5 rounds, every 2 blocks, starting 2 blocks after deployment.
455
+
435
456
  ---
436
457
 
437
458
  ### MEV Protection
package/README.md CHANGED
@@ -8,7 +8,7 @@ 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% buy fee / 0% sell fee, 5-position Liquid layout (10%/50%/15%/20%/5%), Sniper Auction MEV (80%→40% over 32s, 5 rounds), tick spacing 200, starting tick -230400 (~10 ETH market cap).
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -95,78 +95,113 @@ const result2 = await liquid.deployToken({
95
95
  });
96
96
  ```
97
97
 
98
- ## Read Token Info
98
+ ## Sniper Auction (MEV Bidding)
99
99
 
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);
100
+ Bid for early access to newly launched tokens. The SDK handles WETH wrapping, approvals, gas price encoding, and timing automatically.
106
101
 
107
- // Get deployment info only
108
- const deployment = await liquid.getDeploymentInfo(tokenAddress);
102
+ ```typescript
103
+ import { LiquidSDK, EXTERNAL } from "liquid-sdk";
104
+
105
+ // 1. Get auction state & pool key
106
+ const auction = await liquid.getAuctionState(poolId);
107
+ const rewards = await liquid.getTokenRewards(tokenAddress);
108
+ const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
109
+
110
+ // 2. Calculate gas price for your bid
111
+ const gasPrice = await liquid.getAuctionGasPriceForBid(auction.gasPeg, parseEther("0.001"));
112
+
113
+ // 3. Wait for auction block, then fire
114
+ const result = await liquid.bidInAuction({
115
+ poolKey: rewards.poolKey,
116
+ zeroForOne,
117
+ amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped)
118
+ amountOutMinimum: 0n,
119
+ round: auction.round,
120
+ bidAmount: parseEther("0.0005"), // ETH bid (msg.value)
121
+ }, gasPrice);
109
122
  ```
110
123
 
111
- ## Pool Information
124
+ ## Token Discovery
112
125
 
113
126
  ```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);
127
+ // Get all tokens
128
+ const allTokens = await liquid.getTokens();
118
129
 
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);
130
+ // Get tokens by deployer
131
+ const myTokens = await liquid.getTokens({ deployer: myAddress });
123
132
 
124
- // Check pool creation time
125
- const created = await liquid.getPoolCreationTimestamp(poolId);
133
+ // Look up a single token (fast, indexed)
134
+ const token = await liquid.getTokenEvent(tokenAddress);
126
135
 
127
- // Check token ordering
128
- const isToken0 = await liquid.isLiquidToken0(poolId);
136
+ // Paginate with block ranges
137
+ const page = await liquid.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
129
138
  ```
130
139
 
131
- ## Claim Fees
140
+ ## Read Token Info
132
141
 
133
142
  ```typescript
134
- // Check available fees
135
- const available = await liquid.getAvailableFees(ownerAddress, tokenAddress);
136
- const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
143
+ const info = await liquid.getTokenInfo(tokenAddress);
144
+ console.log(info.name, info.symbol, info.decimals);
145
+ console.log("Hook:", info.deployment.hook);
146
+ console.log("Locker:", info.deployment.locker);
147
+ ```
137
148
 
138
- console.log("Available:", available);
139
- console.log("Claimable:", claimable);
149
+ ## Claim Fees & Rewards
140
150
 
141
- // Claim fees
142
- const txHash = await liquid.claimFees(ownerAddress, tokenAddress);
151
+ ```typescript
152
+ // LP Rewards
153
+ const rewards = await liquid.getTokenRewards(tokenAddress);
154
+ await liquid.collectRewards(tokenAddress);
155
+
156
+ // Fee claims
157
+ const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
158
+ await liquid.claimFees(ownerAddress, tokenAddress);
143
159
  ```
144
160
 
145
161
  ## Vault (Token Vesting)
146
162
 
147
163
  ```typescript
148
- // Check vault allocation
149
164
  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
165
  const claimable = await liquid.getVaultClaimable(tokenAddress);
156
-
157
- // Claim vested tokens
158
- const txHash = await liquid.claimVault(tokenAddress);
166
+ await liquid.claimVault(tokenAddress);
159
167
  ```
160
168
 
161
- ## Factory Status
169
+ ## Agent Skills
170
+
171
+ 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.
172
+
173
+ | Skill | File | What it teaches |
174
+ |-------|------|-----------------|
175
+ | **Deploy Token** | `skills/deploy-token.md` | Full deployment workflows — minimal deploy, dev buy, custom fees, custom positions, reward splits, validation rules |
176
+ | **Bid in Auction** | `skills/bid-in-auction.md` | MEV sniper auction — WETH handling, gas price encoding, block timing, automated sniper example |
177
+ | **Index Tokens** | `skills/index-tokens.md` | Token discovery — bulk queries, single lookup, pagination, real-time monitoring, data enrichment |
178
+
179
+ ### Using Skills with Your Agent
180
+
181
+ ```python
182
+ # Python — load a skill into your agent's context
183
+ with open("node_modules/liquid-sdk/skills/deploy-token.md") as f:
184
+ agent.system_prompt += f.read()
185
+ ```
162
186
 
163
187
  ```typescript
164
- // Check if factory is accepting new deployments
165
- const deprecated = await liquid.isFactoryDeprecated();
188
+ // TypeScript read skill for an MCP server or agent framework
189
+ import { readFileSync } from "fs";
190
+ const skill = readFileSync("node_modules/liquid-sdk/skills/bid-in-auction.md", "utf-8");
191
+ ```
166
192
 
167
- // Check if a locker/hook pair is enabled
168
- const enabled = await liquid.isLockerEnabled(lockerAddress, hookAddress);
193
+ For Claude Code, reference skills in your `CLAUDE.md`:
169
194
  ```
195
+ For token deployment, follow the instructions in node_modules/liquid-sdk/skills/deploy-token.md
196
+ ```
197
+
198
+ ### Additional Agent Docs
199
+
200
+ | File | Purpose |
201
+ |------|---------|
202
+ | `AGENT_README.md` | Complete API reference with every method, type, and default (700+ lines) |
203
+ | `llms.txt` | Compact summary for LLM context windows |
204
+ | `CLAUDE.md` | Agent guide with architecture, defaults, and invariants |
170
205
 
171
206
  ## Constants & ABIs
172
207
 
@@ -202,7 +237,15 @@ import {
202
237
  LiquidFactoryAbi,
203
238
  LiquidFeeLockerAbi,
204
239
  LiquidHookDynamicFeeV2Abi,
240
+ LiquidLpLockerAbi,
205
241
  LiquidVaultAbi,
242
+ LiquidSniperAuctionV2Abi,
243
+ LiquidSniperUtilV2Abi,
244
+ LiquidAirdropV2Abi,
245
+ LiquidTokenAbi,
246
+ LiquidUniv4EthDevBuyAbi,
247
+ LiquidPoolExtensionAllowlistAbi,
248
+ LiquidMevBlockDelayAbi,
206
249
  ERC20Abi,
207
250
  } from "liquid-sdk";
208
251
  ```
@@ -222,23 +265,57 @@ new LiquidSDK({ walletClient, publicClient? })
222
265
 
223
266
  #### Methods
224
267
 
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 |
268
+ | Method | Description | Wallet |
269
+ |--------|-------------|:------:|
270
+ | **Deployment** | | |
271
+ | `deployToken(params)` | Deploy token + Uniswap V4 pool | Yes |
272
+ | `buildDevBuyExtension(devBuy)` | Build dev buy extension config | No |
273
+ | **Token Discovery** | | |
274
+ | `getTokens(options?)` | Query deployed tokens with filters | No |
275
+ | `getTokenEvent(token)` | Look up single token (indexed, fast) | No |
276
+ | `getDeployedTokens(deployer)` | Get tokens by deployer | No |
277
+ | **Token Info** | | |
278
+ | `getDeploymentInfo(token)` | Hook, locker, extensions | No |
279
+ | `getTokenInfo(token)` | ERC20 info + deployment details | No |
280
+ | **Token Updates** | | |
281
+ | `updateImage(token, url)` | Update token image (admin) | Yes |
282
+ | `updateMetadata(token, json)` | Update token metadata (admin) | Yes |
283
+ | **Pool State** | | |
284
+ | `getPoolConfig(poolId)` | Dynamic fee pool configuration | No |
285
+ | `getPoolFeeState(poolId)` | Current fee state variables | No |
286
+ | `getPoolCreationTimestamp(poolId)` | Pool creation timestamp | No |
287
+ | `isLiquidToken0(poolId)` | Token sort order in pool | No |
288
+ | **Fee Claims** | | |
289
+ | `getAvailableFees(owner, token)` | Total unlocked fees | No |
290
+ | `getFeesToClaim(owner, token)` | Claimable fee balance | No |
236
291
  | `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 |
292
+ | **LP Rewards** | | |
293
+ | `getTokenRewards(token)` | Reward config (recipients, bps, poolKey) | No |
294
+ | `collectRewards(token)` | Collect + unlock LP fees | Yes |
295
+ | `collectRewardsWithoutUnlock(token)` | Collect fees only | Yes |
296
+ | `updateRewardRecipient(token, idx, addr)` | Change reward recipient | Yes |
297
+ | **Vault** | | |
298
+ | `getVaultAllocation(token)` | Vault vesting state | No |
299
+ | `getVaultClaimable(token)` | Vested amount available | No |
300
+ | `claimVault(token)` | Claim vested tokens | Yes |
301
+ | **Airdrop** | | |
302
+ | `getAirdropInfo(token)` | Airdrop state | No |
303
+ | `getAirdropClaimable(token, recipient, amount)` | Claimable for recipient | No |
304
+ | `claimAirdrop(token, recipient, amount, proof)` | Claim airdrop | Yes |
305
+ | **Sniper Auction** | | |
306
+ | `getAuctionState(poolId)` | Round, gasPeg, fee, nextBlock | No |
307
+ | `getAuctionFeeConfig(poolId)` | Fee decay parameters | No |
308
+ | `getAuctionDecayStartTime(poolId)` | When fee decay started | No |
309
+ | `getAuctionMaxRounds()` | Max auction rounds | No |
310
+ | `getAuctionGasPriceForBid(gasPeg, bid)` | Calculate gas price for bid | No |
311
+ | `bidInAuction(params, gasPrice)` | Bid + swap (auto-wraps WETH) | Yes |
312
+ | **MEV Protection** | | |
313
+ | `getMevBlockDelay()` | Configured block delay | No |
314
+ | `getPoolUnlockTime(poolId)` | When MEV lock expires | No |
315
+ | **Factory** | | |
316
+ | `isFactoryDeprecated()` | Factory still active? | No |
317
+ | `isLockerEnabled(locker, hook)` | Locker/hook pair enabled? | No |
318
+ | `isExtensionEnabled(extension)` | Extension on allowlist? | No |
242
319
 
243
320
  ## Production Addresses
244
321
 
package/dist/index.js CHANGED
@@ -1740,7 +1740,7 @@ var LiquidSDK = class {
1740
1740
  value: params.bidAmount,
1741
1741
  chain: import_chains2.base,
1742
1742
  account,
1743
- gas: 500000n,
1743
+ gas: 800000n,
1744
1744
  maxFeePerGas,
1745
1745
  maxPriorityFeePerGas: maxFeePerGas
1746
1746
  });