solana-defi-architect

Designs, codes, tests, audits, and deploys Solana Anchor programs for DeFi protocols.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/Shahnilsharma/smart-contracts-auditor-skill --skill solana-defi-architect-shahnilsharma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solana-defi-architect
Source: https://github.com/Shahnilsharma/smart-contracts-auditor-skill/tree/main/plugins/solana-defi-architect/skills
Command: npx skills add https://github.com/Shahnilsharma/smart-contracts-auditor-skill --skill solana-defi-architect-shahnilsharma

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Building a Solana DeFi protocol requires expertise across Anchor architecture, Solana's account-model vulnerability classes, fuzz testing, and audit methodology — a workflow most developers handle piecemeal with inconsistent quality and missed security checks. ## Core Features & Use Cases - Full-stack program development: Maps DeFi mechanics (lending, AMMs, vaults, staking, vesting, DAOs) into Anchor architecture with account/PDA models, then writes production Rust/Anchor code following strict signer, owner, and checked-math standards. - Agency-grade audit pipeline: Runs threat modeling with risk matrices, static analysis against Solana vulnerability classes (missing signer/owner checks, PDA misuse, arbitrary CPI, sysvar spoofing), LiteSVM/Mollusk/Surfpool testing, and Trident fuzzing, producing a structured audit report. - Deployment and post-deployment: Handles devnet/mainnet-beta deployment via anchor/solana CLI with wallet-mode selection (keypair, Ledger, Squads multisig), deployment verification, and monitoring/incident-response planning. - Use Case: Ask it to design and audit a lending protocol on Solana — it produces the architecture doc, Anchor program, test suites, fuzz harness, and a severity-rated audit report with fix-review follow-up. ## Quick Start Design and audit an Anchor-based token staking program for Solana devnet, including threat model, tests, and a full audit report.

Frequently Asked Questions about solana-defi-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a Solana Anchor program for vulnerabilities?

Run the audit pass which applies a checklist covering missing signer checks, owner checks, PDA misuse, arbitrary CPI, sysvar spoofing, and account confusion, combined with threat modeling and an impact-times-likelihood risk matrix. Critical and High findings require an executable proof-of-concept test before being reported as confirmed.

What testing tools does this use for Solana programs?

It uses a three-tier pyramid: LiteSVM for fast in-process unit tests, Mollusk for isolated single-instruction and compute-budget checks, and Surfpool for integration tests against realistic cluster state. Fuzzing runs via anchor fuzz by default and Trident for release-grade, invariant-driven campaigns.

Can it deploy a Solana program to mainnet-beta?

Yes, but only on explicit request, with confirmation of the upgrade-authority plan first. It supports local keypair files, Ledger hardware wallets, and Squads multisig, and recommends verifiable builds plus multisig upgrade authority for programs holding real value.

Why does my Anchor build fail with version errors?

Most Anchor build failures trace to version mismatches between anchor-lang in Cargo.toml and the Anchor CLI, or Rust toolchain incompatibilities such as the Anchor 0.30.x plus Rust 1.80 time-crate issue. The skill checks anchor, solana, and rustc versions before writing code to catch this early.

Does it work if anchor or solana CLI is not installed in the environment?

It still writes the code, tests, and scripts, but explicitly labels every result as NOT EXECUTED with the exact local command to run, rather than claiming tools ran. This prevents unvalidated findings from being reported as confirmed in the audit report.

When should I use this instead of the EVM or CosmWasm audit skills?

Use it when there is Solana-specific evidence such as .rs files with anchor_lang or solana_program imports, or explicit mentions of Anchor, PDA, or CPI. If evidence points to Solidity or CosmWasm instead, it defers to the sibling chain skill rather than auditing the wrong stack.