feat(studio): add Pump and PumpSwap scenario support - #39
Conversation
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.
|
@92Infinitus92 is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThe PR adds Pump and PumpSwap scenario support to Studio, including protocol discovery, specialized scenario builders, guided prompts, token selection, and protocol assets.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "fix(studio): create pump presets through..." | Re-trigger Greptile |
| onRefresh?.(); | ||
| router.push(`/scenarios?id=${scenarioId}&tab=editor`); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@greptileai check the latest commit a71a81d for a solution
There was a problem hiding this comment.
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.
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.