Skip to content

chore: bump @meteora-ag/dlmm 1.9.4 → 1.9.10#85

Open
agushudono wants to merge 10 commits into
yunus-0x:mainfrom
agushudono:bump-dlmm-1.9.10
Open

chore: bump @meteora-ag/dlmm 1.9.4 → 1.9.10#85
agushudono wants to merge 10 commits into
yunus-0x:mainfrom
agushudono:bump-dlmm-1.9.10

Conversation

@agushudono

Copy link
Copy Markdown

What

Bump @meteora-ag/dlmm from 1.9.41.9.10 (latest on npm).

Why it's safe

All seven SDK methods used in tools/dlmm.js have identical signatures between 1.9.4 and 1.9.10:

  • initializePositionAndAddLiquidityByStrategy
  • addLiquidityByStrategyChunkable
  • createExtendedEmptyPosition
  • removeLiquidity
  • closePosition
  • claimSwapFee
  • getActiveBin

No changes to the deploy / wide-range / claim / close code paths required.

Verification

  • npm run test:syntax — all tracked source passes (the only failure is inside an untracked local demo/ folder's nested node_modules, unrelated).
  • scripts/patch-anchor.js postinstall applies cleanly to the new index.mjs and is idempotent (Skip: … already patched on re-run).
  • End-to-end ESM import of the SDK verified after a full npm install (DLMM class: function).

Files

  • package.json — dependency bump
  • package-lock.json — regenerated

🤖 Generated with Claude Code

root and others added 10 commits May 30, 2026 02:52
AbortError from fetchWithTimeout has no HTTP status, so isRetryableStatus(0)
was false and a single 10s per-attempt timeout threw immediately — never
using the 30s maxElapsedMs retry budget. Treat timeouts/aborts as retryable
so transient relay slowness retries before falling back to direct LPAgent fetch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
FALLBACK_MODEL was "stepfun/step-3.5-flash:free", an OpenRouter model name
that 404s against the configured Anthropic endpoint — so a transient 502/503/529
on the primary model would switch to a fallback that itself errors. Point it at
claude-haiku-4-5-20251001 (fast/cheap, available on this API key).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Source-level fallbacks still pointed at openrouter/minimax model
names (healer-alpha, hunter-alpha, minimax-m2.x) which 404 against
the Anthropic-compatible endpoint. Align agent.js, config.js and the
example config with the live user-config: default to claude-opus-4-7.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Default model claude-opus-4-7, fallback claude-haiku-4-5-20251001,
default base URL api.anthropic.com; clarify OPENROUTER_API_KEY is a
legacy fallback (live key comes from user-config llmApiKey).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fetchMyPositions called the Agent Meridian relay (and its direct
LPAgent fallback) before the portfolio lookup, but the result is only
consumed in the per-position loop. With an empty wallet that loop never
runs, so every management/screening cycle awaited the relay for its full
~30s retry budget and logged a misleading "raw relay failed; falling
back" warning — 77x today, and on every `npm run dev`. Gate the relay +
direct fetch on pools.length > 0 so an empty wallet skips them entirely.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
closePosition: disable the relay zap-out attempt. It failed 42/42 closes
(the OKX zap-out order embeds an owner SOL transfer that the safety guard
assertNoUnsafeSystemTransfer rejects) and always fell back to the local
close + Jupiter autoswap. The doomed attempt added sign→simulate→throw
latency to every close, worsening fills during fast dumps, and requested a
50% (slippageBps 5000) swap. Go straight to the safer, working local path;
the guard logic is untouched and the relay is easily re-enabled via the flag.

deriveLpAgentPnlPct: add collectedFee to the PnL term so already-claimed
fees aren't dropped. Omitting it understated PnL by the claimed amount after
every claim_fees, producing a constant reported-vs-derived gap and false
"suspicious PnL" flags.

Risk-exit tuning (stopLossPct -10→-6, trailingTriggerPct 3→5) lives in the
gitignored user-config.json and is applied there separately.

Activates on restart; the live process is a stale 2026-06-06 in-memory snapshot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Symmetric downside handling for single-side SOL positions, which catch a
falling knife when price dumps through the entry range (the main source of
the -16/-21% tail losses).

- index.js getDeterministicCloseRule: add rule 6 (close when active bin is
  more than outOfRangeBinsToClose below the range — mirror of rule 3) and
  rule 7 (OOR-below past outOfRangeWaitMinutes — mirror of rule 4).
- index.js computeStrategy(volatility): pick LP shape by volatility —
  bid_ask at >= 4, else spot — and use it on the programmatic deploy path
  and in the screener prompt (single source of truth). Refuses non-finite/
  non-positive volatility.
- tools/definitions.js: align deploy_position strategy guidance with the
  volatility-driven rule.
- lessons.js: detect "dumped below range" closes, emit a specific
  falling-knife AVOID lesson (downsize / require momentum for that
  volatility tier), and count the dump as negative evidence.

Activates on restart; the live process is a stale 2026-06-06 snapshot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Newer Opus models deprecate the temperature parameter; the request 400s with
a "temperature ... unsupported/deprecated" error. Detect that case and retry
the same step once with temperature omitted (same pattern as the existing
thinking-mode tool_choice fallback), latching omitTemperature for the run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve diverged main (local 8 ahead / 2 behind). Conflicts in
index.js, tools/definitions.js, tools/dlmm.js, CLAUDE.md.

Strategy selection now combines both approaches:
- config.strategy.strategy === "auto" → volatility-driven shape
  (bid_ask if volatility >= 4, else spot), resolved in deployPosition
- any other value ("bid_ask"/"spot") → explicit config override
- default + example now "auto"

Also realign CLAUDE.md model docs to actual Anthropic code defaults
(claude-opus-4-7 / claude-haiku-4-5 fallback) after the remote rewrite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
No breaking changes in the SDK methods we use — verified identical
signatures for initializePositionAndAddLiquidityByStrategy,
addLiquidityByStrategyChunkable, createExtendedEmptyPosition,
removeLiquidity, closePosition, claimSwapFee, getActiveBin.

patch-anchor.js postinstall applies cleanly to 1.9.10 (idempotent);
end-to-end ESM import of the SDK verified after a full npm install.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant