@gangfun/cli 0.16.3 → 0.16.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/README.md CHANGED
@@ -227,4 +227,4 @@ gang agents --window 30d --sort follow
227
227
 
228
228
  ## Version
229
229
 
230
- `0.16.3` · repo [gangfun/cli](https://github.com/gangfun/cli) · published to [npm](https://www.npmjs.com/package/@gangfun/cli) on push to `main`
230
+ `0.16.4` · repo [gangfun/cli](https://github.com/gangfun/cli) · published to [npm](https://www.npmjs.com/package/@gangfun/cli) on push to `main`
package/README.zh-CN.md CHANGED
@@ -200,4 +200,4 @@ gang agents --window 30d --sort follow
200
200
 
201
201
  ## 版本
202
202
 
203
- `0.16.3` · [gangfun/cli](https://github.com/gangfun/cli) · push 到 `main` 自动发布到 [npm](https://www.npmjs.com/package/@gangfun/cli)
203
+ `0.16.4` · [gangfun/cli](https://github.com/gangfun/cli) · push 到 `main` 自动发布到 [npm](https://www.npmjs.com/package/@gangfun/cli)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gangfun/cli",
3
- "version": "0.16.3",
3
+ "version": "0.16.4",
4
4
  "description": "Gang launchpad CLI for Binance Agentic Wallet agents: create on GangLaunchpad (untaxed or tax tokens), 打新 fair mint, PancakeSwap pool trades, LaunchpadV2 and legacy Soft/U/S trade.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/bond.js CHANGED
@@ -415,13 +415,20 @@ export async function runBond(sub, { opt, flag, out, fail, summarize }) {
415
415
  // not ready: the call only records / waits. If a chunk has become buyable by the time it lands, the max minimum
416
416
  // makes it revert (Slippage) instead of buying unchecked: re-run for a priced preview
417
417
  const toDead = ready && !m.live
418
- const minOut = toDead ? 0n : ready ? (tokensOut * BigInt(Math.round((100 - slippage) * 100))) / BPS : MAX_UINT
418
+ // the minimum comes from the chunk simulated with no minimum: previewBurn prices the whole quoteIn, so a quote that
419
+ // taxes transfers into the pair (fewer tokens bought) would fail every minimum taken from it
420
+ let expect = tokensOut
421
+ if (ready && !toDead) {
422
+ const dry = await simulate(ctx, me(), 'burnChunk', [token, 0n])
423
+ if (dry.result) expect = dry.result[1]
424
+ }
425
+ const minOut = toDead ? 0n : ready ? (expect * BigInt(Math.round((100 - slippage) * 100))) / BPS : MAX_UINT
419
426
  const sim = await simulate(ctx, me(), 'burnChunk', [token, minOut])
420
427
  if (sim.failed) return out({ success: false, step: 'burn', ...sim.failed })
421
428
  return out(send('burnChunk', [token, minOut], {
422
429
  step: 'burn', burnLeft: view.burnLeft, quote: view.quote,
423
430
  ...(toDead ? { quoteToDead: qf(quoteIn), note: 'slashed before the pair and still no pair 30 days after the post: the rest goes to 0xdead as quote' }
424
- : ready ? { chunkQuoteIn: qf(quoteIn), expectBurnTokens: tokens(tokensOut), minBurnTokens: tokens(minOut), slippagePct: slippage }
431
+ : ready ? { chunkQuoteIn: qf(quoteIn), expectBurnTokens: tokens(expect), minBurnTokens: tokens(minOut), slippagePct: slippage }
425
432
  : { note: 'no chunk this time: the call records the price observation (first call after a slash) or waits for the 10-minute average / a price no more than 2% above it. It is cheap; the platform keeper also calls it every 5 minutes (one chunk per 4 minutes at most). If a chunk becomes buyable before it lands, it reverts (Slippage) rather than buy without a minimum: re-run then' }),
426
433
  }))
427
434
  }