liquid-sdk 1.6.1 → 1.6.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 +2 -2
- package/package.json +1 -1
- package/skills/bid-in-auction.md +24 -0
- package/skills/deploy-token.md +30 -1
- package/skills/sdk-overview.md +39 -2
package/AGENT_README.md
CHANGED
|
@@ -54,7 +54,7 @@ Requires wallet. Creates the token, pool, locks LP, and optionally buys tokens a
|
|
|
54
54
|
const result = await sdk.deployToken({
|
|
55
55
|
name: "My Token",
|
|
56
56
|
symbol: "MTK",
|
|
57
|
-
image: "
|
|
57
|
+
image: "ipfs://QmYourImageCID", // optional, IPFS recommended
|
|
58
58
|
metadata: '{"description":"A cool token"}', // optional, JSON string
|
|
59
59
|
context: '{"platform":"my-app"}', // optional, tracking/attribution
|
|
60
60
|
|
|
@@ -642,7 +642,7 @@ const sdk = new LiquidSDK({ publicClient, walletClient });
|
|
|
642
642
|
const result = await sdk.deployToken({
|
|
643
643
|
name: "Agent Token",
|
|
644
644
|
symbol: "AGENT",
|
|
645
|
-
image: "
|
|
645
|
+
image: "ipfs://QmYourImageCID",
|
|
646
646
|
metadata: JSON.stringify({ description: "Deployed by an AI agent" }),
|
|
647
647
|
devBuy: {
|
|
648
648
|
ethAmount: parseEther("0.01"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liquid-sdk",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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
|
@@ -29,6 +29,30 @@ Sniper auction participation involves significant financial risk:
|
|
|
29
29
|
- Display the fee percentage and total cost (bid + swap + fees) before execution
|
|
30
30
|
- Recommend small amounts for initial bids until the user understands the mechanics
|
|
31
31
|
|
|
32
|
+
## Should You Actually Bid?
|
|
33
|
+
|
|
34
|
+
**In most cases, no.** The auction is designed to extract value from snipers, not help them. The math:
|
|
35
|
+
|
|
36
|
+
| Auction fee | Tokens you receive | Price multiplier needed to break even |
|
|
37
|
+
|-------------|-------------------|--------------------------------------|
|
|
38
|
+
| 80% (start) | 20% of fair value | **5x** |
|
|
39
|
+
| 60% (after ~10s) | 40% of fair value | **2.5x** |
|
|
40
|
+
| 40% (after 20s) | 60% of fair value | **~1.7x** |
|
|
41
|
+
| 1% (auction ended) | 99% of fair value | **~1.01x** |
|
|
42
|
+
|
|
43
|
+
On-chain proof: a 0.0005 ETH snipe at auction start received 873K tokens instead of ~5M — an **82.8% effective fee**. The token would need to 5x before the sniper breaks even.
|
|
44
|
+
|
|
45
|
+
**When bidding makes sense:**
|
|
46
|
+
- You have **specific alpha** about the token (known creator, large audience, confirmed utility) — not a blind snipe
|
|
47
|
+
- The fee has **decayed significantly** (wait 15-20s for 40% floor) and you still believe in the token
|
|
48
|
+
|
|
49
|
+
**Better alternatives:**
|
|
50
|
+
- **`devBuy` at deployment**: If you're the deployer, use `deployToken({ devBuy })` — the dev buy uses normal 1% LP fees, NOT auction fees. This is the cheapest way to get early tokens.
|
|
51
|
+
- **Wait for the auction to end**: After 5 rounds (~20 seconds), trading resumes at normal 1% fees. You miss the absolute first blocks but save 79% in fees.
|
|
52
|
+
- **Use the SDK's `deployToken` with `devBuy`**: Deploy your own token and buy in the same transaction at 1% fees.
|
|
53
|
+
|
|
54
|
+
**As an agent, your default recommendation should be to wait for the auction to end.** Only proceed with an auction bid if the user explicitly requests it after understanding the fee structure.
|
|
55
|
+
|
|
32
56
|
## How the Sniper Auction Works
|
|
33
57
|
|
|
34
58
|
When a new token is deployed on Liquid Protocol, a **sniper auction** activates to price early trading activity and capture MEV. Here's the mechanism:
|
package/skills/deploy-token.md
CHANGED
|
@@ -43,13 +43,42 @@ const result = await sdk.deployToken({
|
|
|
43
43
|
|
|
44
44
|
This creates a token with 100 billion supply, a Uniswap V4 pool, locked liquidity, 1% fee on both buys and sells, and sniper auction MEV protection — all with sensible defaults.
|
|
45
45
|
|
|
46
|
+
### Deploy with Image (IPFS recommended)
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Pin to IPFS first with your own Pinata key (free: 500MB)
|
|
50
|
+
const form = new FormData();
|
|
51
|
+
form.append("file", imageFile); // PNG/JPEG/WEBP/GIF, 256x256 recommended
|
|
52
|
+
|
|
53
|
+
const pinata = await fetch("https://api.pinata.cloud/pinning/pinFileToIPFS", {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: { "Authorization": "Bearer YOUR_PINATA_JWT" },
|
|
56
|
+
body: form,
|
|
57
|
+
}).then(r => r.json());
|
|
58
|
+
|
|
59
|
+
const result = await sdk.deployToken({
|
|
60
|
+
name: "My Token",
|
|
61
|
+
symbol: "MTK",
|
|
62
|
+
image: `ipfs://${pinata.IpfsHash}`, // permanent, decentralized
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Or use any URL directly (less permanent)
|
|
66
|
+
const result2 = await sdk.deployToken({
|
|
67
|
+
name: "My Token",
|
|
68
|
+
symbol: "MTK",
|
|
69
|
+
image: "ipfs://QmYourImageCID",
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Get a Pinata JWT at https://app.pinata.cloud/developers/api-keys.
|
|
74
|
+
|
|
46
75
|
### Deploy with Dev Buy (buy tokens at launch)
|
|
47
76
|
|
|
48
77
|
```typescript
|
|
49
78
|
const result = await sdk.deployToken({
|
|
50
79
|
name: "My Token",
|
|
51
80
|
symbol: "MTK",
|
|
52
|
-
image: "
|
|
81
|
+
image: "ipfs://QmYourImageCID",
|
|
53
82
|
metadata: JSON.stringify({ description: "Launched by an AI agent" }),
|
|
54
83
|
devBuy: {
|
|
55
84
|
ethAmount: parseEther("0.01"), // ETH to spend buying tokens at launch
|
package/skills/sdk-overview.md
CHANGED
|
@@ -44,7 +44,7 @@ These fields define how the token appears in wallets, aggregators, and explorers
|
|
|
44
44
|
const result = await sdk.deployToken({
|
|
45
45
|
name: "My Project Token", // Token name (required)
|
|
46
46
|
symbol: "MPT", // Token symbol (required)
|
|
47
|
-
image: "
|
|
47
|
+
image: "ipfs://QmYourImageCID", // IPFS URI (recommended) or HTTPS URL
|
|
48
48
|
metadata: buildMetadata({ // Rich metadata (JSON, on-chain)
|
|
49
49
|
description: "A community token for builders on Base",
|
|
50
50
|
socialMediaUrls: [
|
|
@@ -77,6 +77,43 @@ await sdk.updateMetadata(tokenAddress, buildMetadata({
|
|
|
77
77
|
}));
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
### Image Upload (IPFS)
|
|
81
|
+
|
|
82
|
+
Token images should be pinned to IPFS for permanence. The `image` field in `deployToken()` accepts any string — use an `ipfs://` URI for permanent storage.
|
|
83
|
+
|
|
84
|
+
**Pin with your own Pinata key:**
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// 1. Pin image to IPFS via Pinata (your own API key)
|
|
88
|
+
const form = new FormData();
|
|
89
|
+
form.append("file", imageFile); // PNG, JPEG, WEBP, or GIF
|
|
90
|
+
|
|
91
|
+
const res = await fetch("https://api.pinata.cloud/pinning/pinFileToIPFS", {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: { "Authorization": "Bearer YOUR_PINATA_JWT" },
|
|
94
|
+
body: form,
|
|
95
|
+
});
|
|
96
|
+
const { IpfsHash } = await res.json();
|
|
97
|
+
const ipfsUri = `ipfs://${IpfsHash}`;
|
|
98
|
+
|
|
99
|
+
// 2. Deploy with IPFS image
|
|
100
|
+
await sdk.deployToken({
|
|
101
|
+
name: "My Token",
|
|
102
|
+
symbol: "MTK",
|
|
103
|
+
image: ipfsUri, // stored on-chain permanently
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Get a Pinata JWT at https://app.pinata.cloud/developers/api-keys (free tier: 500MB).
|
|
108
|
+
|
|
109
|
+
**Recommended:** 256x256 or 512x512 PNG, square. This is the standard size for DexScreener, wallet apps, and token lists.
|
|
110
|
+
|
|
111
|
+
**Accepted formats:** PNG, JPEG, WEBP, GIF.
|
|
112
|
+
|
|
113
|
+
You can also use any `https://` URL — the `image` field accepts any string. But IPFS URIs are preferred because they're permanent and decentralized.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
80
117
|
### Token Metadata Schema
|
|
81
118
|
|
|
82
119
|
Stored in the `tokenMetadata` field of the `TokenCreated` event. Wallets (Rainbow, Coinbase Wallet) and aggregators (Matcha, 0x) read this.
|
|
@@ -278,7 +315,7 @@ Only the token admin can update image and metadata after deployment.
|
|
|
278
315
|
|
|
279
316
|
```typescript
|
|
280
317
|
// Update image
|
|
281
|
-
await sdk.updateImage(tokenAddress, "
|
|
318
|
+
await sdk.updateImage(tokenAddress, "ipfs://QmNewImageCID...");
|
|
282
319
|
|
|
283
320
|
// Update metadata
|
|
284
321
|
await sdk.updateMetadata(tokenAddress, buildMetadata({
|