Skip to content

feat: add BisonFi override templates - #8

Open
bakasura980 wants to merge 2 commits into
feat/kamino-protocol-supportfrom
feat/bisonfi-support
Open

feat: add BisonFi override templates#8
bakasura980 wants to merge 2 commits into
feat/kamino-protocol-supportfrom
feat/bisonfi-support

Conversation

@bakasura980

@bakasura980 bakasura980 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

BisonFi publishes no IDL and is not an Anchor program, so this adds a raw byte-layout write path guarded by account size and magic, plus four templates on it: price, depth, spread and freshness.

Also introduces optional IDLs on templates, so a program without one no longer needs a reconstructed IDL in the repo.

Greptile Summary

The PR adds raw byte-layout scenario overrides for non-Anchor programs without published IDLs and introduces four bundled BisonFi templates.

  • Makes template IDLs optional and routes raw-layout overrides before IDL lookup.
  • Adds guarded BisonFi price, depth, spread, and freshness byte layouts.
  • Adds BisonFi integration coverage and scenario documentation.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the scope of the follow-up review.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/types/src/scenarios.rs Makes template IDLs optional and defines guarded raw-layout encodings and byte materialization.
crates/core/src/surfnet/svm.rs Routes raw-layout templates through guarded byte writes while retaining the existing IDL-based path.
crates/core/src/scenarios/registry.rs Registers BisonFi's IDL-free template collection and adapts registry tests for optional IDLs.
crates/core/src/scenarios/protocols/bisonfi/overrides.yaml Defines four BisonFi templates with an exact account-size and versioned magic guard.
crates/core/src/tests/bisonfi/mod.rs Adds live-mainnet integration coverage for BisonFi layouts, override effects, and swap behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Scheduled scenario override] --> B[Resolve target account]
    B --> C{Template has raw_layout?}
    C -->|Yes| D[Validate account size and magic]
    D --> E[Encode supplied property values]
    E --> F[Write bytes at declared offsets]
    F --> G[Store modified account]
    C -->|No| H[Resolve registered program IDL]
    H --> I[Apply IDL-based account override]
    I --> G
Loading

Reviews (2): Last reviewed commit: "Merge branch 'feat/kamino-protocol-suppo..." | Re-trigger Greptile

@bakasura980 bakasura980 changed the title ⏺ feat: add BisonFi override templates feat: add BisonFi override templates Aug 20, 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