Skip to content

feat(scenarios): SolFi support - #14

Open
bakasura980 wants to merge 2 commits into
feat/scenarios/bounded-persistfrom
feat/solfi-support
Open

feat(scenarios): SolFi support#14
bakasura980 wants to merge 2 commits into
feat/scenarios/bounded-persistfrom
feat/solfi-support

Conversation

@bakasura980

@bakasura980 bakasura980 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

Adds native SolFi v2 scenario support through raw oracle, market, and vault layouts, along with XOR/strided encodings, protocol guidance, MCP instructions, and deployed-program integration tests.

  • Registers five SolFi templates for price, freshness, spread, size impact, and vault inventory.
  • Extends raw encoding with unsigned strided and XOR-obfuscated integer and slot formats.
  • Adds extensive live-account and LiteSVM coverage for both supported markets.
  • The advertised account picker is not consumable by the current Studio editor.

Confidence Score: 4/5

The PR should not merge until Studio can select the non-default SolFi markets and vaults advertised by the new templates.

The raw encodings and runtime account targeting are well covered, but the standalone market catalogs are invisible to Studio's property-driven selector flow, leaving most newly advertised SolFi targets inaccessible through that supported authoring surface.

Files Needing Attention: crates/core/src/scenarios/protocols/solfi/v2/market-overrides.yaml, crates/core/src/scenarios/protocols/solfi/v2/oracle-overrides.yaml, crates/core/src/scenarios/protocols/solfi/v2/vault-overrides.yaml

Important Files Changed

Filename Overview
crates/core/src/scenarios/protocols/solfi/v2/market-overrides.yaml Adds market spread and size-impact templates, but its standalone market catalog cannot drive account selection in Studio.
crates/core/src/scenarios/protocols/solfi/v2/oracle-overrides.yaml Adds XOR-encoded price and freshness templates with validated byte offsets, but shares the Studio account-selection limitation.
crates/core/src/scenarios/protocols/solfi/v2/vault-overrides.yaml Adds inventory overrides for four vaults, although Studio cannot select the three non-default targets.
crates/types/src/scenarios.rs Adds bounded strided and XOR encodings and corrects slot arithmetic without an identified reachable regression.
crates/core/src/scenarios/registry.rs Registers all five templates and tests their metadata, but tests only catalog contents rather than Studio picker compatibility.
crates/mcp/src/surfpool/mod.rs Documents the working MCP convention of placing direct-account catalog values in account.pubkey.
crates/core/src/tests/solfi/mod.rs Provides extensive raw-layout and deployed-program verification across both supported SolFi markets.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Catalog[SolFi constants.market catalog] --> MCP[MCP account.pubkey selection]
  MCP --> Runtime[OverrideInstance account resolution]
  Runtime --> Target[Selected SolFi account]
  Catalog -. not rendered .-> Studio[Studio scenario editor]
  Studio --> Default[Fixed default template address]
Loading

Fix all with Greploop Fix All in Claude Code Fix All in Codex Fix All in Cursor

Prompt To Fix All With AI
### Issue 1
crates/core/src/scenarios/protocols/solfi/v2/market-overrides.yaml:19-38
**Studio cannot select SolFi accounts**

When a Studio user chooses a non-default SolFi market or vault, these standalone `constants.market` catalogs are not rendered because the [scenario editor](https://github.com/limechain/surfpool-web-ui/blob/HEAD/apps/studio/src/components/svm/scenario-editor.tsx) only creates selectors for `constant_ref` properties and initializes direct-account handling from the fixed template address. This leaves Studio targeting the default WSOL/USDC account, so users cannot author the advertised USDT/USDC or alternate-vault scenarios.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(scenarios): add validated SolFi PMM..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (3)

Comment on lines +19 to +38
label: SolFi market
description: Choose one of the two SolFi markets that currently has meaningful swap liquidity.
options:
- id: wsol-usdc
label: WSOL / USDC
description: The funded SolFi market for wrapped SOL and USDC.
value: 65ZHSArs5XxPseKQbB1B4r16vDxMWnCxHMzogDAqiDUc
metadata:
oracle: 2ny7eGyZCoeEVTkNLf5HcnJFBKkyA4p4gcrtb3b8y8ou
pair: WSOL/USDC
- id: usdt-usdc
label: USDT / USDC
description: The funded SolFi stablecoin market for USDT and USDC.
value: FkEB6uvyzuoaGpgs4yRtFtxC4WJxhejNFbUkj5R6wR32
metadata:
oracle: CyCUgmaCYUZxbux3J2svDzxSryVFMtZNPrnMKS41nc4G
pair: USDT/USDC

templates:
- id: solfi-spread

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Studio cannot select SolFi accounts

When a Studio user chooses a non-default SolFi market or vault, these standalone constants.market catalogs are not rendered because the scenario editor only creates selectors for constant_ref properties and initializes direct-account handling from the fixed template address. This leaves Studio targeting the default WSOL/USDC account, so users cannot author the advertised USDT/USDC or alternate-vault scenarios.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/core/src/scenarios/protocols/solfi/v2/market-overrides.yaml
Line: 19-38

Comment:
**Studio cannot select SolFi accounts**

When a Studio user chooses a non-default SolFi market or vault, these standalone `constants.market` catalogs are not rendered because the [scenario editor](https://github.com/limechain/surfpool-web-ui/blob/HEAD/apps/studio/src/components/svm/scenario-editor.tsx) only creates selectors for `constant_ref` properties and initializes direct-account handling from the fixed template address. This leaves Studio targeting the default WSOL/USDC account, so users cannot author the advertised USDT/USDC or alternate-vault scenarios.

**Knowledge Base Used:**
- [Scenario execution](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool/-/docs/scenario-execution.md)
- [MCP server integration](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool/-/docs/mcp-server.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex Fix in Cursor

@failfmi failfmi changed the title Feat/solfi support feat(scenarios): SolFi support Sep 9, 2026
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