liquid-sdk 1.7.3 → 1.7.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 +112 -46
- package/CHANGELOG.md +17 -0
- package/README.md +239 -119
- package/dist/index.d.mts +55 -26
- package/dist/index.d.ts +55 -26
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -3
- package/dist/index.mjs.map +1 -1
- package/llms.txt +6 -6
- package/package.json +1 -1
- package/skills/bid-in-auction.md +4 -2
- 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,34 +2,79 @@
|
|
|
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
|
+
|
|
5
43
|
## Installation
|
|
6
44
|
|
|
7
45
|
```bash
|
|
8
|
-
npm install liquid-
|
|
46
|
+
npm install liquid-sdk viem
|
|
9
47
|
```
|
|
10
48
|
|
|
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
|
+
|
|
11
61
|
## Quick Start
|
|
12
62
|
|
|
13
63
|
```typescript
|
|
14
|
-
import {
|
|
64
|
+
import { createWalletClient, http } from "viem";
|
|
15
65
|
import { privateKeyToAccount } from "viem/accounts";
|
|
16
66
|
import { base } from "viem/chains";
|
|
17
|
-
import { LiquidSDK } from "liquid-
|
|
67
|
+
import { LiquidSDK } from "liquid-sdk";
|
|
18
68
|
|
|
19
69
|
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
20
70
|
|
|
21
|
-
const publicClient = createPublicClient({
|
|
22
|
-
chain: base,
|
|
23
|
-
transport: http(),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
71
|
const walletClient = createWalletClient({
|
|
27
72
|
account,
|
|
28
73
|
chain: base,
|
|
29
74
|
transport: http(),
|
|
30
75
|
});
|
|
31
76
|
|
|
32
|
-
const liquid = new LiquidSDK({
|
|
77
|
+
const liquid = new LiquidSDK({ walletClient });
|
|
33
78
|
```
|
|
34
79
|
|
|
35
80
|
## Deploy a Token
|
|
@@ -47,110 +92,126 @@ console.log("Pool ID:", result.event.poolId);
|
|
|
47
92
|
console.log("Tx:", result.txHash);
|
|
48
93
|
```
|
|
49
94
|
|
|
50
|
-
### Deploy with Custom
|
|
95
|
+
### Deploy with Custom Market Cap Positions
|
|
51
96
|
|
|
52
97
|
```typescript
|
|
53
|
-
import {
|
|
98
|
+
import { createDefaultPositions, createPositionsUSD } from "liquid-sdk";
|
|
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
|
|
54
102
|
|
|
55
103
|
const result = await liquid.deployToken({
|
|
56
|
-
name: "
|
|
57
|
-
symbol: "
|
|
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,
|
|
104
|
+
name: "My Token",
|
|
105
|
+
symbol: "MTK",
|
|
106
|
+
...positions, // tickLower, tickUpper, positionBps, tickIfToken0IsLiquid
|
|
77
107
|
});
|
|
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
|
+
]);
|
|
78
115
|
```
|
|
79
116
|
|
|
80
|
-
|
|
117
|
+
### Deploy with Custom Fees
|
|
81
118
|
|
|
82
119
|
```typescript
|
|
83
|
-
|
|
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);
|
|
120
|
+
import { ADDRESSES, encodeStaticFeePoolData, encodeDynamicFeePoolData } from "liquid-sdk";
|
|
88
121
|
|
|
89
|
-
//
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
// Static 2% fee
|
|
123
|
+
const result = await liquid.deployToken({
|
|
124
|
+
name: "Custom Fee Token",
|
|
125
|
+
symbol: "CFT",
|
|
126
|
+
poolData: encodeStaticFeePoolData(200, 200), // 2% both directions
|
|
127
|
+
});
|
|
94
128
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
+
```
|
|
100
145
|
|
|
101
|
-
|
|
102
|
-
const feeState = await liquid.getPoolFeeState(poolId);
|
|
103
|
-
console.log("Reference tick:", feeState.referenceTick);
|
|
104
|
-
console.log("Last swap:", feeState.lastSwapTimestamp);
|
|
146
|
+
## Sniper Auction (MEV Bidding)
|
|
105
147
|
|
|
106
|
-
|
|
107
|
-
const created = await liquid.getPoolCreationTimestamp(poolId);
|
|
148
|
+
Bid for early access to newly launched tokens. The SDK handles WETH wrapping, approvals, gas price encoding, and timing automatically.
|
|
108
149
|
|
|
109
|
-
|
|
110
|
-
|
|
150
|
+
```typescript
|
|
151
|
+
import { LiquidSDK, EXTERNAL } from "liquid-sdk";
|
|
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);
|
|
111
170
|
```
|
|
112
171
|
|
|
113
|
-
##
|
|
172
|
+
## Token Discovery
|
|
114
173
|
|
|
115
174
|
```typescript
|
|
116
|
-
//
|
|
117
|
-
const
|
|
118
|
-
const claimable = await liquid.getFeesToClaim(ownerAddress);
|
|
175
|
+
// Get all tokens
|
|
176
|
+
const allTokens = await liquid.getTokens();
|
|
119
177
|
|
|
120
|
-
|
|
121
|
-
|
|
178
|
+
// Get tokens by deployer
|
|
179
|
+
const myTokens = await liquid.getTokens({ deployer: myAddress });
|
|
122
180
|
|
|
123
|
-
//
|
|
124
|
-
const
|
|
181
|
+
// Look up a single token (fast, indexed)
|
|
182
|
+
const token = await liquid.getTokenEvent(tokenAddress);
|
|
125
183
|
|
|
126
|
-
//
|
|
127
|
-
const
|
|
184
|
+
// Paginate with block ranges
|
|
185
|
+
const page = await liquid.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
|
|
128
186
|
```
|
|
129
187
|
|
|
130
|
-
##
|
|
188
|
+
## Read Token Info
|
|
131
189
|
|
|
132
190
|
```typescript
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
console.log("
|
|
136
|
-
console.log("
|
|
137
|
-
|
|
191
|
+
const info = await liquid.getTokenInfo(tokenAddress);
|
|
192
|
+
console.log(info.name, info.symbol, info.decimals);
|
|
193
|
+
console.log("Hook:", info.deployment.hook);
|
|
194
|
+
console.log("Locker:", info.deployment.locker);
|
|
195
|
+
```
|
|
138
196
|
|
|
139
|
-
|
|
140
|
-
const claimable = await liquid.getVaultClaimable(tokenAddress);
|
|
197
|
+
## Claim Fees & Rewards
|
|
141
198
|
|
|
142
|
-
|
|
143
|
-
|
|
199
|
+
```typescript
|
|
200
|
+
// LP Rewards
|
|
201
|
+
const rewards = await liquid.getTokenRewards(tokenAddress);
|
|
202
|
+
await liquid.collectRewards(tokenAddress);
|
|
203
|
+
|
|
204
|
+
// Fee claims (all fees converted to ETH by default)
|
|
205
|
+
const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
|
|
206
|
+
await liquid.claimFees(ownerAddress, tokenAddress);
|
|
144
207
|
```
|
|
145
208
|
|
|
146
|
-
##
|
|
209
|
+
## Vault (Token Vesting)
|
|
147
210
|
|
|
148
211
|
```typescript
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
// Check if a locker/hook pair is enabled
|
|
153
|
-
const enabled = await liquid.isLockerEnabled(lockerAddress, hookAddress);
|
|
212
|
+
const allocation = await liquid.getVaultAllocation(tokenAddress);
|
|
213
|
+
const claimable = await liquid.getVaultClaimable(tokenAddress);
|
|
214
|
+
await liquid.claimVault(tokenAddress);
|
|
154
215
|
```
|
|
155
216
|
|
|
156
217
|
## Constants & ABIs
|
|
@@ -159,20 +220,45 @@ All production addresses, fee parameters, and contract ABIs are exported:
|
|
|
159
220
|
|
|
160
221
|
```typescript
|
|
161
222
|
import {
|
|
162
|
-
ADDRESSES,
|
|
163
|
-
EXTERNAL,
|
|
164
|
-
FEE,
|
|
165
|
-
TOKEN,
|
|
166
|
-
|
|
223
|
+
ADDRESSES, // Liquid Protocol contract addresses
|
|
224
|
+
EXTERNAL, // External protocol addresses (PoolManager, WETH, etc.)
|
|
225
|
+
FEE, // Fee constants (denominator, protocol fee, max fees)
|
|
226
|
+
TOKEN, // Token constants (supply, decimals, max extensions)
|
|
227
|
+
DEFAULTS, // Default deploy config (hook, fees, MEV, ticks)
|
|
228
|
+
POOL_POSITIONS, // Position presets (Standard, Liquid)
|
|
229
|
+
DEFAULT_CHAIN, // base chain object
|
|
167
230
|
DEFAULT_CHAIN_ID, // 8453
|
|
168
231
|
|
|
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
|
+
|
|
169
247
|
// ABIs for direct contract interaction
|
|
170
248
|
LiquidFactoryAbi,
|
|
171
249
|
LiquidFeeLockerAbi,
|
|
172
250
|
LiquidHookDynamicFeeV2Abi,
|
|
251
|
+
LiquidLpLockerAbi,
|
|
173
252
|
LiquidVaultAbi,
|
|
253
|
+
LiquidSniperAuctionV2Abi,
|
|
254
|
+
LiquidSniperUtilV2Abi,
|
|
255
|
+
LiquidAirdropV2Abi,
|
|
256
|
+
LiquidTokenAbi,
|
|
257
|
+
LiquidUniv4EthDevBuyAbi,
|
|
258
|
+
LiquidPoolExtensionAllowlistAbi,
|
|
259
|
+
LiquidMevBlockDelayAbi,
|
|
174
260
|
ERC20Abi,
|
|
175
|
-
} from "liquid-
|
|
261
|
+
} from "liquid-sdk";
|
|
176
262
|
```
|
|
177
263
|
|
|
178
264
|
## API Reference
|
|
@@ -182,31 +268,65 @@ import {
|
|
|
182
268
|
#### Constructor
|
|
183
269
|
|
|
184
270
|
```typescript
|
|
185
|
-
new LiquidSDK({
|
|
271
|
+
new LiquidSDK({ walletClient, publicClient? })
|
|
186
272
|
```
|
|
187
273
|
|
|
188
|
-
- `publicClient` (required) - viem `PublicClient` connected to Base
|
|
189
274
|
- `walletClient` (optional) - viem `WalletClient` for write operations
|
|
275
|
+
- `publicClient` (optional) - viem `PublicClient` connected to Base (auto-created if omitted)
|
|
190
276
|
|
|
191
277
|
#### Methods
|
|
192
278
|
|
|
193
|
-
| Method | Description |
|
|
194
|
-
|
|
195
|
-
|
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
|
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
201
|
-
| `
|
|
202
|
-
|
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
|
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
|
|
|
209
|
-
| `
|
|
279
|
+
| Method | Description | Wallet |
|
|
280
|
+
|--------|-------------|:------:|
|
|
281
|
+
| **Deployment** | | |
|
|
282
|
+
| `deployToken(params)` | Deploy token + Uniswap V4 pool | Yes |
|
|
283
|
+
| `buildDevBuyExtension(devBuy)` | Build dev buy extension config | No |
|
|
284
|
+
| **Token Discovery** | | |
|
|
285
|
+
| `getTokens(options?)` | Query deployed tokens with filters | No |
|
|
286
|
+
| `getTokenEvent(token)` | Look up single token (indexed, fast) | No |
|
|
287
|
+
| `getDeployedTokens(deployer)` | Get tokens by deployer | No |
|
|
288
|
+
| **Token Info** | | |
|
|
289
|
+
| `getDeploymentInfo(token)` | Hook, locker, extensions | No |
|
|
290
|
+
| `getTokenInfo(token)` | ERC20 info + deployment details | No |
|
|
291
|
+
| **Token Updates** | | |
|
|
292
|
+
| `updateImage(token, url)` | Update token image (admin) | Yes |
|
|
293
|
+
| `updateMetadata(token, json)` | Update token metadata (admin) | Yes |
|
|
294
|
+
| **Pool State** | | |
|
|
295
|
+
| `getPoolConfig(poolId)` | Dynamic fee pool configuration | No |
|
|
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 |
|
|
210
330
|
|
|
211
331
|
## Production Addresses
|
|
212
332
|
|
|
@@ -214,18 +334,18 @@ All contracts are deployed on **Base** (chain ID 8453):
|
|
|
214
334
|
|
|
215
335
|
| Contract | Address |
|
|
216
336
|
|----------|---------|
|
|
217
|
-
| Factory | `
|
|
218
|
-
| Hook Dynamic Fee V2 | `
|
|
219
|
-
| Hook Static Fee V2 | `
|
|
220
|
-
| Fee Locker | `
|
|
221
|
-
| LP Locker | `
|
|
222
|
-
|
|
|
223
|
-
|
|
|
224
|
-
| Sniper
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
337
|
+
| Factory | `0x04F1a284168743759BE6554f607a10CEBdB77760` |
|
|
338
|
+
| Hook Dynamic Fee V2 | `0x80E2F7dC8C2C880BbC4BDF80A5Fb0eB8B1DB68CC` |
|
|
339
|
+
| Hook Static Fee V2 | `0x9811f10Cd549c754Fa9E5785989c422A762c28cc` |
|
|
340
|
+
| Fee Locker | `0xF7d3BE3FC0de76fA5550C29A8F6fa53667B876FF` |
|
|
341
|
+
| LP Locker Fee Conversion | `0x77247fCD1d5e34A3703AcA898A591Dc7422435f3` |
|
|
342
|
+
| Vault | `0xdFCCC93257c20519A9005A2281CFBdF84836d50E` |
|
|
343
|
+
| Sniper Auction V2 | `0x187e8627c02c58F31831953C1268e157d3BfCefd` |
|
|
344
|
+
| Sniper Util V2 | `0x2B6cd5Be183c388Dd0074d53c52317df1414cd9f` |
|
|
345
|
+
| MEV Descending Fees | `0x8D6B080e48756A99F3893491D556B5d6907b6910` |
|
|
346
|
+
| Airdrop V2 | `0x1423974d48f525462f1c087cBFdCC20BDBc33CdD` |
|
|
347
|
+
| Pool Extension Allowlist | `0xb614167d79aDBaA9BA35d05fE1d5542d7316Ccaa` |
|
|
348
|
+
| Univ4 ETH Dev Buy | `0x5934097864dC487D21A7B4e4EEe201A39ceF728D` |
|
|
229
349
|
|
|
230
350
|
## License
|
|
231
351
|
|
package/dist/index.d.mts
CHANGED
|
@@ -471,6 +471,9 @@ declare const ADDRESSES: {
|
|
|
471
471
|
declare const EXTERNAL: {
|
|
472
472
|
readonly POOL_MANAGER: Address;
|
|
473
473
|
readonly WETH: Address;
|
|
474
|
+
/** DIEM — Liquid's intelligence-economy token. Also a pair token for
|
|
475
|
+
* agent-token launches (see `createLiquidPositionsUSD`). */
|
|
476
|
+
readonly DIEM: Address;
|
|
474
477
|
readonly UNIVERSAL_ROUTER: Address;
|
|
475
478
|
readonly PERMIT2: Address;
|
|
476
479
|
};
|
|
@@ -621,31 +624,7 @@ declare const DEFAULT_CHAIN: {
|
|
|
621
624
|
formatters: {
|
|
622
625
|
readonly block: {
|
|
623
626
|
exclude: [] | undefined;
|
|
624
|
-
format: (args: viem_chains.OpStackRpcBlock, action
|
|
625
|
-
/**
|
|
626
|
-
* Pre-built position configurations.
|
|
627
|
-
*
|
|
628
|
-
* - **Standard**: Single position covering full range (~$20K → $1.5B).
|
|
629
|
-
* Default starting tick -230400 (≈10 ETH market cap).
|
|
630
|
-
*
|
|
631
|
-
* - **Liquid**: 3-tranche default for Liquid Protocol.
|
|
632
|
-
* Hardcoded for ≈10 ETH start at ~$2070/ETH.
|
|
633
|
-
* For dynamic market cap targets, use `createPositionsUSD()` instead.
|
|
634
|
-
*
|
|
635
|
-
* Note: positionBps must sum to 10,000 (100%).
|
|
636
|
-
*/
|
|
637
|
-
? /**
|
|
638
|
-
* Pre-built position configurations.
|
|
639
|
-
*
|
|
640
|
-
* - **Standard**: Single position covering full range (~$20K → $1.5B).
|
|
641
|
-
* Default starting tick -230400 (≈10 ETH market cap).
|
|
642
|
-
*
|
|
643
|
-
* - **Liquid**: 3-tranche default for Liquid Protocol.
|
|
644
|
-
* Hardcoded for ≈10 ETH start at ~$2070/ETH.
|
|
645
|
-
* For dynamic market cap targets, use `createPositionsUSD()` instead.
|
|
646
|
-
*
|
|
647
|
-
* Note: positionBps must sum to 10,000 (100%).
|
|
648
|
-
*/: string | undefined) => {
|
|
627
|
+
format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
|
|
649
628
|
baseFeePerGas: bigint | null;
|
|
650
629
|
blobGasUsed: bigint;
|
|
651
630
|
difficulty: bigint;
|
|
@@ -2323,6 +2302,7 @@ declare function getTickFromMarketCapStable(marketCap: number, stableDecimals: n
|
|
|
2323
2302
|
* market cap milestones. Percentages represent share of the *pool supply*
|
|
2324
2303
|
* (i.e. after dev buy, airdrop, and vault allocations are deducted).
|
|
2325
2304
|
*/
|
|
2305
|
+
|
|
2326
2306
|
interface MarketCapTranche {
|
|
2327
2307
|
/** Upper bound market cap in ETH for this tranche */
|
|
2328
2308
|
upperMarketCapETH: number;
|
|
@@ -2418,6 +2398,55 @@ declare function createPositionsUSD(startingMarketCapUSD: number, ethPriceUSD: n
|
|
|
2418
2398
|
declare function createDefaultPositions(startingMarketCapUSD: number, ethPriceUSD: number, tickSpacing?: number): PositionArrays & {
|
|
2419
2399
|
tickIfToken0IsLiquid: number;
|
|
2420
2400
|
};
|
|
2401
|
+
/**
|
|
2402
|
+
* Shift every tick in a position layout by a fixed amount, preserving the
|
|
2403
|
+
* positionBps splits. The primitive behind `createLiquidPositionsUSD` — it
|
|
2404
|
+
* re-anchors a fixed-shape layout (e.g. `POOL_POSITIONS.Liquid`) to a
|
|
2405
|
+
* different starting tick.
|
|
2406
|
+
*
|
|
2407
|
+
* `shiftBy` should be a multiple of the pool's tick spacing so the shifted
|
|
2408
|
+
* ticks stay aligned. A difference of two aligned ticks is always aligned,
|
|
2409
|
+
* so deriving it as `targetTick - sourceBottomTick` is safe.
|
|
2410
|
+
*
|
|
2411
|
+
* @param positions - Source positions (e.g. `POOL_POSITIONS.Liquid`)
|
|
2412
|
+
* @param shiftBy - Ticks to add to every tickLower/tickUpper (may be negative)
|
|
2413
|
+
* @returns A fresh array — the source is not mutated
|
|
2414
|
+
*/
|
|
2415
|
+
declare function shiftPositions(positions: readonly PoolPosition[], shiftBy: number): PoolPosition[];
|
|
2416
|
+
/**
|
|
2417
|
+
* Build the canonical 5-position "Liquid" layout (10/50/15/20/5) re-anchored
|
|
2418
|
+
* to a starting market cap, denominated in the *paired token's* USD price.
|
|
2419
|
+
*
|
|
2420
|
+
* Works for any pair token — pass the price of whatever the pool is paired
|
|
2421
|
+
* against:
|
|
2422
|
+
* - WETH-paired: `createLiquidPositionsUSD(20_000, ethPriceUSD)`
|
|
2423
|
+
* - DIEM-paired: `createLiquidPositionsUSD(20_000, diemPriceUSD)`
|
|
2424
|
+
*
|
|
2425
|
+
* Unlike `createDefaultPositions` (a 3-tranche layout), this preserves the
|
|
2426
|
+
* exact shape of `POOL_POSITIONS.Liquid` — the same curve `deployToken()`
|
|
2427
|
+
* uses by default — just shifted so its bottom sits at the requested start.
|
|
2428
|
+
*
|
|
2429
|
+
* @param startingMarketCapUSD - Initial market cap in USD
|
|
2430
|
+
* @param pairedTokenPriceUSD - USD price of the token the pool is paired against
|
|
2431
|
+
* @param tickSpacing - Tick spacing (default 200)
|
|
2432
|
+
* @returns Position arrays + `tickIfToken0IsLiquid`, ready to spread into `deployToken()`
|
|
2433
|
+
*
|
|
2434
|
+
* @example
|
|
2435
|
+
* ```ts
|
|
2436
|
+
* import { LiquidSDK, EXTERNAL, createLiquidPositionsUSD } from "liquid-sdk";
|
|
2437
|
+
*
|
|
2438
|
+
* const positions = createLiquidPositionsUSD(20_000, diemPriceUSD);
|
|
2439
|
+
* await sdk.deployToken({
|
|
2440
|
+
* name: "Agent Token",
|
|
2441
|
+
* symbol: "AGENT",
|
|
2442
|
+
* pairedToken: EXTERNAL.DIEM,
|
|
2443
|
+
* ...positions,
|
|
2444
|
+
* });
|
|
2445
|
+
* ```
|
|
2446
|
+
*/
|
|
2447
|
+
declare function createLiquidPositionsUSD(startingMarketCapUSD: number, pairedTokenPriceUSD: number, tickSpacing?: number): PositionArrays & {
|
|
2448
|
+
tickIfToken0IsLiquid: number;
|
|
2449
|
+
};
|
|
2421
2450
|
/**
|
|
2422
2451
|
* Describe positions as human-readable market cap ranges.
|
|
2423
2452
|
* Useful for displaying position info in UIs.
|
|
@@ -2595,4 +2624,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
|
|
|
2595
2624
|
*/
|
|
2596
2625
|
declare function parseMetadata(metadataString: string): LiquidMetadata | null;
|
|
2597
2626
|
|
|
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 };
|
|
2627
|
+
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, createLiquidPositionsUSD, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata, shiftPositions };
|