Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist/
!.env.example
.DS_Store
coverage/
.cursor/
29 changes: 16 additions & 13 deletions AGENT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ No API keys, no backend, no database. The SDK talks directly to Base mainnet con
Liquid Protocol deploys ERC-20 tokens on Base with:
- Uniswap V4 liquidity pools (automatic)
- LP fee collection and reward distribution
- MEV protection via block delay
- MEV protection via sniper auction
- Optional extensions: dev buy, vault lockup/vesting, airdrops

Every token gets 100 billion supply (18 decimals), a Uniswap V4 pool, and locked liquidity with configurable reward splits.
Expand Down Expand Up @@ -161,7 +161,7 @@ const txHash = await sdk.collectRewardsWithoutUnlock(tokenAddress);
await publicClient.waitForTransactionReceipt({ hash: txHash });
```

**Important:** After deployment, the pool is locked for a MEV block delay. `collectRewardsWithoutUnlock` may revert with `ManagerLocked` if called too soon. Use `getPoolUnlockTime` to check.
**Important:** After deployment, the sniper auction MEV module may block early reward collection. If `collectRewardsWithoutUnlock` reverts with `ManagerLocked`, wait for the auction period to end.

#### `sdk.updateRewardRecipient(tokenAddress, rewardIndex, newRecipient)` — Change reward recipient

Expand Down Expand Up @@ -455,21 +455,23 @@ const result = await sdk.bidInAuction({

---

### MEV Protection
### MEV Descending Fees

#### `sdk.getMevBlockDelay()` — Get configured block delay
#### `sdk.getMevDescendingFeesBlockDelay()` — Configured block delay

```typescript
const delay = await sdk.getMevBlockDelay();
// delay: bigint — number of blocks
const delay = await sdk.getMevDescendingFeesBlockDelay();
// delay: bigint — number of blocks the MEV module fee window covers
```

#### `sdk.getPoolUnlockTime(poolId)` — When does MEV lock expire
`sdk.getMevBlockDelay()` is a deprecated alias for the same call.

#### `sdk.getPoolUnlockTime(poolId)` — When MEV lock expires

```typescript
const unlockTime = await sdk.getPoolUnlockTime(poolId);
// unlockTime: bigint — unix timestamp
// If Date.now()/1000 < unlockTime, pool is still locked
// If Date.now()/1000 < unlockTime, the pool is still inside the MEV window
// and writes that go through the MevDescendingFees hook may revert with ManagerLocked.
```

---
Expand Down Expand Up @@ -516,9 +518,9 @@ When calling `deployToken`, all fields except `name` and `symbol` are optional.
| `rewardAdmins` | `[walletAddress]` | Deployer is admin |
| `rewardRecipients` | `[walletAddress]` | Deployer gets rewards |
| `rewardBps` | `[10000]` | 100% to deployer |
| `tickLower` | `[-230400, -198600, -168600]` | 3-tranche Liquid default |
| `tickUpper` | `[-198600, -168600, -122600]` | 3-tranche Liquid default |
| `positionBps` | `[4000, 5000, 1000]` | 40% / 50% / 10% |
| `tickLower` | `[-230400, -216000, -202000, -155000, -141000]` | 5-position Liquid layout |
| `tickUpper` | `[-216000, -155000, -155000, -120000, -120000]` | 5-position Liquid layout |
| `positionBps` | `[1000, 5000, 1500, 2000, 500]` | 10% / 50% / 15% / 20% / 5% |
| `mevModule` | `ADDRESSES.SNIPER_AUCTION_V2` | 80%→40% over 20s |
| `extensions` | `[]` | No extensions |

Expand Down Expand Up @@ -587,7 +589,8 @@ import {
LiquidSniperUtilV2Abi,
LiquidAirdropV2Abi,
LiquidPoolExtensionAllowlistAbi,
LiquidMevBlockDelayAbi,
LiquidMevDescendingFeesAbi,
LiquidMevBlockDelayAbi, // deprecated alias — prefer LiquidMevDescendingFeesAbi
LiquidLpLockerAbi,
ERC20Abi,
} from "liquid-sdk";
Expand Down
14 changes: 7 additions & 7 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ When `deployToken()` is called with minimal params, the SDK fills these defaults

| Parameter | Default | Notes |
|-----------|---------|-------|
| `hook` | HookDynamicFeeV2 | Tick-based dynamic fees |
| `hook` | HookStaticFeeV2 | 1% buy + 1% sell static fees |
| `pairedToken` | WETH | `0x4200...0006` on Base |
| `tickIfToken0IsLiquid` | -198720 | ~$0.001 WETH/token initial price |
| `tickSpacing` | 60 | Standard Uniswap v4 spacing |
| `locker` | LP_LOCKER | Standard LP locker |
| `mevModule` | MEV_BLOCK_DELAY | Block-based MEV protection |
| `tickLower/tickUpper` | [-887220, 887220] | Full-range position |
| `positionBps` | [10000] | Single position, 100% |
| `tickIfToken0IsLiquid` | -230400 | ~10 ETH / ~$20K market cap |
| `tickSpacing` | 200 | Uniswap v4 tick spacing |
| `locker` | LP_LOCKER_FEE_CONVERSION | LP locker with fee conversion to ETH |
| `mevModule` | SNIPER_AUCTION_V2 | 80%→40% over 20s sniper auction |
| `tickLower/tickUpper` | 5-position Liquid layout | See POOL_POSITIONS.Liquid |
| `positionBps` | [1000, 5000, 1500, 2000, 500] | 5-position Liquid layout |
| `rewardBps` | [10000] | All rewards to caller |
| `salt` | keccak256(name + symbol + timestamp) | Random per deployment |
10 changes: 6 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## What Is This Project?

**liquid-sdk** (`v1.5.1`) is a TypeScript SDK for the Liquid Protocol token launcher on Base (chain ID 8453). It deploys ERC-20 tokens with permanent, locked Uniswap V4 liquidity pools and provides read/write helpers for pool state, fee claiming, vaults, airdrops, auctions, and MEV bidding.
**liquid-sdk** (`v1.6.3`) is a TypeScript SDK for the Liquid Protocol token launcher on Base (chain ID 8453). It deploys ERC-20 tokens with permanent, locked Uniswap V4 liquidity pools and provides read/write helpers for pool state, fee claiming, vaults, airdrops, auctions, and MEV bidding.

---

Expand Down Expand Up @@ -209,10 +209,11 @@ await sdk.getAuctionGasPriceForBid(gasPeg, amount) // → bigint
await sdk.bidInAuction(params, maxFeePerGas) // → { txHash } (write)
```

### MEV Protection
### MEV Descending Fees

```typescript
await sdk.getMevBlockDelay() // → bigint
await sdk.getMevDescendingFeesBlockDelay() // → bigint (block window)
await sdk.getMevBlockDelay() // → bigint (deprecated alias)
await sdk.getPoolUnlockTime(poolId) // → bigint (unix timestamp)
```

Expand Down Expand Up @@ -366,7 +367,8 @@ The SDK exports 13 ABIs:
| `LiquidSniperUtilV2Abi` | Sniper Util (bidInAuction, getTxGasPriceForBidAmount) |
| `LiquidAirdropV2Abi` | Airdrop (airdrops, claim, amountAvailableToClaim) |
| `LiquidPoolExtensionAllowlistAbi` | Extension allowlist |
| `LiquidMevBlockDelayAbi` | MEV Block Delay (blockDelay, poolUnlockTime) |
| `LiquidMevDescendingFeesAbi` | MEV Descending Fees (blockDelay, poolUnlockTime) |
| `LiquidMevBlockDelayAbi` | Deprecated alias — use `LiquidMevDescendingFeesAbi` |
| `LiquidLpLockerAbi` | LP Locker (tokenRewards, collectRewards, updateRewardRecipient, updateRewardAdmin) |
| `LiquidTokenAbi` | Token (updateImage, updateMetadata, updateAdmin) |
| `LiquidUniv4EthDevBuyAbi` | Dev Buy Extension (receiveTokens) |
Expand Down
Loading
Loading