liquid-sdk 1.5.3 → 1.5.4
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 +22 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/bid-in-auction.md +3 -3
package/AGENT_README.md
CHANGED
|
@@ -428,10 +428,31 @@ const maxRounds = await sdk.getAuctionMaxRounds();
|
|
|
428
428
|
```typescript
|
|
429
429
|
const gasPrice = await sdk.getAuctionGasPriceForBid(
|
|
430
430
|
auction.gasPeg,
|
|
431
|
-
parseEther("
|
|
431
|
+
parseEther("0.001"), // desired bid
|
|
432
432
|
);
|
|
433
433
|
```
|
|
434
434
|
|
|
435
|
+
#### `sdk.bidInAuction(params, gasPrice)` — Bid in auction and swap tokens
|
|
436
|
+
|
|
437
|
+
Requires wallet. Auto-wraps ETH → WETH and approves SniperUtilV2 if needed. Sets gas manually (800K) and both `maxFeePerGas`/`maxPriorityFeePerGas` to the auction gas price.
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
const rewards = await sdk.getTokenRewards(tokenAddress);
|
|
441
|
+
const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
|
|
442
|
+
|
|
443
|
+
const result = await sdk.bidInAuction({
|
|
444
|
+
poolKey: rewards.poolKey,
|
|
445
|
+
zeroForOne, // depends on token sort order vs WETH
|
|
446
|
+
amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped from ETH)
|
|
447
|
+
amountOutMinimum: 0n, // set slippage in production
|
|
448
|
+
round: auction.round, // must match current on-chain round
|
|
449
|
+
bidAmount: parseEther("0.0005"), // ETH bid (sent as msg.value)
|
|
450
|
+
}, gasPrice);
|
|
451
|
+
// result.txHash — transaction hash
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Important:** The bid is valid only at `nextAuctionBlock`. Submit when `currentBlock === nextAuctionBlock - 1`. The `amountIn` is pulled from your WETH balance (separate from the bid's `msg.value`). Auction runs 5 rounds, every 2 blocks, starting 2 blocks after deployment.
|
|
455
|
+
|
|
435
456
|
---
|
|
436
457
|
|
|
437
458
|
### MEV Protection
|