# SolMachina DEX Quote

> SolMachina DEX Quote is a paid API for AI agents from api.solmachina.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Returns a real-time DEX swap quote on Solana, including optimal routing, output amount, minimum received, and price impact for a given token pair and amount.

## Facts

- Endpoint: GET https://api.solmachina.com/v1/dex-quote
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/solmachina-dex-quote-3ee2f72a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6pQOGghIQaNdLtLwHkmNg

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 solmachina-dex-quote-3ee2f72a
```

Example prompt: What's the best DEX quote to swap 1 SOL (So11111111111111111111111111111111111111112) for USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v) on Solana right now, with a slippage tolerance of 50 basis points?

## When to prefer this

Choose this endpoint when you need a real-time, source-cited DEX quote on Solana without requiring an API key or account — ideal for AI agents that pay per call via x402 USDC micropayments. Prefer this over CEX price feeds when you need on-chain routing intelligence, AMM path breakdown, and price impact analysis for Solana SPL token swaps.

## Known failure modes

- Invalid or unrecognized mint address returns an error — ensure both inputMint and outputMint are valid Base58 Solana token addresses
- Amount of zero or non-numeric string may cause a validation error
- slippageBps outside 0–5000 range is rejected
- No liquidity available for the requested token pair results in a route-not-found error
- Network congestion or Solana RPC issues may cause timeouts
- Payment failure via x402 (insufficient USDC balance) blocks the request

## How this service works

Before an AI agent executes on Solana, it asks SolMachina: risk + a decision (EXECUTE/REVIEW/REJECT) + an SMRI score + a signed receipt, paid per call over x402 in USDC. Trust-first — cites every source, says 'unknown' over guessing. No account, no API key.

## Output

Returns a JSON object containing the optimal swap route (number of hops and AMM path), output amount in the target token's base units, minimum received amount accounting for slippage, estimated swap USD value, and price impact as both a percentage and a qualitative band (e.g. low/medium/high).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "amount",
  "inputMint",
  "outputMint"
 ],
 "properties": {
  "amount": {
   "type": "string",
   "description": "Amount of inputMint in its base units (lamports for SOL, 1e6 per USDC)."
  },
  "inputMint": {
   "type": "string",
   "description": "Base58 mint you are selling, e.g. So11111111111111111111111111111111111111112 (SOL)."
  },
  "outputMint": {
   "type": "string",
   "description": "Base58 mint you are buying, e.g. EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v (USDC)."
  },
  "slippageBps": {
   "type": "integer",
   "description": "Slippage tolerance in basis points for min-received, 0-5000 (default 50 = 0.5%)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "route": {
   "type": "object",
   "properties": {
    "hops": {
     "type": "integer"
    },
    "path": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "amm": {
        "type": "string"
       }
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "amount": {
     "type": "string"
    },
    "minReceived": {
     "type": "string"
    },
    "swapUsdValue": {
     "type": "number"
    }
   }
  },
  "priceImpact": {
   "type": "object",
   "properties": {
    "pct": {
     "type": "number"
    },
    "band": {
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/solmachina-dex-quote-3ee2f72a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.solmachina.com](https://www.zero.xyz/host/api.solmachina.com/llms.txt)
