TxShield API

Pre-flight transaction intelligence for Solana wallets, bots, and DEX frontends.

Authentication

All endpoints require authentication via API key or JWT token.

X-API-Key: your_api_key
# or
Authorization: Bearer your_jwt_token

POST /api/v1/solana/tx/simulate

Simulate a single Solana transaction and get a full risk breakdown.

Auth required

Request

{
  "transaction": "base64-encoded-solana-transaction"
}

Response

{
  "success": true,
  "compute_units": 42000,
  "fee_estimate_sol": 0.000005,
  "priority_fees": {
    "low": 1000,
    "medium": 10000,
    "high": 100000,
    "very_high": 1000000,
    "samples": 150
  },
  "failure_reason": null,
  "failure_code": null,
  "is_terminal": null,
  "risk": {
    "mev_score": 0.3,
    "mev_level": "low",
    "mev_type": "swap_frontrun",
    "has_blacklisted_program": false,
    "blacklisted_programs": [],
    "dex_programs": [{"program_id": "JUP6...", "name": "Jupiter v6"}],
    "token_risk": {
      "mint": "...",
      "symbol": "BONK",
      "risk_score": 0.2,
      "risk_level": "low",
      "flags": [],
      "top_holder_concentration": 0.15,
      "has_mint_authority": false,
      "has_freeze_authority": false,
      "has_liquidity": true
    },
    "risk_level": "safe"
  },
  "logs": [],
  "latency_ms": 68
}

Risk levels

LevelMeaning
safeNo issues detected
lowMinor MEV exposure (e.g. simple swap)
mediumModerate risk (multi-hop swap, simulation warning)
highHigh MEV risk or terminal simulation failure
criticalBlacklisted program or token rug-pull indicators

Failure codes

CodeTerminal?Meaning
insufficient_solYesFee payer lacks SOL for fees
insufficient_token_balanceYesSender lacks token balance
account_not_foundNoRequired account missing (ATA?)
blockhash_expiredNoStale blockhash — rebuild tx
program_errorNoOn-chain program returned error

POST /api/v1/solana/tx/execute

Simulate, apply safety rules, and submit — all in one call. Send a signed transaction and TxShield handles everything: simulation, risk checks, and routing (direct RPC or Jito MEV protection).

Auth required

Request (minimal)

{
  "transaction": "base64-encoded-signed-solana-transaction"
}

That's it. Sensible defaults protect against failed simulations, high MEV risk, and blacklisted programs.

Request (with custom policy)

Override any rule. Only include the fields you want to change.

{
  "transaction": "base64-encoded-signed-solana-transaction",
  "policy": {
    "max_mev_score": 0.5,
    "max_slippage_bps": 100,
    "block_risky_tokens": true
  }
}

Policy options

FieldTypeDefaultDescription
require_simulation_passbooltrueBlock if simulation fails
max_risk_levelstring"high"Block if risk exceeds this (safe/low/medium/high/critical)
max_mev_scorefloat0.7Block if MEV score exceeds this (0.0–1.0)
jito_thresholdfloat0.4Route via Jito bundle if MEV score exceeds this
block_if_known_botsboolfalseBlock if known sandwich bots detected on pair
force_jitoboolfalseAlways submit via Jito regardless of MEV score
block_blacklistedbooltrueBlock transactions with malicious programs
block_risky_tokensboolfalseBlock if token screening detects rug-pull/honeypot
block_token_flagsstring[][]Specific flags: "rug_pull", "honeypot", "freeze_authority"
max_slippage_bpsintnullBlock if estimated slippage exceeds this (basis points)
max_compute_unitsintnullBlock if compute units exceed this
max_fee_solfloatnullBlock if estimated fee exceeds this (SOL)

Response

{
  "simulation_success": true,
  "action": "submitted",
  "reason": "Low MEV risk — submitted via direct RPC",
  "signature": "5xK2gR...",
  "jito_bundle_id": null,
  "route": "direct_rpc",
  "mev_score": 0.03,
  "risk_level": "safe",
  "recommended_priority_fee": 5000,
  "compute_units": 148230,
  "policy_applied": {
    "require_simulation_pass": true,
    "max_risk_level": "high",
    "max_mev_score": 0.7,
    "jito_threshold": 0.4,
    "block_blacklisted": true,
    "block_risky_tokens": false,
    "max_slippage_bps": null
  },
  "latency_ms": 85
}

Actions

ActionMeaning
submittedTransaction passed all checks and was submitted to Solana
blockedSimulation passed but policy blocked it (MEV, risk, slippage, etc.)
simulation_failedSimulation failed — transaction would fail on-chain

Routes

RouteWhen
direct_rpcMEV score below Jito threshold — submitted via normal Solana RPC
jito_bundleMEV score above threshold or force_jito=true — submitted via Jito for sandwich protection
noneTransaction was blocked or simulation failed — not submitted

POST /api/v1/solana/tx/send

Reliable transaction landing. Multi-RPC with auto-retry, optional Jito routing, and confirmation tracking.

Auth required

Request (minimal)

{
  "transaction": "base64-encoded-signed-solana-transaction"
}

Request (full options)

{
  "transaction": "base64-encoded-signed-solana-transaction",
  "use_jito": true,
  "wait_confirmation": true,
  "max_retries": 3
}
FieldTypeDefaultDescription
use_jitoboolfalseRoute via Jito for MEV protection
wait_confirmationboolfalseWait up to 30s for on-chain confirmation before returning
max_retriesint3Retry attempts across multiple RPCs (max 5)

Response

{
  "signature": "5xK2gR...",
  "route": "direct_rpc",
  "confirmation": "confirmed",
  "attempts": 1,
  "latency_ms": 2450
}

What makes this different from raw RPC

FeatureRaw RPCTxShield /send
Staked connectionsOnly with paid RPCIncluded
Multi-RPC fallbackYou build itAutomatic (staked → public)
Auto-retryYou build itUp to 5 attempts
Jito routingSeparate integrationOne flag: use_jito: true
Confirmation trackingYou poll yourselfwait_confirmation: true

POST /api/v1/solana/tx/simulate-batch

Simulate up to 50 transactions in parallel.

Auth required

Request

{
  "transactions": ["base64_tx_1", "base64_tx_2", "..."]
}

Response

{
  "results": [
    {"index": 0, "success": true, "risk_level": "safe", "mev_score": 0.0, ...},
    {"index": 1, "success": false, "risk_level": "high", "failure_code": "insufficient_sol", ...}
  ],
  "total": 2,
  "succeeded": 1,
  "failed": 1
}

GET /api/v1/solana/simulations/stats

Get your simulation usage statistics.

Auth required
{
  "total_simulations": 12450,
  "success_count": 11200,
  "fail_count": 1250,
  "success_rate": 0.9,
  "avg_latency_ms": 67.4,
  "avg_mev_score": 0.12,
  "mev_distribution": {"none": 8000, "low": 3000, "medium": 1200, "high": 250},
  "top_failure_reasons": [{"code": "insufficient_sol", "count": 500}],
  "risk_distribution": [{"level": "safe", "count": 9000}],
  "simulations_today": 340,
  "simulations_7d": 2100
}

GET /api/v1/solana/simulations

Paginated simulation history.

Auth required

Query parameters

ParamTypeDefault
limitinteger50 (max 200)
offsetinteger0
successboolean(all)

TypeScript SDK

npm install @txshield/sdk

Simulate only (you handle submission)

import { TxShieldClient } from "@txshield/sdk";

const txshield = new TxShieldClient({
  baseUrl: "https://txshield.dev",
  apiKey: "your_api_key",
});

const result = await txshield.simulate(base64Transaction);
if (result.risk.risk_level === "critical") {
  console.warn("Blocked:", result.risk);
}

Execute (TxShield handles simulation + submission)

// Simplest — just send the signed transaction
const result = await txshield.execute(signedBase64Transaction);
// result.action: "submitted" | "blocked" | "simulation_failed"
// result.signature: "5xK2gR..." (if submitted)
// result.route: "direct_rpc" | "jito_bundle"

// With custom policy
const result = await txshield.execute(signedBase64Transaction, {
  max_slippage_bps: 50,
  block_risky_tokens: true,
  force_jito: true,
});

Pricing

Cloud API — Pay as you go

EndpointPrice / callPer 1,000Free tierWhat it does
/simulate$0.002$220,000 / moAnalyze — you submit
/send$0.001$110,000 / moLand it (multi-RPC, retry, confirm)
/execute$0.005$55,000 / moAnalyze + smart submit + Jito

Covers Solana + 7 EVM chains. No monthly minimums. Custom rules require Enterprise — contact sales.

Self-Hosted

PlanInstancesPrice
Starter1 (Docker)$299/mo
Pro3 (Helm)$999/mo
EnterpriseUnlimited$2,499/mo

Self-hosted: unlimited simulations. Your data stays on your servers. License key required.