solana-wallet-aware

solana-wallet-aware is a cursor rule for Cursor from PatrickJS/awesome-cursorrules. It costs 863 tokens per session, scanned A, original, CC0-1.0.

Security-focused coding guidance for Solana applications that use cryptocurrency wallets and sign transactions. It covers protecting signing keys, isolating the signer, checking prices, and reducing transaction risks.

In plain words
What is it for?
Use it to design safer Solana wallet setups, isolate transaction signing, defend swaps against MEV, and reject trades that fail price or program checks.
Why use it?
It helps prevent private-key exposure and adds checks before trades or other blockchain transactions are signed and broadcast.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to design safer Solana wallet setups, isolate transaction signing, defend swaps against MEV, and reject trades that fail price or program checks.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/solana-wallet-aware
About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,734 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for solana-wallet-aware

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/solana-wallet-aware.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/solana-wallet-aware)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/solana-wallet-aware"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/solana-wallet-aware.svg" alt="Measured on agentmods" height="20"></a>
Per session 863 This file is loaded in full into every session.
When invoked 863 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00863 $0.00863
Opus 5 $0.00432 $0.00432
Sonnet 5 $0.00173 $0.00173
Haiku 4.5 $0.00086 $0.00086

Measured 4d ago against content hash 8a3e9d3a575e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

solana-wallet-aware scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/solana-wallet-aware.mdc · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Solana Wallet-Aware Coding

When writing Solana on-chain or off-chain code, apply these wallet-safety and transaction-safety rules.

Wallet architecture

  • Never store a raw private key in .env, config files, or source. Encrypt with a passphrase-derived key (HKDF-SHA256 + AES-256-GCM, or eth-account's scrypt V3 keystore, or libsodium's sealed-box).
  • Use a three-tier wallet split at $1k+ scale: hot (bot-signing, ≤10% of AUM), warm (manual-top-up buffer on founder phone, ~30%), cold (hardware wallet or Squads 2-of-2 multisig, ~60%, untouchable ≥6 months).
  • Treat the hot wallet as burnable. Any key that ever touched a .env file on a dev machine is compromised forever.
  • Isolate the signer in a subprocess with only two capabilities: (a) receive a pre-built transaction over a local Unix socket / stdin, (b) return a signature. No network access, no program-scope escalation, explicit allowlist of program IDs.

MEV defense on Solana

  • Never broadcast swaps to the public mempool. Always use Jito bundles with a per-bundle tip (start at 10k lamports, scale with expected profit).
  • Add an oracle gate: reject a trade if Jupiter's quoted price is > 0.5% off Pyth's spot price. Update threshold dynamically with 1-minute realized volatility.
  • Maintain an illiquidity blocklist: skip any token where the deepest pool has < $1M TVL (use GeckoTerminal or Birdeye API to check).
  • For limit-style orders, prefer Jupiter's limit-order program (built-in MEV protection) over composing your own.

Program-ID allowlist pattern

When building a signer, hard-code the list of program IDs your bot may invoke. Reject any transaction whose instructions touch a program outside the allowlist. At minimum for a Solana trading bot:

const ALLOWED_PROGRAMS = new Set([
  "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",  // Jupiter v6
  "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb",  // OpenBook v2
  "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",  // SPL Token
  "ComputeBudget111111111111111111111111111111",  // Compute budget
  // add your DEX IDs here — NEVER include unknown programs
]);

Read the full file on GitHub · 55 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 55 lines · 863 tokens per session scan A 8a3e9d3a575e

Subscribe to this mod's changes

solana-wallet-aware is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,734 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 863 tokens to every session, about $0.0043 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.