{"uid":"cap_vuA6ajX0wyf1sBRDsdqCK","slug":"solana-defi-swap-builder-with-risk-gate-b159de77","name":"Solana DeFi Swap Builder with Risk Gate","description":"Build a ready-to-sign Solana swap that refuses to route you into a rug. Runs the full honeypot/rug scan first: buying a token whose verdict is critical (or that cannot be sold) returns the verdict and NO transaction. Returns Jupiter's unsigned versioned transaction — we never custody funds, your wallet signs. A 0.5% platform fee applies ONLY when selling into USDC/SOL; buying is fee-free. Fee is disclosed in the response and rides inside the transaction you sign.","url":"https://soldefi.thomenz.me/v1/solana/swap/build","method":"POST","headers":{},"bodySchema":null,"responseSchema":{"type":"json","example":{"fee":{"bps":50,"mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","note":"Charged only on sells. Rides inside the transaction you sign; we never custody funds.","account":"Ca6VehbTacWoeqxDVK7qKZeDha7JvEGHoQLNjnrKoUzN","percent":"0.5%","amountAtomic":"13"},"gate":{"flags":[],"allowed":true,"verdict":"LOW RISK — mint & freeze authority renounced, sellable at scan time","riskLevel":"low","riskScore":12},"built":true,"direction":"sell","rationale":"Selling into a quote asset — the risk is whether the token you hold can actually be sold.","disclaimer":"The risk gate is an informational signal from public on-chain + market data at build time, not a guarantee. Inspect the transaction before signing — you sign it, we cannot.","subjectMint":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","transaction":{"simulationError":null,"swapTransaction":"AQAAAAAAAAAAAAAA…base64 versioned transaction, UNSIGNED","lastValidBlockHeight":415263441,"prioritizationFeeLamports":12345}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RztP6aif460rAHSLFCF65","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Builds a risk-gated, unsigned Solana swap transaction with rug/honeypot safety check and protocol fee embedded, ready to sign and submit.","exampleAgentPrompt":"Check if BONK token (DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263) is safe to sell, and if it passes the risk gate, build me an unsigned sell swap transaction for $50 worth into USDC with 0.5% slippage for my wallet.","exampleUseCases":[{"title":"Safe token exit before a dump","prompt":"I think this Solana token might be a honeypot — mint is DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263. Can you run a rug scan and, if it's sellable, build me an unsigned sell transaction for $200 worth so I can get out?"},{"title":"Automated bot swap with fraud gate","prompt":"My trading bot wants to buy the token at mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v — first do a honeypot and wash-trade check, and only build the unsigned buy transaction if the risk score is below 30."},{"title":"Portfolio rebalancer with risk check","prompt":"I need to rebalance by swapping $500 of this Solana token (mint: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263) into USDC — run the full risk gate first and give me the unsigned transaction with the fee details if it's low risk."}],"resultDescription":"Returns a JSON object containing: a base64-encoded unsigned versioned Solana swap transaction ready for wallet signing, a risk gate verdict (allowed true/false, riskLevel low/medium/high, riskScore 0-100, flags array), embedded protocol fee details (bps, mint, account, amountAtomic), simulation error status, last valid block height, prioritization fee in lamports, swap direction, and a human-readable rationale and disclaimer.","failureModes":["Token flagged as high-risk: gate.allowed=false, transaction not built, verdict explains specific risk flags","Simulation error: transaction built but simulationError is non-null, indicating on-chain execution would fail","Invalid mint address: 400 error or empty response if token mint is malformed or not found","Insufficient liquidity: swap cannot be routed, simulation fails","Payment failure: x402 micropayment of $0.001 USDC not processed, 402 response returned","Expired transaction: lastValidBlockHeight passed before user signs and submits"],"whenToPreferThis":"Choose this endpoint when you need to both build a Solana swap transaction AND gate it behind a real-time rug/honeypot risk scan in a single call — especially for sell-side exits where token sellability is uncertain. Prefer it over building a raw swap if you want an integrated risk verdict (mint/freeze authority check, wash-trade detection, sellability simulation) before committing to the transaction. Ideal for trading bots, portfolio managers, or user-facing apps that need to protect users from scam tokens without chaining multiple API calls.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:40:52.133Z","isFirstParty":false}