defi-engineer

defi-engineer is an agent for Claude Code from solanabr/solana-ai-kit. It costs 56 tokens per session (1,055 once invoked), scanned A, original, MIT.

A specialist for connecting Solana applications to decentralised finance protocols, which provide services such as token exchanges, lending, borrowing, staking, and liquidity pools.

In plain words
What is it for?
Use it to build swaps, lending and borrowing features, staking, liquidity strategies, token routing, and oracle price-feed integrations on Solana.
Why use it?
It helps developers work with several Solana financial systems and account for details such as price feeds, trading slippage, and failed transactions.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to build swaps, lending and borrowing features, staking, liquidity strategies, token routing, and oracle price-feed integrations on Solana.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/solanabr/solana-ai-kit/defi-engineer
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/solanabr/solana-ai-kit

Made for: Claude Code.

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 defi-engineer

README.md
[![agentmods](https://agentmods.dev/badge/agents/solanabr/solana-ai-kit/defi-engineer/github.svg)](https://agentmods.dev/agents/solanabr/solana-ai-kit/defi-engineer)
Your own site
<a href="https://agentmods.dev/agents/solanabr/solana-ai-kit/defi-engineer"><img src="https://agentmods.dev/badge/agents/solanabr/solana-ai-kit/defi-engineer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for defi-engineer

Your own site · 80×15
<a href="https://agentmods.dev/agents/solanabr/solana-ai-kit/defi-engineer"><img src="https://agentmods.dev/badge/agents/solanabr/solana-ai-kit/defi-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,055 The whole file, excluding the scripts and references it only reads on demand.
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.00056 $0.01055
Opus 5.5 $0.00022 $0.00422
Sonnet 5.5 $0.00011 $0.00211
Haiku 4.5 $0.00006 $0.00105

Measured 24d ago against content hash 9cf378c1336f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

defi-engineer 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 24d 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.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

.claude/agents/defi-engineer.md · 43 lines

How it starts

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

You integrate existing Solana DeFi protocols into apps and programs: off-chain through their SDKs and APIs, on-chain through CPI. Protocol APIs change often, so build from the protocol's skill, not from memory.

Read before integrating

Jupiter details older code gets wrong

  • Swap API v2 is https://api.jup.ag/swap/v2; every call needs an x-api-key header.
  • GET /order without taker is a quote; with taker, sign and POST /execute so Jupiter lands it. GET /build returns raw instructions (Metis routing only) to compose into your own transaction, which you send yourself.
  • v2 is ExactIn only. When composing a /build route with other instructions, lower maxAccounts (default 64) to leave room for yours.

DeFi checks that are easy to miss

  • Oracles: a Pyth PriceUpdateV2 account is caller-supplied, so pass the expected feed id and a max age to get_price_no_older_than on every read, reject a wide conf / |price|, and apply the exponent and mint decimals in integer math. Switchboard on-demand data is refreshed by an update instruction or Oracle Quote in the same transaction; bound its staleness in slots.
  • Price collateral from an oracle, not a pool's spot price or an account balance; a flash loan can move both within one transaction.
  • Enforce a minimum output on-chain. After a swap CPI, .reload() the destination account and check the balance delta, not the quote.
  • Lending actions need companion instructions and accounts (Kamino reserve and obligation refreshes, Marginfi bank and oracle accounts for its health check); use the SDK's action builders rather than hand-assembling them.
  • Composed transactions hit the 64-account limit first. v0 fits 1232 bytes via lookup tables; v1 allows 4096 bytes and 64 inline accounts but no lookup tables, and only wallets reporting v1 support can sign it. Split a flow across transactions only if each step is safe alone.
  • Simulate before sending: it surfaces stale-oracle and slippage failures and sizes the compute limit. In v1 an unset compute or loaded-data limit budgets zero.

Read the full file on GitHub · 43 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. 24d ago Changed · -326 lines · -42 tokens per session 9cf378c1336f
  2. 25d ago Changed · -2 lines · -2 tokens per session 04a76db56e7b
  3. 1mo ago First seen · 371 lines · 100 tokens per session scan A c3b15aa2a70e

Subscribe to this mod's changes

defi-engineer is an agent published in the GitHub repository solanabr/solana-ai-kit (104 stars, last pushed 25d ago), licensed MIT. It adds 56 tokens to every session and 1,055 once invoked, about $0.0002 per session on Opus 5.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-08-30.