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 and PumpSwap scenario preparation, including account templates, canonical address derivation, HTTP/MCP entry points, and Token-2022-safe account updates.

  • Registers vendored Pump and PumpSwap IDLs and override templates.
  • Adds graduation and price-shock scenario builders backed by live account data.
  • Preserves Token-2022 extensions when updating token-account amounts.
  • Adds integration coverage and Pump-specific verified-token filtering.

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 templates, with the accepted position-aware guidance for fetching live state.
crates/core/src/scenarios/protocols/pump-amm/v1/overrides.yaml Defines PumpSwap pool, canonical-pool, and global-configuration override templates.
crates/core/src/scenarios/pump_graduation.rs Builds state preparation for completing Pump curves and preserving migration reserves.
crates/core/src/scenarios/pump_swap_price_shock.rs Builds canonical PumpSwap pool scenarios that adjust virtual quote reserves.
crates/core/src/rpc/surfnet_cheatcodes.rs Updates token-account handling to preserve Token-2022 extensions during partial changes.
crates/cli/src/http/mod.rs Adds remote-backed HTTP endpoints for Pump graduation and PumpSwap price-shock scenarios.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Mint[Pump token mint] --> Curve[Pump bonding curve]
    Curve -->|Graduation preparation| Complete[Completed curve state]
    Complete --> Pool[Canonical PumpSwap pool]
    Pool -->|Price-shock preparation| Repriced[Adjusted virtual quote reserves]
    Remote[Remote RPC snapshots] --> Curve
    Remote --> Pool
    Templates[Scenario templates] --> Curve
    Templates --> Pool
Loading

Reviews (7): 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