{
  "generated_at": "2026-04-24T15:01:35.625676+00:00",
  "slug": "x402-sushi-up-railway-app-swap",
  "title": "x402-Sushi \u00b7 Execute aggregated token swap",
  "url": "https://x402-sushi.up.railway.app/swap",
  "category": "finance",
  "summary": "Execute token swaps with aggregated routing across DEX liquidity sources. Returns input amounts, estimated outputs, and transaction preparation data.",
  "seo": {
    "title": "DEX Aggregated Swap API | x402 | Sushi x402",
    "description": "Execute optimized token swaps via x402 micropayment. $0.01 per call. Aggregated routing with amountIn, assumedAmountOut, and transaction data for EVM chains."
  },
  "use_cases": [
    "Build automated trading agents with optimal routing",
    "Execute user swaps with price impact protection",
    "Integrate swap functionality into wallet applications",
    "Aggregate liquidity for large order execution"
  ],
  "ideal_buyer": "DeFi aggregators, automated trading agents, and wallet developers needing programmatic swap execution with route optimization.",
  "example_prompt": "Swap 1000 USDC for WETH with the best available route and return the expected output amount.",
  "example_request_body": {},
  "risk_notes": [],
  "pricing_sanity": {
    "flag": "normal",
    "ratio": 0.333,
    "median_category_atomic": 30000
  },
  "pricing_review_required": false,
  "pricing_decimal_suspect": false,
  "trust_tier": "indexed_external",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "pay_to": "0x5005412d9adf28ae1ddf347db5e3c4d5ec9bf58a",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "max_amount_required_atomic": "10000",
      "max_timeout_seconds": 300,
      "mime_type": "application/json",
      "description": "Aggregated swap transaction",
      "verified": false,
      "hints": {
        "input": {
          "type": "http",
          "method": "POST",
          "bodyType": "json",
          "bodyFields": {
            "fee": {
              "type": "number",
              "description": "Fee fraction (0\u20130.5)"
            },
            "debug": {
              "type": "boolean",
              "description": "Enable debugging mode"
            },
            "feeBy": {
              "enum": [
                "input",
                "output"
              ],
              "type": "string",
              "description": "Indicates which side the fee applies to"
            },
            "amount": {
              "type": "string",
              "required": true,
              "description": "Swap amount in base units (wei, etc.)"
            },
            "sender": {
              "type": "string",
              "required": true,
              "description": "Address of the wallet initiating the swap"
            },
            "source": {
              "enum": [
                "sender",
                "router"
              ],
              "type": "string",
              "description": "Liquidity source for routing"
            },
            "chainId": {
              "type": "number",
              "required": true,
              "description": "Supported EVM chain id"
            },
            "onlyDEX": {
              "type": "string",
              "description": "Comma-separated list of DEXes to include"
            },
            "tokenIn": {
              "type": "string",
              "required": true,
              "description": "Input token address (EVM address)"
            },
            "override": {
              "type": "boolean",
              "description": "If true, bypass some safety limits (internal use)"
            },
            "referrer": {
              "type": "string",
              "description": "Referrer identifier"
            },
            "simulate": {
              "type": "boolean",
              "description": "If true, simulate the transaction instead of executing"
            },
            "tokenOut": {
              "type": "string",
              "required": true,
              "description": "Output token address (EVM address)"
            },
            "validate": {
              "type": "boolean",
              "description": "If true, perform validation checks before swap"
            },
            "onlyPools": {
              "type": "string",
              "description": "Comma-separated list of pool addresses to include"
            },
            "recipient": {
              "type": "string",
              "required": false,
              "description": "Recipient address (defaults to sender if omitted)"
            },
            "visualize": {
              "type": "boolean",
              "description": "Whether to visualize the swap route"
            },
            "excludeDEX": {
              "type": "string",
              "description": "Comma-separated list of DEXes to exclude"
            },
            "includeRfq": {
              "type": "boolean",
              "description": "Whether to include RFQ quotes"
            },
            "feeReceiver": {
              "type": "string",
              "required": false,
              "description": "Address receiving the fee (required when fee > 0)"
            },
            "maxSlippage": {
              "type": "number",
              "description": "Maximum slippage allowed (0\u20131)"
            },
            "excludePools": {
              "type": "string",
              "description": "Comma-separated list of pool addresses to exclude"
            },
            "excludeTokens": {
              "type": "string",
              "description": "Comma-separated list of token addresses to exclude"
            },
            "maxPriceImpact": {
              "type": "number",
              "description": "Maximum allowed price impact (0\u20131)"
            }
          },
          "headerFields": {
            "content-type": {
              "type": "string",
              "description": "MIME type of the request body"
            }
          }
        },
        "output": {
          "type": "object",
          "example": {
            "tx": {
              "to": 9.83650862853668e+47,
              "gas": "162561",
              "data": "0x5f3bd1c8...0000",
              "from": 1.238012972454248e+48,
              "value": "10000000000000000",
              "gasPrice": 682394289
            },
            "status": "Success",
            "tokens": [
              {
                "name": "Ether",
                "symbol": "ETH",
                "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
                "decimals": 18
              },
              {
                "name": "Wrapped Ether",
                "symbol": "WETH",
                "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                "decimals": 18
              },
              {
                "name": "SushiToken",
                "symbol": "SUSHI",
                "address": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",
                "decimals": 18
              }
            ],
            "tokenTo": 2,
            "amountIn": "10000000000000000",
            "swapPrice": 2837.670924657253,
            "tokenFrom": 0,
            "priceImpact": -0.002204113661183449,
            "assumedAmountOut": "28376709246572527616"
          },
          "required": [
            "status",
            "tokens",
            "tokenFrom",
            "tokenTo",
            "swapPrice",
            "priceImpact",
            "amountIn",
            "assumedAmountOut",
            "tx"
          ],
          "properties": {
            "tx": {
              "type": "object",
              "required": [
                "from",
                "to",
                "gas",
                "gasPrice",
                "data",
                "value"
              ],
              "properties": {
                "to": {
                  "oneOf": [
                    {
                      "type": "string",
                      "pattern": "^0x[a-fA-F0-9]{40}$"
                    },
                    {
                      "type": "number"
                    }
                  ],
                  "description": "Target contract/address (may come as number in upstream payloads)"
                },
                "gas": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "Gas limit (decimal string)"
                },
                "data": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]*$",
                  "description": "Calldata hex"
                },
                "from": {
                  "oneOf": [
                    {
                      "type": "string",
                      "pattern": "^0x[a-fA-F0-9]{40}$"
                    },
                    {
                      "type": "number"
                    }
                  ],
                  "description": "Sender address (may come as number in upstream payloads)"
                },
                "value": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "ETH value in wei (decimal string)"
                },
                "gasPrice": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Gas price in wei (number)"
                }
              },
              "description": "Prepared transaction to execute the swap",
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "description": "Request status (e.g. Success)"
            },
            "tokens": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "address",
                  "symbol",
                  "name",
                  "decimals"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string",
                    "description": "Token contract or native sentinel"
                  },
                  "decimals": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "minItems": 1,
              "description": "Token metadata referenced by tokenFrom/tokenTo indices"
            },
            "tokenTo": {
              "type": "integer",
              "minimum": 0,
              "description": "Index into tokens[]"
            },
            "amountIn": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Input amount in base units"
            },
            "swapPrice": {
              "type": "number",
              "description": "Quoted price (tokenTo per tokenFrom)"
            },
            "tokenFrom": {
              "type": "integer",
              "minimum": 0,
              "description": "Index into tokens[]"
            },
            "priceImpact": {
              "type": "number",
              "description": "Estimated price impact (-1..1)"
            },
            "assumedAmountOut": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Estimated output in base units"
            }
          },
          "additionalProperties": false
        }
      }
    }
  ],
  "duplicate_cluster_id": "finance-cl-ba0c906406cf",
  "origin": {
    "slug": "x402-sushi-up-railway-app",
    "host": "x402-sushi.up.railway.app",
    "title": "x402-sushi (Railway)",
    "description": "An x402-payable API endpoint hosted on Railway. The application is currently unavailable or misconfigured. Check back later for service status.",
    "url": "https://x402-sushi.up.railway.app",
    "favicon": "https://x402-sushi.up.railway.app/favicon.ico"
  },
  "json_ld": {
    "@id": "https://x402all.com/resource/x402-sushi-up-railway-app-swap",
    "url": "https://x402all.com/resource/x402-sushi-up-railway-app-swap",
    "name": "x402-Sushi \u00b7 Execute aggregated token swap",
    "@type": "WebAPI",
    "offers": {
      "url": "https://x402all.com/resource/x402-sushi-up-railway-app-swap",
      "@type": "Offer",
      "price": "0.01",
      "availability": "https://schema.org/InStock",
      "priceCurrency": "USDC",
      "priceSpecification": {
        "@type": "UnitPriceSpecification",
        "price": "0.010000",
        "unitText": "call",
        "priceCurrency": "USDC"
      },
      "eligibleCustomerType": "Agent",
      "additionalProperty": [
        {
          "@type": "PropertyValue",
          "name": "paymentNetwork",
          "value": "base"
        },
        {
          "@type": "PropertyValue",
          "name": "paymentAsset",
          "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
        }
      ]
    },
    "sameAs": "https://x402-sushi.up.railway.app/swap",
    "@context": "https://schema.org",
    "provider": {
      "@id": "https://x402all.com/server/x402-sushi-up-railway-app",
      "url": "https://x402-sushi.up.railway.app",
      "name": "x402-sushi (Railway)",
      "@type": "Organization"
    },
    "identifier": "x402-sushi-up-railway-app-swap",
    "description": "Execute optimized token swaps via x402 micropayment. $0.01 per call. Aggregated routing with amountIn, assumedAmountOut, and transaction data for EVM chains.",
    "potentialAction": {
      "@type": "BuyAction",
      "target": "https://axon402.com/test-buy?resource=x402-sushi-up-railway-app-swap",
      "description": "Test-buy this endpoint on AXON"
    },
    "applicationCategory": "finance"
  },
  "axon_deep_link": "https://axon402.com/test-buy?resource=x402-sushi-up-railway-app-swap"
}
