liquid-sdk 1.7.2 → 1.7.3
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 +36 -99
- package/CHANGELOG.md +12 -0
- package/README.md +119 -239
- package/dist/index.d.mts +41 -3
- package/dist/index.d.ts +41 -3
- package/dist/index.js +83 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -2
- package/dist/index.mjs.map +1 -1
- package/llms.txt +3 -3
- package/package.json +1 -1
- package/skills/deploy-token.md +1 -1
- package/skills/index-tokens.md +2 -2
- package/skills/sdk-overview.md +8 -8
package/README.md
CHANGED
|
@@ -2,79 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for the Liquid Protocol token launcher on Base. Deploy tokens, manage pools, and claim fees using [viem](https://viem.sh).
|
|
4
4
|
|
|
5
|
-
## Agent Skills
|
|
6
|
-
|
|
7
|
-
The SDK ships with **agent skill files** — self-contained markdown guides that AI agents can load into their context to autonomously interact with Liquid Protocol on Base.
|
|
8
|
-
|
|
9
|
-
| Skill | File | What it teaches |
|
|
10
|
-
|-------|------|-----------------|
|
|
11
|
-
| **SDK Overview** | `skills/sdk-overview.md` | Full capabilities, data schemas (metadata, context, rewards, vault, airdrop), default config — load this first |
|
|
12
|
-
| **Deploy Token** | `skills/deploy-token.md` | Deployment workflows — minimal deploy, dev buy, custom fees, custom positions, reward splits |
|
|
13
|
-
| **Bid in Auction** | `skills/bid-in-auction.md` | MEV sniper auction — WETH handling, gas price encoding, block timing, automated sniper example |
|
|
14
|
-
| **Index Tokens** | `skills/index-tokens.md` | Token discovery — bulk queries, single lookup, pagination, real-time monitoring |
|
|
15
|
-
|
|
16
|
-
### Using Skills with Your Agent
|
|
17
|
-
|
|
18
|
-
```python
|
|
19
|
-
# Python — load a skill into your agent's context
|
|
20
|
-
with open("node_modules/liquid-sdk/skills/deploy-token.md") as f:
|
|
21
|
-
agent.system_prompt += f.read()
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// TypeScript — read skill for an MCP server or agent framework
|
|
26
|
-
import { readFileSync } from "fs";
|
|
27
|
-
const skill = readFileSync("node_modules/liquid-sdk/skills/bid-in-auction.md", "utf-8");
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
For Claude Code, reference skills in your `CLAUDE.md`:
|
|
31
|
-
```
|
|
32
|
-
For token deployment, follow the instructions in node_modules/liquid-sdk/skills/deploy-token.md
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Additional Agent Docs
|
|
36
|
-
|
|
37
|
-
| File | Purpose |
|
|
38
|
-
|------|---------|
|
|
39
|
-
| `AGENT_README.md` | Complete API reference with every method, type, and default (700+ lines) |
|
|
40
|
-
| `llms.txt` | Compact summary for LLM context windows |
|
|
41
|
-
| `CLAUDE.md` | Agent guide with architecture, defaults, and invariants |
|
|
42
|
-
|
|
43
5
|
## Installation
|
|
44
6
|
|
|
45
7
|
```bash
|
|
46
|
-
npm install liquid-sdk viem
|
|
8
|
+
npm install liquid-protocol-sdk viem
|
|
47
9
|
```
|
|
48
10
|
|
|
49
|
-
> **Defaults**: Static 1% fee (both buy and sell), 5-position Liquid layout, Sniper Auction MEV (80%→40% over 20s, 5 rounds), tick spacing 200, starting tick -230400 (~10 ETH market cap). All fees converted to ETH before distribution.
|
|
50
|
-
|
|
51
|
-
### Default Liquidity Positions
|
|
52
|
-
|
|
53
|
-
| # | Supply | Tick Range | Market Cap Range (@$2,000/ETH) |
|
|
54
|
-
|---|--------|-----------|-------------------------------|
|
|
55
|
-
| 1 | 10% | -230,400 → -216,000 | ~$20K → ~$83K |
|
|
56
|
-
| 2 | 50% | -216,000 → -155,000 | ~$83K → ~$37M |
|
|
57
|
-
| 3 | 15% | -202,000 → -155,000 | ~$338K → ~$37M |
|
|
58
|
-
| 4 | 20% | -155,000 → -120,000 | ~$37M → ~$1.2B |
|
|
59
|
-
| 5 | 5% | -141,000 → -120,000 | ~$151M → ~$1.2B |
|
|
60
|
-
|
|
61
11
|
## Quick Start
|
|
62
12
|
|
|
63
13
|
```typescript
|
|
64
|
-
import { createWalletClient, http } from "viem";
|
|
14
|
+
import { createPublicClient, createWalletClient, http } from "viem";
|
|
65
15
|
import { privateKeyToAccount } from "viem/accounts";
|
|
66
16
|
import { base } from "viem/chains";
|
|
67
|
-
import { LiquidSDK } from "liquid-sdk";
|
|
17
|
+
import { LiquidSDK } from "liquid-protocol-sdk";
|
|
68
18
|
|
|
69
19
|
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
70
20
|
|
|
21
|
+
const publicClient = createPublicClient({
|
|
22
|
+
chain: base,
|
|
23
|
+
transport: http(),
|
|
24
|
+
});
|
|
25
|
+
|
|
71
26
|
const walletClient = createWalletClient({
|
|
72
27
|
account,
|
|
73
28
|
chain: base,
|
|
74
29
|
transport: http(),
|
|
75
30
|
});
|
|
76
31
|
|
|
77
|
-
const liquid = new LiquidSDK({ walletClient });
|
|
32
|
+
const liquid = new LiquidSDK({ publicClient, walletClient });
|
|
78
33
|
```
|
|
79
34
|
|
|
80
35
|
## Deploy a Token
|
|
@@ -92,126 +47,110 @@ console.log("Pool ID:", result.event.poolId);
|
|
|
92
47
|
console.log("Tx:", result.txHash);
|
|
93
48
|
```
|
|
94
49
|
|
|
95
|
-
### Deploy with Custom
|
|
50
|
+
### Deploy with Custom Configuration
|
|
96
51
|
|
|
97
52
|
```typescript
|
|
98
|
-
import {
|
|
99
|
-
|
|
100
|
-
// Use default 3-tranche split ($500K / $10M / $1B) at current ETH price
|
|
101
|
-
const positions = createDefaultPositions(20_000, 2070); // $20K start, $2070/ETH
|
|
53
|
+
import { ADDRESSES, EXTERNAL } from "liquid-protocol-sdk";
|
|
102
54
|
|
|
103
55
|
const result = await liquid.deployToken({
|
|
104
|
-
name: "
|
|
105
|
-
symbol: "
|
|
106
|
-
|
|
56
|
+
name: "Custom Token",
|
|
57
|
+
symbol: "CTK",
|
|
58
|
+
|
|
59
|
+
// Pool config
|
|
60
|
+
hook: ADDRESSES.HOOK_STATIC_FEE_V2, // use static fee hook
|
|
61
|
+
pairedToken: EXTERNAL.WETH,
|
|
62
|
+
tickSpacing: 60,
|
|
63
|
+
tickIfToken0IsLiquid: -198720,
|
|
64
|
+
|
|
65
|
+
// LP rewards: split 70/30 between creator and platform
|
|
66
|
+
rewardAdmins: [creatorAddress, platformAddress],
|
|
67
|
+
rewardRecipients: [creatorAddress, platformAddress],
|
|
68
|
+
rewardBps: [7000, 3000],
|
|
69
|
+
|
|
70
|
+
// Full-range single position
|
|
71
|
+
tickLower: [-887220],
|
|
72
|
+
tickUpper: [887220],
|
|
73
|
+
positionBps: [10000],
|
|
74
|
+
|
|
75
|
+
// MEV protection
|
|
76
|
+
mevModule: ADDRESSES.MEV_BLOCK_DELAY,
|
|
107
77
|
});
|
|
108
|
-
|
|
109
|
-
// Or define fully custom tranches
|
|
110
|
-
const custom = createPositionsUSD(50_000, 2070, [
|
|
111
|
-
{ upperMarketCapUSD: 1_000_000, supplyPct: 30 },
|
|
112
|
-
{ upperMarketCapUSD: 50_000_000, supplyPct: 50 },
|
|
113
|
-
{ upperMarketCapUSD: 500_000_000, supplyPct: 20 },
|
|
114
|
-
]);
|
|
115
78
|
```
|
|
116
79
|
|
|
117
|
-
|
|
80
|
+
## Read Token Info
|
|
118
81
|
|
|
119
82
|
```typescript
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
symbol: "CFT",
|
|
126
|
-
poolData: encodeStaticFeePoolData(200, 200), // 2% both directions
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// Dynamic fee (1%-5% range)
|
|
130
|
-
const result2 = await liquid.deployToken({
|
|
131
|
-
name: "Dynamic Token",
|
|
132
|
-
symbol: "DYN",
|
|
133
|
-
hook: ADDRESSES.HOOK_DYNAMIC_FEE_V2,
|
|
134
|
-
poolData: encodeDynamicFeePoolData({
|
|
135
|
-
baseFeeBps: 100,
|
|
136
|
-
maxFeeBps: 500,
|
|
137
|
-
referenceTickFilterPeriod: 30,
|
|
138
|
-
resetPeriod: 120,
|
|
139
|
-
resetTickFilter: 200,
|
|
140
|
-
feeControlNumerator: 500000000n,
|
|
141
|
-
decayFilterBps: 7500,
|
|
142
|
-
}),
|
|
143
|
-
});
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Sniper Auction (MEV Bidding)
|
|
147
|
-
|
|
148
|
-
Bid for early access to newly launched tokens. The SDK handles WETH wrapping, approvals, gas price encoding, and timing automatically.
|
|
83
|
+
// Get ERC20 info + deployment details
|
|
84
|
+
const info = await liquid.getTokenInfo(tokenAddress);
|
|
85
|
+
console.log(info.name, info.symbol, info.decimals);
|
|
86
|
+
console.log("Hook:", info.deployment.hook);
|
|
87
|
+
console.log("Locker:", info.deployment.locker);
|
|
149
88
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// 1. Get auction state & pool key
|
|
154
|
-
const auction = await liquid.getAuctionState(poolId);
|
|
155
|
-
const rewards = await liquid.getTokenRewards(tokenAddress);
|
|
156
|
-
const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
|
|
157
|
-
|
|
158
|
-
// 2. Calculate gas price for your bid
|
|
159
|
-
const gasPrice = await liquid.getAuctionGasPriceForBid(auction.gasPeg, parseEther("0.001"));
|
|
160
|
-
|
|
161
|
-
// 3. Wait for auction block, then fire
|
|
162
|
-
const result = await liquid.bidInAuction({
|
|
163
|
-
poolKey: rewards.poolKey,
|
|
164
|
-
zeroForOne,
|
|
165
|
-
amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped)
|
|
166
|
-
amountOutMinimum: 0n,
|
|
167
|
-
round: auction.round,
|
|
168
|
-
bidAmount: parseEther("0.0005"), // ETH bid (msg.value)
|
|
169
|
-
}, gasPrice);
|
|
89
|
+
// Get deployment info only
|
|
90
|
+
const deployment = await liquid.getDeploymentInfo(tokenAddress);
|
|
170
91
|
```
|
|
171
92
|
|
|
172
|
-
##
|
|
93
|
+
## Pool Information
|
|
173
94
|
|
|
174
95
|
```typescript
|
|
175
|
-
// Get
|
|
176
|
-
const
|
|
96
|
+
// Get pool fee configuration (dynamic fee hook)
|
|
97
|
+
const config = await liquid.getPoolConfig(poolId);
|
|
98
|
+
console.log("Base fee:", config.baseFee);
|
|
99
|
+
console.log("Max LP fee:", config.maxLpFee);
|
|
177
100
|
|
|
178
|
-
// Get
|
|
179
|
-
const
|
|
101
|
+
// Get current fee state
|
|
102
|
+
const feeState = await liquid.getPoolFeeState(poolId);
|
|
103
|
+
console.log("Reference tick:", feeState.referenceTick);
|
|
104
|
+
console.log("Last swap:", feeState.lastSwapTimestamp);
|
|
180
105
|
|
|
181
|
-
//
|
|
182
|
-
const
|
|
106
|
+
// Check pool creation time
|
|
107
|
+
const created = await liquid.getPoolCreationTimestamp(poolId);
|
|
183
108
|
|
|
184
|
-
//
|
|
185
|
-
const
|
|
109
|
+
// Check token ordering
|
|
110
|
+
const isToken0 = await liquid.isLiquidToken0(poolId);
|
|
186
111
|
```
|
|
187
112
|
|
|
188
|
-
##
|
|
113
|
+
## Claim Fees
|
|
189
114
|
|
|
190
115
|
```typescript
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
console.log("Locker:", info.deployment.locker);
|
|
195
|
-
```
|
|
116
|
+
// Check available fees
|
|
117
|
+
const available = await liquid.getAvailableFees(ownerAddress);
|
|
118
|
+
const claimable = await liquid.getFeesToClaim(ownerAddress);
|
|
196
119
|
|
|
197
|
-
|
|
120
|
+
console.log("Available:", available);
|
|
121
|
+
console.log("Claimable:", claimable);
|
|
198
122
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const rewards = await liquid.getTokenRewards(tokenAddress);
|
|
202
|
-
await liquid.collectRewards(tokenAddress);
|
|
123
|
+
// Claim fees (defaults to WETH)
|
|
124
|
+
const txHash = await liquid.claimFees(ownerAddress);
|
|
203
125
|
|
|
204
|
-
//
|
|
205
|
-
const
|
|
206
|
-
await liquid.claimFees(ownerAddress, tokenAddress);
|
|
126
|
+
// Optional: override the fee token explicitly
|
|
127
|
+
const tokenClaimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
|
|
207
128
|
```
|
|
208
129
|
|
|
209
130
|
## Vault (Token Vesting)
|
|
210
131
|
|
|
211
132
|
```typescript
|
|
133
|
+
// Check vault allocation
|
|
212
134
|
const allocation = await liquid.getVaultAllocation(tokenAddress);
|
|
135
|
+
console.log("Total:", allocation.amountTotal);
|
|
136
|
+
console.log("Claimed:", allocation.amountClaimed);
|
|
137
|
+
console.log("Lockup ends:", new Date(Number(allocation.lockupEndTime) * 1000));
|
|
138
|
+
|
|
139
|
+
// Check claimable amount
|
|
213
140
|
const claimable = await liquid.getVaultClaimable(tokenAddress);
|
|
214
|
-
|
|
141
|
+
|
|
142
|
+
// Claim vested tokens
|
|
143
|
+
const txHash = await liquid.claimVault(tokenAddress);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Factory Status
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
// Check if factory is accepting new deployments
|
|
150
|
+
const deprecated = await liquid.isFactoryDeprecated();
|
|
151
|
+
|
|
152
|
+
// Check if a locker/hook pair is enabled
|
|
153
|
+
const enabled = await liquid.isLockerEnabled(lockerAddress, hookAddress);
|
|
215
154
|
```
|
|
216
155
|
|
|
217
156
|
## Constants & ABIs
|
|
@@ -220,45 +159,20 @@ All production addresses, fee parameters, and contract ABIs are exported:
|
|
|
220
159
|
|
|
221
160
|
```typescript
|
|
222
161
|
import {
|
|
223
|
-
ADDRESSES,
|
|
224
|
-
EXTERNAL,
|
|
225
|
-
FEE,
|
|
226
|
-
TOKEN,
|
|
227
|
-
|
|
228
|
-
POOL_POSITIONS, // Position presets (Standard, Liquid)
|
|
229
|
-
DEFAULT_CHAIN, // base chain object
|
|
162
|
+
ADDRESSES, // Liquid Protocol contract addresses
|
|
163
|
+
EXTERNAL, // External protocol addresses (PoolManager, WETH, etc.)
|
|
164
|
+
FEE, // Fee constants (denominator, protocol fee, max fees)
|
|
165
|
+
TOKEN, // Token constants (supply, decimals, max extensions)
|
|
166
|
+
DEFAULT_CHAIN, // base chain object
|
|
230
167
|
DEFAULT_CHAIN_ID, // 8453
|
|
231
168
|
|
|
232
|
-
// Tick math & positions
|
|
233
|
-
getTickFromMarketCapETH,
|
|
234
|
-
getTickFromMarketCapUSD,
|
|
235
|
-
marketCapFromTickETH,
|
|
236
|
-
marketCapFromTickUSD,
|
|
237
|
-
createPositions,
|
|
238
|
-
createPositionsUSD,
|
|
239
|
-
createDefaultPositions,
|
|
240
|
-
describePositions,
|
|
241
|
-
|
|
242
|
-
// Encoding helpers
|
|
243
|
-
encodeStaticFeePoolData,
|
|
244
|
-
encodeDynamicFeePoolData,
|
|
245
|
-
encodeSniperAuctionData,
|
|
246
|
-
|
|
247
169
|
// ABIs for direct contract interaction
|
|
248
170
|
LiquidFactoryAbi,
|
|
249
171
|
LiquidFeeLockerAbi,
|
|
250
172
|
LiquidHookDynamicFeeV2Abi,
|
|
251
|
-
LiquidLpLockerAbi,
|
|
252
173
|
LiquidVaultAbi,
|
|
253
|
-
LiquidSniperAuctionV2Abi,
|
|
254
|
-
LiquidSniperUtilV2Abi,
|
|
255
|
-
LiquidAirdropV2Abi,
|
|
256
|
-
LiquidTokenAbi,
|
|
257
|
-
LiquidUniv4EthDevBuyAbi,
|
|
258
|
-
LiquidPoolExtensionAllowlistAbi,
|
|
259
|
-
LiquidMevBlockDelayAbi,
|
|
260
174
|
ERC20Abi,
|
|
261
|
-
} from "liquid-sdk";
|
|
175
|
+
} from "liquid-protocol-sdk";
|
|
262
176
|
```
|
|
263
177
|
|
|
264
178
|
## API Reference
|
|
@@ -268,65 +182,31 @@ import {
|
|
|
268
182
|
#### Constructor
|
|
269
183
|
|
|
270
184
|
```typescript
|
|
271
|
-
new LiquidSDK({
|
|
185
|
+
new LiquidSDK({ publicClient, walletClient? })
|
|
272
186
|
```
|
|
273
187
|
|
|
188
|
+
- `publicClient` (required) - viem `PublicClient` connected to Base
|
|
274
189
|
- `walletClient` (optional) - viem `WalletClient` for write operations
|
|
275
|
-
- `publicClient` (optional) - viem `PublicClient` connected to Base (auto-created if omitted)
|
|
276
190
|
|
|
277
191
|
#### Methods
|
|
278
192
|
|
|
279
|
-
| Method | Description | Wallet |
|
|
280
|
-
|
|
281
|
-
|
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
|
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
|
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
|
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
|
|
|
295
|
-
| `
|
|
296
|
-
| `getPoolFeeState(poolId)` | Current fee state variables | No |
|
|
297
|
-
| `getPoolCreationTimestamp(poolId)` | Pool creation timestamp | No |
|
|
298
|
-
| `isLiquidToken0(poolId)` | Token sort order in pool | No |
|
|
299
|
-
| **Fee Claims** | | |
|
|
300
|
-
| `getAvailableFees(owner, token)` | Total unlocked fees | No |
|
|
301
|
-
| `getFeesToClaim(owner, token)` | Claimable fee balance | No |
|
|
302
|
-
| `claimFees(owner, token)` | Claim accumulated fees | Yes |
|
|
303
|
-
| **LP Rewards** | | |
|
|
304
|
-
| `getTokenRewards(token)` | Reward config (recipients, bps, poolKey) | No |
|
|
305
|
-
| `collectRewards(token)` | Collect + unlock LP fees | Yes |
|
|
306
|
-
| `collectRewardsWithoutUnlock(token)` | Collect fees only | Yes |
|
|
307
|
-
| `updateRewardRecipient(token, idx, addr)` | Change reward recipient | Yes |
|
|
308
|
-
| **Vault** | | |
|
|
309
|
-
| `getVaultAllocation(token)` | Vault vesting state | No |
|
|
310
|
-
| `getVaultClaimable(token)` | Vested amount available | No |
|
|
311
|
-
| `claimVault(token)` | Claim vested tokens | Yes |
|
|
312
|
-
| **Airdrop** | | |
|
|
313
|
-
| `getAirdropInfo(token)` | Airdrop state | No |
|
|
314
|
-
| `getAirdropClaimable(token, recipient, amount)` | Claimable for recipient | No |
|
|
315
|
-
| `claimAirdrop(token, recipient, amount, proof)` | Claim airdrop | Yes |
|
|
316
|
-
| **Sniper Auction** | | |
|
|
317
|
-
| `getAuctionState(poolId)` | Round, gasPeg, fee, nextBlock | No |
|
|
318
|
-
| `getAuctionFeeConfig(poolId)` | Fee decay parameters | No |
|
|
319
|
-
| `getAuctionDecayStartTime(poolId)` | When fee decay started | No |
|
|
320
|
-
| `getAuctionMaxRounds()` | Max auction rounds | No |
|
|
321
|
-
| `getAuctionGasPriceForBid(gasPeg, bid)` | Calculate gas price for bid | No |
|
|
322
|
-
| `bidInAuction(params, gasPrice)` | Bid + swap (auto-wraps WETH) | Yes |
|
|
323
|
-
| **MEV Protection** | | |
|
|
324
|
-
| `getMevBlockDelay()` | Configured block delay | No |
|
|
325
|
-
| `getPoolUnlockTime(poolId)` | When MEV lock expires | No |
|
|
326
|
-
| **Factory** | | |
|
|
327
|
-
| `isFactoryDeprecated()` | Factory still active? | No |
|
|
328
|
-
| `isLockerEnabled(locker, hook)` | Locker/hook pair enabled? | No |
|
|
329
|
-
| `isExtensionEnabled(extension)` | Extension on allowlist? | No |
|
|
193
|
+
| Method | Description | Requires Wallet |
|
|
194
|
+
|--------|-------------|:-:|
|
|
195
|
+
| `deployToken(params)` | Deploy a new token + pool | Yes |
|
|
196
|
+
| `getDeploymentInfo(token)` | Get deployment info (hook, locker, extensions) | No |
|
|
197
|
+
| `getTokenInfo(token)` | Get ERC20 info + deployment details | No |
|
|
198
|
+
| `getPoolConfig(poolId, hook?)` | Get dynamic fee pool configuration | No |
|
|
199
|
+
| `getPoolFeeState(poolId, hook?)` | Get current fee state variables | No |
|
|
200
|
+
| `getPoolCreationTimestamp(poolId, hook?)` | Get pool creation timestamp | No |
|
|
201
|
+
| `isLiquidToken0(poolId, hook?)` | Check if Liquid token is currency0 | No |
|
|
202
|
+
| `getAvailableFees(owner, feeToken?)` | Get available fee balance (defaults to WETH) | No |
|
|
203
|
+
| `getFeesToClaim(owner, feeToken?)` | Get claimable fee balance (defaults to WETH) | No |
|
|
204
|
+
| `claimFees(owner, feeToken?)` | Claim accumulated fees (defaults to WETH) | Yes |
|
|
205
|
+
| `getVaultAllocation(token)` | Get vault vesting allocation | No |
|
|
206
|
+
| `getVaultClaimable(token)` | Get vested amount available to claim | No |
|
|
207
|
+
| `claimVault(token)` | Claim vested tokens from vault | Yes |
|
|
208
|
+
| `isFactoryDeprecated()` | Check if factory is deprecated | No |
|
|
209
|
+
| `isLockerEnabled(locker, hook)` | Check if locker/hook pair is enabled | No |
|
|
330
210
|
|
|
331
211
|
## Production Addresses
|
|
332
212
|
|
|
@@ -334,18 +214,18 @@ All contracts are deployed on **Base** (chain ID 8453):
|
|
|
334
214
|
|
|
335
215
|
| Contract | Address |
|
|
336
216
|
|----------|---------|
|
|
337
|
-
| Factory | `
|
|
338
|
-
| Hook Dynamic Fee V2 | `
|
|
339
|
-
| Hook Static Fee V2 | `
|
|
340
|
-
| Fee Locker | `
|
|
341
|
-
| LP Locker
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
| Sniper
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
|
348
|
-
|
|
|
217
|
+
| Factory | `0x0000003482fe299E72d4908368044A8A173BE576` |
|
|
218
|
+
| Hook Dynamic Fee V2 | `0x2A2F73CDDa098d639bd8Bbcd7dF2bf24E06728cC` |
|
|
219
|
+
| Hook Static Fee V2 | `0xb2401c5369AaCF62F8d615623C7F68F84da428Cc` |
|
|
220
|
+
| Fee Locker | `0x000008B9242b7e4432f6c4b1EeAD93562f9Cc94d` |
|
|
221
|
+
| LP Locker | `0x00000548732DfA56Be1257cE44D0CFc3B46dDb2A` |
|
|
222
|
+
| LP Locker Fee Conversion | `0x00000547518784420CEeF761fb18D884bb908102` |
|
|
223
|
+
| Vault | `0x000001c5263F4d64CdC343cDA9C8bF961CF8376c` |
|
|
224
|
+
| Sniper Auction V2 | `0x000007b64003ee07a69576F98859a0a36b854260` |
|
|
225
|
+
| Sniper Util V2 | `0x000003Ee0cb9B0C82C6C7FCB7b81a9883F285270` |
|
|
226
|
+
| MEV Block Delay | `0x0000035D83588954F3c581c3A66251b3F06AD5e4` |
|
|
227
|
+
| Airdrop V2 | `0x00000C222442512b08446D33dd9754a7F260BE79` |
|
|
228
|
+
| Pool Extension Allowlist | `0x000003Afb1b070F037D2871eE0A6b8c8f53F7B77` |
|
|
349
229
|
|
|
350
230
|
## License
|
|
351
231
|
|
package/dist/index.d.mts
CHANGED
|
@@ -63,6 +63,21 @@ interface VaultExtensionParams {
|
|
|
63
63
|
/** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
|
|
64
64
|
vestingDuration?: number;
|
|
65
65
|
}
|
|
66
|
+
interface AirdropExtensionParams {
|
|
67
|
+
/** Address allowed to `updateAdmin`, `updateMerkleRoot` (under conditions),
|
|
68
|
+
* and `adminClaim` the remainder after claim expiration. */
|
|
69
|
+
admin: Address;
|
|
70
|
+
/** Merkle root over leaves `keccak256(bytes.concat(keccak256(abi.encode(
|
|
71
|
+
* recipient, allocatedAmount))))`. Double-hashed per OZ convention. */
|
|
72
|
+
merkleRoot: Hex;
|
|
73
|
+
/** Percentage of supply to reserve for the airdrop, in BPS (1–9000). */
|
|
74
|
+
allocationBps: number;
|
|
75
|
+
/** Lockup in seconds before any recipient can claim. Min 86400 (1 day). */
|
|
76
|
+
lockupDuration: number;
|
|
77
|
+
/** Linear vesting after lockup. 0 = instant claim of full entitlement at
|
|
78
|
+
* lockup end. */
|
|
79
|
+
vestingDuration?: number;
|
|
80
|
+
}
|
|
66
81
|
interface DeployTokenParams {
|
|
67
82
|
name: string;
|
|
68
83
|
symbol: string;
|
|
@@ -270,6 +285,29 @@ declare class LiquidSDK {
|
|
|
270
285
|
* ```
|
|
271
286
|
*/
|
|
272
287
|
buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
|
|
288
|
+
/**
|
|
289
|
+
* Build an ExtensionConfig that reserves a percentage of supply into
|
|
290
|
+
* the LiquidAirdropV2 contract for merkle-tree-based distribution.
|
|
291
|
+
*
|
|
292
|
+
* The airdrop contract expects `AirdropV2ExtensionData`:
|
|
293
|
+
* { address admin, bytes32 merkleRoot, uint256 lockupDuration, uint256 vestingDuration }
|
|
294
|
+
*
|
|
295
|
+
* Leaf encoding used by LiquidAirdropV2.claim (note: **double hashed**
|
|
296
|
+
* — OZ's standard 2nd-preimage-resistant pattern):
|
|
297
|
+
* leaf = keccak256(bytes.concat(keccak256(abi.encode(recipient, allocatedAmount))))
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* const airdropExt = sdk.buildAirdropExtension({
|
|
302
|
+
* admin: account.address,
|
|
303
|
+
* merkleRoot: "0x…",
|
|
304
|
+
* allocationBps: 2000, // 20%
|
|
305
|
+
* lockupDuration: 86400, // 1 day (minimum)
|
|
306
|
+
* vestingDuration: 0, // instant claim after lockup
|
|
307
|
+
* });
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
buildAirdropExtension(airdrop: AirdropExtensionParams): ExtensionConfig;
|
|
273
311
|
/**
|
|
274
312
|
* Validate a DeploymentConfig before sending to the contract.
|
|
275
313
|
* Catches common mistakes client-side with clear error messages.
|
|
@@ -489,7 +527,7 @@ declare const POOL_POSITIONS: {
|
|
|
489
527
|
*/
|
|
490
528
|
declare const DEFAULTS: {
|
|
491
529
|
readonly HOOK: `0x${string}`;
|
|
492
|
-
/** LP Locker with fee conversion (converts fees to
|
|
530
|
+
/** LP Locker with fee conversion (converts fees to WETH before distributing) */
|
|
493
531
|
readonly LOCKER: `0x${string}`;
|
|
494
532
|
readonly TICK_SPACING: 200;
|
|
495
533
|
readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
|
|
@@ -2496,7 +2534,7 @@ declare enum FeePreference {
|
|
|
2496
2534
|
*
|
|
2497
2535
|
* @example
|
|
2498
2536
|
* ```ts
|
|
2499
|
-
* // Single recipient, fees converted to
|
|
2537
|
+
* // Single recipient, fees converted to WETH
|
|
2500
2538
|
* const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
|
|
2501
2539
|
*
|
|
2502
2540
|
* // Two recipients: first gets ETH, second gets the token
|
|
@@ -2557,4 +2595,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
|
|
|
2557
2595
|
*/
|
|
2558
2596
|
declare function parseMetadata(metadataString: string): LiquidMetadata | null;
|
|
2559
2597
|
|
|
2560
|
-
export { ADDRESSES, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
|
|
2598
|
+
export { ADDRESSES, type AirdropExtensionParams, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,21 @@ interface VaultExtensionParams {
|
|
|
63
63
|
/** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
|
|
64
64
|
vestingDuration?: number;
|
|
65
65
|
}
|
|
66
|
+
interface AirdropExtensionParams {
|
|
67
|
+
/** Address allowed to `updateAdmin`, `updateMerkleRoot` (under conditions),
|
|
68
|
+
* and `adminClaim` the remainder after claim expiration. */
|
|
69
|
+
admin: Address;
|
|
70
|
+
/** Merkle root over leaves `keccak256(bytes.concat(keccak256(abi.encode(
|
|
71
|
+
* recipient, allocatedAmount))))`. Double-hashed per OZ convention. */
|
|
72
|
+
merkleRoot: Hex;
|
|
73
|
+
/** Percentage of supply to reserve for the airdrop, in BPS (1–9000). */
|
|
74
|
+
allocationBps: number;
|
|
75
|
+
/** Lockup in seconds before any recipient can claim. Min 86400 (1 day). */
|
|
76
|
+
lockupDuration: number;
|
|
77
|
+
/** Linear vesting after lockup. 0 = instant claim of full entitlement at
|
|
78
|
+
* lockup end. */
|
|
79
|
+
vestingDuration?: number;
|
|
80
|
+
}
|
|
66
81
|
interface DeployTokenParams {
|
|
67
82
|
name: string;
|
|
68
83
|
symbol: string;
|
|
@@ -270,6 +285,29 @@ declare class LiquidSDK {
|
|
|
270
285
|
* ```
|
|
271
286
|
*/
|
|
272
287
|
buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
|
|
288
|
+
/**
|
|
289
|
+
* Build an ExtensionConfig that reserves a percentage of supply into
|
|
290
|
+
* the LiquidAirdropV2 contract for merkle-tree-based distribution.
|
|
291
|
+
*
|
|
292
|
+
* The airdrop contract expects `AirdropV2ExtensionData`:
|
|
293
|
+
* { address admin, bytes32 merkleRoot, uint256 lockupDuration, uint256 vestingDuration }
|
|
294
|
+
*
|
|
295
|
+
* Leaf encoding used by LiquidAirdropV2.claim (note: **double hashed**
|
|
296
|
+
* — OZ's standard 2nd-preimage-resistant pattern):
|
|
297
|
+
* leaf = keccak256(bytes.concat(keccak256(abi.encode(recipient, allocatedAmount))))
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* const airdropExt = sdk.buildAirdropExtension({
|
|
302
|
+
* admin: account.address,
|
|
303
|
+
* merkleRoot: "0x…",
|
|
304
|
+
* allocationBps: 2000, // 20%
|
|
305
|
+
* lockupDuration: 86400, // 1 day (minimum)
|
|
306
|
+
* vestingDuration: 0, // instant claim after lockup
|
|
307
|
+
* });
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
buildAirdropExtension(airdrop: AirdropExtensionParams): ExtensionConfig;
|
|
273
311
|
/**
|
|
274
312
|
* Validate a DeploymentConfig before sending to the contract.
|
|
275
313
|
* Catches common mistakes client-side with clear error messages.
|
|
@@ -489,7 +527,7 @@ declare const POOL_POSITIONS: {
|
|
|
489
527
|
*/
|
|
490
528
|
declare const DEFAULTS: {
|
|
491
529
|
readonly HOOK: `0x${string}`;
|
|
492
|
-
/** LP Locker with fee conversion (converts fees to
|
|
530
|
+
/** LP Locker with fee conversion (converts fees to WETH before distributing) */
|
|
493
531
|
readonly LOCKER: `0x${string}`;
|
|
494
532
|
readonly TICK_SPACING: 200;
|
|
495
533
|
readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
|
|
@@ -2496,7 +2534,7 @@ declare enum FeePreference {
|
|
|
2496
2534
|
*
|
|
2497
2535
|
* @example
|
|
2498
2536
|
* ```ts
|
|
2499
|
-
* // Single recipient, fees converted to
|
|
2537
|
+
* // Single recipient, fees converted to WETH
|
|
2500
2538
|
* const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
|
|
2501
2539
|
*
|
|
2502
2540
|
* // Two recipients: first gets ETH, second gets the token
|
|
@@ -2557,4 +2595,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
|
|
|
2557
2595
|
*/
|
|
2558
2596
|
declare function parseMetadata(metadataString: string): LiquidMetadata | null;
|
|
2559
2597
|
|
|
2560
|
-
export { ADDRESSES, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
|
|
2598
|
+
export { ADDRESSES, type AirdropExtensionParams, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
|