# FortiSwap Transaction Builder

> FortiSwap Transaction Builder is a paid API for AI agents from app.fortiblox.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Builds an unsigned, simulated X1 blockchain swap transaction (base64 v0) routed through the on-chain FortiBlox Router, with impact capping, slippage control, and 25 bps protocol fee enforced in-program.

## Facts

- Endpoint: POST https://app.fortiblox.com/api/tx/build
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fortiswap-transaction-builder-6049e62b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zDaCKrUazKhUZ9h0-Vu8s

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability fortiswap-transaction-builder-6049e62b -d '<json body>'
```

Example prompt: Build me an unsigned FortiBlox swap transaction to swap 1000000 raw units of mint So11111111111111111111111111111111111111112 for mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v using exactIn mode with 50 bps slippage, payer account 9xDef1234ABCxyz567, max 4 hops, and a priority fee of 5000 lamports.

## When to prefer this

Use this endpoint when you need to construct a ready-to-sign X1 blockchain swap transaction routed through the FortiBlox on-chain router with simulation guarantees. It is the required second step after obtaining a quote from /api/quote. Prefer this over generic Solana transaction builders when you specifically need FortiBlox's impact-capping, multi-hop routing across XDEX and Degen pools, and in-program fee enforcement on the X1 network.

## Known failure modes

- Invalid or unfunded payer address — simulation fails if the payer account doesn't exist on X1
- Missing prior quote — validUntilSlot must come from a preceding /api/quote call
- Expired quote slot — transaction build fails if validUntilSlot has passed
- Exceeds maxHops cap — values above 6 are rejected by the on-chain router
- High price impact without acknowledgeHighImpact=true — build rejected to protect user
- Slippage too tight — simulation may fail if market moved beyond slippageBps since quote
- Invalid mint address — non-base58 or unregistered mints cause rejection
- Payment required — $0.005 USDC per call; missing or failed x402 payment returns 402

## How this service works

Build an unsigned, simulated X1 swap transaction (base64 v0) for the given payer through the on-chain FortiBlox Router — routed, impact-capped, simulated before return; the 25 bps protocol fee is enforced in-program. Sign it with the payer key and broadcast via POST /api/tx/send (free). Amounts are raw base units. Requires a prior quote. Optional integrator fee (integratorFeeBps + integratorFeeRecipient; the recipient's output-mint ATA must exist, else 422 INTEGRATOR_FEE_DESTINATION_MISSING).

## Output

Returns an unsigned base64-encoded Solana v0 transaction that has been pre-simulated on-chain via the FortiBlox Router. The transaction includes route selection across XDEX and Degen pools, impact capping, and the 25 bps protocol fee enforced in-program. The caller must sign it with the payer key and broadcast via POST /api/tx/send.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "exactIn",
    "exactOut"
   ],
   "type": "string",
   "description": "default exactIn"
  },
  "payer": {
   "type": "string",
   "description": "base58 fee payer / signer (must be a funded X1 account — the build is simulated)"
  },
  "maxHops": {
   "type": "number",
   "description": "1-6 (on-chain router cap), default 4"
  },
  "amountIn": {
   "type": "string",
   "description": "raw base units (exactIn)"
  },
  "amountOut": {
   "type": "string",
   "description": "raw base units (exactOut)"
  },
  "inputMint": {
   "type": "string",
   "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
   "description": "base58 X1 mint address"
  },
  "outputMint": {
   "type": "string",
   "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$",
   "description": "base58 X1 mint address"
  },
  "slippageBps": {
   "type": "number",
   "description": "explicit slippage in bps (clamped); omitted = dynamic"
  },
  "validUntilSlot": {
   "type": "number",
   "description": "quote expiry slot from /api/quote"
  },
  "integratorFeeBps": {
   "type": "number",
   "description": "1-300; optional integrator markup taken in-program by the router into integratorFeeRecipient's ATA — requires integratorFeeRecipient; 0/absent = none"
  },
  "keepWrappedOutput": {
   "type": "boolean",
   "description": "keep WXNT instead of auto-unwrapping"
  },
  "priorityFeeLamports": {
   "type": [
    "string",
    "number"
   ],
   "description": "optional total priority-fee budget in lamports, non-negative integer (string or number); clamped to 1000000000"
  },
  "acknowledgeHighImpact": {
   "type": "boolean"
  },
  "integratorFeeRecipient": {
   "type": "string",
   "description": "base58 integrator wallet (required with integratorFeeBps); its associated token account for outputMint must already exist — the router never creates it (422 INTEGRATOR_FEE_DESTINATION_MISSING names the address)"
  },
  "priorityFeeMicroLamports": {
   "type": [
    "string",
    "number"
   ],
   "description": "optional per-compute-unit priority fee, non-negative integer (string or number); clamped to 714285714"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fortiswap-transaction-builder-6049e62b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from app.fortiblox.com](https://www.zero.xyz/host/app.fortiblox.com/llms.txt)
