{"name":"tx-simulate-swap","description":"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.","price":"$0.02","method":"POST","input_schema":{"properties":{"from_token":{"type":"string","description":"0x-prefixed 20-byte ERC-20 input token."},"to_token":{"type":"string","description":"0x-prefixed 20-byte ERC-20 output token."},"amount_in":{"type":"string","description":"Input amount as a decimal string in smallest units (wei-equivalent)."},"chain":{"type":"string","enum":["base","ethereum","polygon","arbitrum","optimism"],"description":"EVM chain. Default 'base'."},"slippage_pct":{"type":"number","description":"Slippage tolerance for min_out, in percent. Range [0, 50]. Default 1."}},"required":["from_token","to_token","amount_in"]},"input_example":{"from_token":"0x4200000000000000000000000000000000000006","to_token":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","amount_in":"1000000000000000000","chain":"base"},"output_example":{"chain":"base","from_token":"0x4200000000000000000000000000000000000006","to_token":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","amount_in":"1000000000000000000","expected_out":"3284130000","min_out":"3251288700","slippage_pct":1,"gas_estimate":"180000","router":"0x2626664c2603336e57b271c5c0b26f421741e481","approval_target":"0x2626664c2603336e57b271c5c0b26f421741e481","would_succeed":true,"simulation_kind":"quote-only","source":"https://api.swap.defillama.com"},"x402_payment_required":true,"x402_facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}