Skip to content

feat(studio): add Pump and PumpSwap scenario support - #39

Open
92Infinitus92 wants to merge 7 commits into
solana-foundation:mainfrom
LimeChain:feat/pump-scenario-ui
Open

feat(studio): add Pump and PumpSwap scenario support#39
92Infinitus92 wants to merge 7 commits into
solana-foundation:mainfrom
LimeChain:feat/pump-scenario-ui

Conversation

@92Infinitus92

@92Infinitus92 92Infinitus92 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Studio does not currently expose the Pump and PumpSwap templates or their specialized scenario builders. Users must author these scenarios manually and provide the derived accounts themselves.

This PR enables both protocols in the scenario editor, resolves their names from the backend template catalog, and adds Pump-focused prompts. It also provides dialogs for Token-2022 graduation and canonical PumpSwap price shocks. Custom mints remain selectable and newly created scenarios open directly in the editor.

This PR depends on the Pump backend PR 767. The Studio diff is already isolated and can be marked ready after #767 is merged.

Build the graduation scenario from a token mint via the graduation endpoint,
through a no-LLM preset dialog and an AI chip. Add custom-mint support in the
override editor so mints outside the verified catalog are shown and preserved.
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

@92Infinitus92 is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@92Infinitus92

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds Pump and PumpSwap scenario support to Studio, including protocol discovery, specialized scenario builders, guided prompts, token selection, and protocol assets.

  • Adds Pump graduation and PumpSwap price-shock dialogs.
  • Extends scenario template conversion and protocol identification for PumpSwap’s multi-dash template IDs.
  • Updates scenario navigation so newly created scenarios open through the shared deep-link flow.
  • Adds focused tests for dialogs, presets, token options, protocol mapping, API conversion, and delayed deep-link selection.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/studio/src/components/svm/generic-bento.tsx Delays deep-link initialization until the requested item exists and retries selection when refreshed items arrive.
apps/studio/src/components/svm/scenarios-bento.tsx Integrates specialized Pump and PumpSwap creation flows with shared scenario refresh and navigation.
apps/studio/src/components/svm/pump-graduation-dialog.tsx Adds a guided Token-2022 Pump graduation scenario builder.
apps/studio/src/components/svm/pump-swap-price-shock-dialog.tsx Adds a guided canonical PumpSwap pool price-shock scenario builder.
apps/studio/src/components/svm/scenario-editor.tsx Enables Pump and PumpSwap templates and token-aware editor behavior.
apps/studio/src/app/scenarios/page.tsx Centralizes API scenario conversion and resolves protocol names through the backend template catalog.
apps/studio/src/lib/scenarios-data.ts Adds shared API-to-UI scenario conversion with template-aware protocol resolution.
apps/studio/src/components/svm/ai-header.tsx Adds Pump-focused guided prompts and a two-row horizontally scrollable example selector.

Reviews (2): Last reviewed commit: "fix(studio): create pump presets through..." | Re-trigger Greptile

Comment on lines +136 to +137
onRefresh?.();
router.push(`/scenarios?id=${scenarioId}&tab=editor`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Post-creation navigation loses selection

When a specialized scenario is created with no scenario currently selected, onRefresh starts an asynchronous reload that unmounts this component while router.push immediately changes the URL. GenericBento can then finish its one-shot initialization before both the new ID and refreshed item are available, causing the successfully created scenario to remain unselected instead of opening in the editor; the PumpSwap handler at lines 154-155 has the same ordering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greptileai check the latest commit a71a81d for a solution

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix in a71a81d addresses the race condition correctly. The key change in generic-bento.tsx is that hasInitialized is no longer set to true when items.length === 0 — the deep-link effect now waits (retries on each items change) until the refreshed list actually contains the target ID before selecting it and marking initialization complete. This directly resolves the ordering issue where router.push fired before onRefresh had populated the list.

The added test file (generic-bento.test.tsx) covers the retry behavior, confirming the fix is intentional and validated.

The concern is resolved — good fix.

…s API

The backend dropped its protocol-specific scenario endpoints, so the
graduation preset now calls the create_pump_graduation_scenario MCP tool
and the price shock preset builds its scenario from the PumpSwap template
and posts it to /v1/scenarios, keeping large reserves lossless.
@92Infinitus92
92Infinitus92 marked this pull request as ready for review August 27, 2026 14:44
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