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/llms.txt
CHANGED
|
@@ -30,7 +30,7 @@ console.log(result.tokenAddress);
|
|
|
30
30
|
Liquid Protocol deploys ERC-20 tokens on Base (chain 8453) with:
|
|
31
31
|
- Uniswap V4 liquidity pools (created automatically)
|
|
32
32
|
- Locked LP with configurable reward splits
|
|
33
|
-
- MEV protection (sniper auction
|
|
33
|
+
- MEV protection (sniper auction with descending fees)
|
|
34
34
|
- Optional extensions: dev buy, vault lockup/vesting, merkle airdrops
|
|
35
35
|
|
|
36
36
|
Every token gets 100 billion supply (18 decimals), a Uniswap V4 pool, and locked liquidity.
|
|
@@ -42,9 +42,9 @@ Every token gets 100 billion supply (18 decimals), a Uniswap V4 pool, and locked
|
|
|
42
42
|
- `sdk.buildDevBuyExtension(devBuy)` — Build extension config for buying tokens at launch
|
|
43
43
|
|
|
44
44
|
### Fee Management
|
|
45
|
-
- `sdk.getAvailableFees(feeOwner,
|
|
46
|
-
- `sdk.getFeesToClaim(feeOwner,
|
|
47
|
-
- `sdk.claimFees(feeOwner,
|
|
45
|
+
- `sdk.getAvailableFees(feeOwner, tokenAddress)` — Total unlocked fees (bigint)
|
|
46
|
+
- `sdk.getFeesToClaim(feeOwner, tokenAddress)` — Claimable fees right now (bigint)
|
|
47
|
+
- `sdk.claimFees(feeOwner, tokenAddress)` — Claim fees (returns txHash)
|
|
48
48
|
|
|
49
49
|
### LP Reward Management
|
|
50
50
|
- `sdk.getTokenRewards(tokenAddress)` — Reward config (recipients, bps, admins, poolKey)
|
|
@@ -86,8 +86,8 @@ Every token gets 100 billion supply (18 decimals), a Uniswap V4 pool, and locked
|
|
|
86
86
|
- `sdk.getAuctionMaxRounds()` — Max auction rounds
|
|
87
87
|
- `sdk.getAuctionGasPriceForBid(gasPeg, bidAmount)` — Calculate gas price for bid
|
|
88
88
|
|
|
89
|
-
### MEV
|
|
90
|
-
- `sdk.
|
|
89
|
+
### MEV Descending Fees
|
|
90
|
+
- `sdk.getMevDescendingFeesBlockDelay()` — Configured block delay (also: `getMevBlockDelay()` deprecated alias)
|
|
91
91
|
- `sdk.getPoolUnlockTime(poolId)` — When MEV lock expires (unix timestamp)
|
|
92
92
|
|
|
93
93
|
### Factory & Allowlist
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liquid-sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.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/Liquid-Protocol-Ops/SDK#readme",
|
package/skills/bid-in-auction.md
CHANGED
|
@@ -22,6 +22,8 @@ Sniper auction participation involves significant financial risk:
|
|
|
22
22
|
|
|
23
23
|
7. **Smart contract risk**: The auction contracts are unaudited for this specific deployment. Bugs or misconfigurations could result in loss of funds.
|
|
24
24
|
|
|
25
|
+
8. **Standing WETH approvals are dangerous**: A lingering WETH allowance to `SniperUtilV2` (`0x2B6cd5Be183c388Dd0074d53c52317df1414cd9f`) is the surface a "drain via standing approval" exploit targets — a sibling Clanker fork was drained this way in 2026-05. **As of this SDK version, `bidInAuction` approves only the exact `amountIn` per bid** (no multiplier), so each bid consumes the allowance fully and leaves zero residual. If you bid through an older SDK that approved a multiplier, **revoke your WETH allowance to `SniperUtilV2` before bidding again**. Never grant a max/unlimited WETH approval to these contracts.
|
|
26
|
+
|
|
25
27
|
**As an agent, you MUST:**
|
|
26
28
|
- Clearly present these risks to the user before their first auction bid
|
|
27
29
|
- Ask for explicit confirmation (e.g., "I understand the risks of auction sniping and want to proceed")
|
|
@@ -98,7 +100,7 @@ Before bidding, understand these mechanics:
|
|
|
98
100
|
- **`bidAmount`** (msg.value): ETH sent to the auction as your bid. Goes to protocol/LP.
|
|
99
101
|
- **`amountIn`** (WETH transfer): The actual swap input. Pulled from your WETH balance via `transferFrom`. **This is separate from the bid.**
|
|
100
102
|
|
|
101
|
-
The SDK **automatically wraps ETH → WETH and approves the SniperUtilV2
|
|
103
|
+
The SDK **automatically wraps ETH → WETH and approves the SniperUtilV2 for the exact `amountIn`** (no multiplier — the bid's `transferFrom` consumes the full allowance, so nothing standing survives). You just need enough total ETH.
|
|
102
104
|
|
|
103
105
|
### Gas Price = Bid Encoding
|
|
104
106
|
The bid amount is encoded in the transaction's gas price: `bidAmount = (tx.gasprice - gasPeg) × paymentPerGasUnit`. Both `maxFeePerGas` **and** `maxPriorityFeePerGas` must be set to the calculated value, otherwise Base's EIP-1559 will compute a lower effective gas price.
|
|
@@ -334,7 +336,7 @@ interface BidInAuctionResult {
|
|
|
334
336
|
| Max rounds | 5 | Total auction rounds per token |
|
|
335
337
|
| Blocks between auctions | 2 | Rounds occur every 2 blocks |
|
|
336
338
|
| Blocks before first auction | 2 | First auction = deploy block + 2 |
|
|
337
|
-
| Payment per gas unit | 0.0001 ETH (1e14 wei) | Converts gas delta to bid ETH |
|
|
339
|
+
| Payment per gas unit | 0.0001 ETH (1e14 wei) | Converts gas delta to bid ETH. *May be set to 0 by the auction owner as a security mitigation — when 0, the required bid is also 0 (auctions function as a free gas-price race; the bid-payment path is neutered).* |
|
|
338
340
|
| Starting fee | 800,000 (80%) | Fee at auction start |
|
|
339
341
|
| Ending fee | 400,000 (40%) | Fee floor after decay |
|
|
340
342
|
| Decay period | 20 seconds | Time for fee to decay from start to end |
|
package/skills/deploy-token.md
CHANGED
|
@@ -281,7 +281,7 @@ import { ADDRESSES, EXTERNAL } from "liquid-sdk";
|
|
|
281
281
|
ADDRESSES.FACTORY // Token factory
|
|
282
282
|
ADDRESSES.HOOK_STATIC_FEE_V2 // Default hook (1% buy + 1% sell)
|
|
283
283
|
ADDRESSES.HOOK_DYNAMIC_FEE_V2 // Dynamic fee hook
|
|
284
|
-
ADDRESSES.LP_LOCKER_FEE_CONVERSION // Default locker (converts fees to
|
|
284
|
+
ADDRESSES.LP_LOCKER_FEE_CONVERSION // Default locker (converts fees to ETH)
|
|
285
285
|
ADDRESSES.SNIPER_AUCTION_V2 // Default MEV module
|
|
286
286
|
ADDRESSES.UNIV4_ETH_DEV_BUY // Dev buy extension
|
|
287
287
|
EXTERNAL.WETH // Base WETH
|
package/skills/index-tokens.md
CHANGED
|
@@ -261,8 +261,8 @@ console.log("Pool locked:", now < unlockTime);
|
|
|
261
261
|
|
|
262
262
|
```typescript
|
|
263
263
|
// Check accrued fees
|
|
264
|
-
const fees = await sdk.getAvailableFees(feeOwner);
|
|
265
|
-
const claimable = await sdk.getFeesToClaim(feeOwner);
|
|
264
|
+
const fees = await sdk.getAvailableFees(feeOwner, tokenAddress);
|
|
265
|
+
const claimable = await sdk.getFeesToClaim(feeOwner, tokenAddress);
|
|
266
266
|
console.log("Total fees:", fees);
|
|
267
267
|
console.log("Claimable now:", claimable);
|
|
268
268
|
```
|
package/skills/sdk-overview.md
CHANGED
|
@@ -7,7 +7,7 @@ You are an AI agent working with the `liquid-sdk` package. This file gives you a
|
|
|
7
7
|
Liquid Protocol deploys ERC-20 tokens on Base (chain ID 8453) with:
|
|
8
8
|
- **Uniswap V4 pools** created and funded automatically
|
|
9
9
|
- **Permanently locked LP** — liquidity cannot be rugged
|
|
10
|
-
- **Configurable fee splits** — reward recipients earn LP fees in
|
|
10
|
+
- **Configurable fee splits** — reward recipients earn LP fees in ETH
|
|
11
11
|
- **MEV protection** — sniper auction prices early trading activity
|
|
12
12
|
- **Extensions** — dev buy, vault lockup/vesting, merkle airdrops
|
|
13
13
|
|
|
@@ -26,7 +26,7 @@ npm install liquid-sdk viem
|
|
|
26
26
|
| **Deploy** | Launch tokens with custom fees, positions, reward splits, dev buys |
|
|
27
27
|
| **Snipe** | Bid in MEV auctions for early access to new tokens |
|
|
28
28
|
| **Index** | Discover all tokens, query by deployer, paginate by block range |
|
|
29
|
-
| **Fees** | Check and claim accumulated LP fees (converted to
|
|
29
|
+
| **Fees** | Check and claim accumulated LP fees (converted to ETH) |
|
|
30
30
|
| **Rewards** | Collect LP rewards, update reward recipients |
|
|
31
31
|
| **Vault** | Check vesting schedules, claim unlocked tokens |
|
|
32
32
|
| **Airdrop** | Check allocations, claim with merkle proofs |
|
|
@@ -225,7 +225,7 @@ await sdk.collectRewards(tokenAddress);
|
|
|
225
225
|
- `rewardBps` must sum to 10000 (100%)
|
|
226
226
|
- BPS splits are **immutable** after deployment — only recipient addresses can change
|
|
227
227
|
- Each admin can only update the recipient at their own index
|
|
228
|
-
- All fees are converted to
|
|
228
|
+
- All fees are converted to ETH before distribution (default `FeePreference.Paired`)
|
|
229
229
|
|
|
230
230
|
### Dev Buy (buy tokens at launch)
|
|
231
231
|
|
|
@@ -296,16 +296,16 @@ await sdk.claimAirdrop(tokenAddress, recipientAddress, allocatedAmount, merklePr
|
|
|
296
296
|
|
|
297
297
|
### Fee Claims
|
|
298
298
|
|
|
299
|
-
LP fees accrue from trading activity. The LP Locker Fee Conversion contract converts all fees to
|
|
299
|
+
LP fees accrue from trading activity. The LP Locker Fee Conversion contract converts all fees to ETH before distributing.
|
|
300
300
|
|
|
301
301
|
```typescript
|
|
302
302
|
// Check fees
|
|
303
|
-
const available = await sdk.getAvailableFees(ownerAddress); // total unlocked
|
|
304
|
-
const claimable = await sdk.getFeesToClaim(ownerAddress); // ready to claim
|
|
303
|
+
const available = await sdk.getAvailableFees(ownerAddress, tokenAddress); // total unlocked
|
|
304
|
+
const claimable = await sdk.getFeesToClaim(ownerAddress, tokenAddress); // ready to claim
|
|
305
305
|
|
|
306
306
|
// Claim
|
|
307
307
|
if (claimable > 0n) {
|
|
308
|
-
await sdk.claimFees(ownerAddress);
|
|
308
|
+
await sdk.claimFees(ownerAddress, tokenAddress);
|
|
309
309
|
}
|
|
310
310
|
```
|
|
311
311
|
|
|
@@ -358,7 +358,7 @@ import { ADDRESSES, EXTERNAL, FEE, TOKEN, DEFAULTS, POOL_POSITIONS } from "liqui
|
|
|
358
358
|
// Key addresses
|
|
359
359
|
ADDRESSES.FACTORY // Token factory
|
|
360
360
|
ADDRESSES.HOOK_STATIC_FEE_V2 // Default hook (1% both ways)
|
|
361
|
-
ADDRESSES.LP_LOCKER_FEE_CONVERSION // Default locker (fees →
|
|
361
|
+
ADDRESSES.LP_LOCKER_FEE_CONVERSION // Default locker (fees → ETH)
|
|
362
362
|
ADDRESSES.SNIPER_AUCTION_V2 // Default MEV module
|
|
363
363
|
|
|
364
364
|
// Fee constants
|