Skip to content

Add Pump and PumpSwap state-preparation templates - #3

Open
92Infinitus92 wants to merge 5 commits into
developfrom
feat/pump-protocol
Open

Add Pump and PumpSwap state-preparation templates#3
92Infinitus92 wants to merge 5 commits into
developfrom
feat/pump-protocol

Conversation

@92Infinitus92

@92Infinitus92 92Infinitus92 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Adds pump.fun support to scenario state prep. A coin lives on two programs - the Pump
bonding curve, then the PumpSwap AMM after it graduates - so this covers both.

Heads up on the size: ~14k of the diff is the two vendored IDL files.

Five templates:

  • Bonding curve (by mint) + Pump global config
  • PumpSwap pool (by address or derived from the mint) + global config

You can reset a curve to launch state, mark one complete, or shift a pool's price through
virtual_quote_reserves. The token pickers only show pump.fun coins.

Tests: PDA derivation checked against the addresses in pump-public-docs; apply-path tests
run real mainnet account snapshots through and confirm only the fields we touch change,
byte for byte; MCP tests make sure junk mints get rejected early.

Greptile Summary

Adds Pump bonding-curve and PumpSwap state-preparation support, including templates, generated scenarios, account-preserving token updates, API endpoints, and integration fixtures.

  • Registers Pump and PumpSwap IDLs and override templates.
  • Adds graduation and price-shock scenario builders backed by remote account snapshots.
  • Preserves Token-2022 account extensions when applying token-account updates.
  • Exposes scenario-preparation endpoints through the Studio server.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/core/src/scenarios/protocols/pump/v1/overrides.yaml Defines Pump bonding-curve and global-state templates with position-aware guidance for preserving live fields.
crates/core/src/scenarios/protocols/pump-amm/v1/overrides.yaml Defines PumpSwap pool and global-config templates, including canonical-pool derivation.
crates/core/src/scenarios/pump_graduation.rs Builds a Pump graduation scenario from fetched on-chain account state.
crates/core/src/scenarios/pump_swap_price_shock.rs Builds a PumpSwap scenario that changes virtual quote reserves while preserving other pool state.
crates/cli/src/http/mod.rs Adds Studio API endpoints that fetch remote Pump accounts, prepare scenarios, and register them.
crates/core/src/rpc/surfnet_cheatcodes.rs Updates token-account writes to preserve Token-2022 extensions, with a targeted amount-only patch path.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API as Studio Scenario API
    participant RPC as Remote Solana RPC
    participant Builder as Pump Scenario Builder
    participant Store as Loaded Scenarios
    Client->>API: POST Pump preparation request
    API->>RPC: Fetch mint, curve, pool, vault, and config accounts
    RPC-->>API: Confirmed account snapshots
    API->>Builder: Build graduation or price-shock scenario
    Builder-->>API: Prepared scenario and derived addresses
    API->>Store: Register prepared scenario
    API-->>Client: Scenario ID and preparation metadata
Loading

Reviews (6): Last reviewed commit: "test(pump): verify scenario-driven lifec..." | Re-trigger Greptile

@92Infinitus92 92Infinitus92 self-assigned this Aug 10, 2026
@92Infinitus92

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread crates/core/src/scenarios/protocols/pump/v1/overrides.yaml Outdated
@92Infinitus92

Copy link
Copy Markdown
Collaborator Author

@greptileai

Give every field of the pump-global, pump-amm-pool-state and pump-amm-global-config
templates a label and description (they were bare name lists), and add a field reference
to both pump READMEs. Expose Global.withdraw_authority so a migrate can be driven on a
fork. Trim the bonding-curve llmContext of its redundant worked example and the niche
cost formula.
Prepare a near-complete Token-2022 pump.fun curve so one buy graduates it:
a graduation calculator/validator, the pump-token-2022-curve-balance template
with a tail-safe Token-2022 amount write, the /v1/scenarios/pump-graduation
endpoint and MCP tool, and an ignored buy_v2 -> migrate_v2 -> sell lifecycle
harness backed by a frozen snapshot fixture.
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