---
title: "Simulate a built transaction before signing"
method: POST
path: "/swap/simulate"
tags: ["Quote and swap"]
---

# Simulate a built transaction before signing

`POST /swap/simulate`

## Request

- Base URL: `https://api.getchord.xyz/v1`
- URL: `https://api.getchord.xyz/v1/swap/simulate`
- Auth: none declared

`eth_call`s the built calldata from the user's address and estimates gas, so a revert is caught before the wallet opens. Known selectors are decoded (`NotRouter`, a paused Kuru market, allowance and balance errors). An allowance revert is advisory: approve first, then swap.

## Request body

- object
  - `chain` 5042 | 4663 | 143 | 43114 | 8453 | 56 | 42161 | 1
  - `from` string, required: EVM address, hex, case-insensitive.
  - `to` string, required: EVM address, hex, case-insensitive.
  - `data` string, required: Calldata from `/swap`.
  - `value` string, required: Amount in the token's smallest unit, as a decimal string. Never a float.

## Response `200`

`ok: true` with the simulated output and gas, or `ok: false` with the decoded revert.

- object
  - `ok` boolean
  - `amountOut` string, nullable: Simulated output, smallest unit.
  - `gas` integer, nullable: Estimated gas units.
  - `revert` string: Decoded reason (when `ok` is false).
  - `selector` string, nullable: 4-byte error selector.

## Other responses

- `400`: Invalid parameters — `error` names the check that failed (`INVALID_PARAMS`, `BAD_ADDRESS`, `BAD_LIMIT`, `BAD_HOURS`, …).
- `503`: The lane behind this endpoint is not ready or not enabled here (`NOT_READY`, `CHAIN_NOT_ENABLED`, `NOT_ENABLED`, `*_UNAVAILABLE`). Retry later; do not treat it as an empty answer.

---

[API](https://skmtc.dev/getchord/apis/chord-api.md) · [All operations](https://skmtc.dev/getchord/apis/chord-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getchord/apis/chord-api/revisions/d3bc4640fea0?raw)
