liquid-sdk 1.5.4 → 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/README.md +138 -61
- package/llms.txt +1 -1
- package/package.json +1 -1
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,
|
|
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
|
-
##
|
|
98
|
+
## Sniper Auction (MEV Bidding)
|
|
99
99
|
|
|
100
|
-
|
|
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
|
-
|
|
108
|
-
|
|
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
|
-
##
|
|
124
|
+
## Token Discovery
|
|
112
125
|
|
|
113
126
|
```typescript
|
|
114
|
-
// Get
|
|
115
|
-
const
|
|
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
|
|
120
|
-
const
|
|
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
|
-
//
|
|
125
|
-
const
|
|
133
|
+
// Look up a single token (fast, indexed)
|
|
134
|
+
const token = await liquid.getTokenEvent(tokenAddress);
|
|
126
135
|
|
|
127
|
-
//
|
|
128
|
-
const
|
|
136
|
+
// Paginate with block ranges
|
|
137
|
+
const page = await liquid.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
|
|
129
138
|
```
|
|
130
139
|
|
|
131
|
-
##
|
|
140
|
+
## Read Token Info
|
|
132
141
|
|
|
133
142
|
```typescript
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
console.log("Claimable:", claimable);
|
|
149
|
+
## Claim Fees & Rewards
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
##
|
|
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
|
-
//
|
|
165
|
-
|
|
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
|
-
|
|
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 |
|
|
226
|
-
|
|
227
|
-
|
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
|
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
|
|
|
235
|
-
| `
|
|
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
|
-
|
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
241
|
-
| `
|
|
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/llms.txt
CHANGED
|
@@ -120,7 +120,7 @@ Every token gets 100 billion supply (18 decimals), a Uniswap V4 pool, and locked
|
|
|
120
120
|
| hook | Static fee V2 (1% buy fee) |
|
|
121
121
|
| tickSpacing | 200 |
|
|
122
122
|
| tickIfToken0IsLiquid | -230400 (~10 ETH market cap) |
|
|
123
|
-
| positions |
|
|
123
|
+
| positions | 5-position Liquid layout: 10%/50%/15%/20%/5% |
|
|
124
124
|
| mevModule | Sniper Auction V2 (80%→40% over 32s) |
|
|
125
125
|
| rewardRecipients | [deployer] at 100% |
|
|
126
126
|
| context | {"interface":"SDK"} |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liquid-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "TypeScript SDK to deploy ERC-20 tokens with Uniswap V4 liquidity on Base — zero API keys, one dependency (viem)",
|
|
5
5
|
"author": "Liquid Protocol",
|
|
6
6
|
"homepage": "https://github.com/craigbots/liquid-sdk#readme",
|