Skip to content

v0.22.0 — Helius spend cut ~6x: marks read positions by key, polls every 20s

Choose a tag to compare

@CryptoGnome CryptoGnome released this 24 Aug 18:02
· 66 commits to main since this release
fd017a7
  • RPC credits per open position: 2.59M/month → 0.39M. Marking was essentially the whole Helius bill. Each mark ran a getProgramAccounts — 10 credits on Helius, vs 1 for everything else we call — asking the program for every position the wallet holds in the pool, then threw away all but the accounts already recorded in position_accounts. Marks now read those accounts by key, and take the active bin from the lbPair that refetchStates() just refreshed instead of paying getActiveBin() for a value already in hand. Measured on mainnet against SDK 1.9.14: 15 credits → 3 per mark.
  • manage.poll_s default 15 → 20, taking the remainder from 0.52M to 0.39M per position/month. A three-to-four position book was exhausting the 10M/month Developer plan; it now runs at roughly a fifth of it.
  • Action required to get the poll change: existing installs read their own data/config.toml, not the repo template. Set poll_s = 20 in dashboard Settings (hot-reloaded, no restart) on each bot. The mark change needs nothing — it ships with the deploy.
  • Poll-counted windows are a third longer now, deliberately: stop_loss_sustain_polls 60s → 80s, meme rotation_polls 45s → 60s, majors rotation_polls 30min → 40min, follow.cold_polls_end 45s → 60s. The counts were left unrescaled on purpose — changing them would change how many independent samples back each decision, which is what a "sustain" knob is for. Watch the P1 stop confirming 20s later. interval_s stays an exact multiple (60 = 3 × 20), so scans still snap to a tick.
  • Safety moved the right way. trackedButMissingOnChain existed because a lagging node answers getProgramAccounts with [] and no error, which became valueSol 0 → pool_dead → a fabricated -open_cost_sol on a position still sitting on chain. A keyed read cannot fail that way silently, and a miss on any tracked account now fails the mark — where the old all-or-nothing guard would still have marked a two-account position at half value if one account went blind.
  • Verified, not just reasoned: a live mainnet position returns identical positionData (amounts, feeX/feeY, bin bounds, version) through the new path, and a bit-identical active-bin price. Typecheck clean, 418 tests green.