# solana-tx-compute-design

> Design around Solana compute, size, lock and fee limits; reliable landing, retries and commitment levels.

solana-tx-compute-design is a free AI agent skill on Agensi by BanditXBT. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [BanditXBT](https://www.agensi.io/creators/banditxbt)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/solana-tx-compute-design
- Tags: apis-backend, web3-crypto, testing-debugging

## About this skill

Limits shape architecture on Solana. Verify current numbers against the Solana docs/cluster feature set before relying on them; they change with network upgrades.

| Constraint | Typical value | Consequence |
|---|---|---|
| Compute units | 200k default per instruction, 1.4M max per tx | Bound loops; measure CU per path |
| Transaction size | 1232 bytes (serialized) | Limits accounts/instruction data; use lookup tables |
| CPI depth | 4 | Avoid deep call chains |
| Stack / heap | 4 KB per frame / 32 KB heap default | Box large structs; zero-copy |
| Account data | up to 10 MiB; +10 KiB growth per instruction | Plan realloc |
| Blockhash validity | ~150 blocks (≈ 1-2 min) | Retry/expiry logic |
| Signature fee | 5000 lamports base per signature | Plus priority fee |
| Account locks per tx | 64 enforced for legacy/v0 (a 128 limit exists as an inactive feature; a new tx version proposes 96) | Count program IDs and signers too; re-check the current limit |
| CPI limits | 16 PDA signers and 128 account infos per CPI (higher limit proposed) | Wide CPIs need batching |
| Loaded/growth limits | Account data growth per tx is capped (tens of MiB); 10 KiB per-instruction realloc | Plan large allocations across instructions |

1. Measure: log `sol_log_compute_units()` in dev, or read `unitsConsumed` from `simulateTransaction`. Test the *worst-case* path (max positions, max accounts), not the average.
2. Set explicit limits in clients: `ComputeBudgetInstruction::set_compute_unit_limit(measured × 1.1-1.2)`. Over-requesting wastes priority fee (fee = limit × price); under-requesting fails.
3. Reduce CU: avoid heap allocation and large copies, prefer `zero_copy`, use fixed-size arrays, avoid `msg!` formatting in hot paths, precompute, avoid repeated PDA derivation (`find_program_address` is expensive; store bumps and use `create_program_address`), use efficient serialization, minimize CPIs and logs.
4. Cap work per transaction by design: paginated/batched processing with explicit `max_iterations`, cursor state in accounts.

- Each tx declares read/write accounts up front. **Write-locks serialize**: avoid a global mutable account on the hot path; shard or partition by user/market; mark accounts read-only whenever possible.
- Address lookup tables with v0 transactions expand account capacity within the size limit; tables must be activated (wait for slot warm-up) before use; know that lookup tables cannot supply signer keys.
- Account locks per transaction are capped (64 for legacy/v0 at last check, including program IDs and signers); lookup tables fix *size*, not the lock cap. Verify the current limit in the Solana constants reference.

## Requires

Nothing beyond your AI agent.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the solana-tx-compute-design skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does solana-tx-compute-design do?

Design around Solana compute, size, lock and fee limits; reliable landing, retries and commitment levels.

### Which AI agents support solana-tx-compute-design?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use solana-tx-compute-design?

Connect your AI agent to Agensi through MCP, then ask it to use solana-tx-compute-design on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
