BlockchainLive

Tx Simulate Swap

Simulates a DEX swap before you trade: given (from_token, to_token, amount_in, chain), pulls a routed quote from a free DEX meta-aggregator and returns expected output, min-out at…

$0.023USDC per call · settled on Base · no subscription, no API key

Overview

Simulates a DEX swap before you trade: given (from_token, to_token, amount_in, chain), pulls a routed quote from a free DEX meta-aggregator and returns expected output, min-out at user-supplied slippage (default 1%), gas estimate, router address, and a would_succeed verdict. Quote-only depth; full Tenderly-style state simulation requires a paid API and is documented in the response's simulation_caveat. Use it as a pre-trade quote, DEX swap simulator, 1inch + LlamaSwap quote, or would-it-succeed check.

Endpoint

MethodEndpointPriceDescription
POST/v1/marketplace/api/tx-simulate-swap$0.023Invoke Tx Simulate Swap (Blockchain) and return the upstream response.

How to call it

Requests are paid per call over the x402 protocol. Call the endpoint, receive a 402 Payment Required quote, then repeat the request with the signed payment header. The SDKs do both steps for you.

# 1. Ask for a quote
curl -i -X POST https://api.jarvisclaw.ai/v1/marketplace/api/tx-simulate-swap \
  -H 'Content-Type: application/json' \
  -d '{}'

# 2. Pay it (the SDK signs and retries for you)
curl -X POST https://api.jarvisclaw.ai/v1/marketplace/api/tx-simulate-swap \
  -H 'Content-Type: application/json' \
  -H 'X-PAYMENT: <signed-payload>' \
  -d '{}'
Open in the marketplace

Docs: Getting started · x402 payments · x402 discovery · All APIs