TRDEFI Quotes API
Indicative pricing. Nothing here signs or moves funds.
Indicative pricing. Nothing here signs or moves funds.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/trdefi-com:trdefi-com-quotes-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: TRDEFI Liquidity Quotes API
version: 1.2.0
summary: Read the live non-custodial liquidity catalogue, quote it, and prepare unsigned positions for your own wallet to sign.
description: 'Public, read-first API over the open liquidity catalogue that TRDEFI normalises, plus a **prepare-only write path** for integrators holding a key.
**Non-custodial, strictly.** The API never signs and never broadcasts. `POST /v1/positions` returns *unsigned* transactions that your own wallet signs from your own address. No endpoint accepts a private key or a signing grant.
**Contract.** Every response carries `X-Request-Id`. Every endpoint advertises `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` and `RateLimit-Policy`, on success and on failure. Every error is the same envelope: `{ error: { code, message, requestId, retryable, documentation } }`.
**Money.** Amounts are returned as USD numbers for read models. On-chain amounts are strings in base units with an explicit `decimals`.
**Fees.** Every newly created position carries a 0.05% protocol fee embedded in the signed order data. It is reported in the `fee` object of every prepared position and cannot be removed by the integrator or by us.
**Keys.** Reading needs no key. Preparing needs `Authorization: Bearer trd_live__`, held server-side only. Request one at https://yield.trdefi.com/docs/api#access.
**Stability.** See the deprecation policy at https://yield.trdefi.com/docs/api — path-versioned resources, a published calendar, and a minimum 90-day notice window.'
contact:
name: TRDEFI
url: https://trdefi.com
email: info@trdefi.com
license:
name: All rights reserved
url: https://trdefi.com
x-guidance: 'Start with GET /api/strategies (public, no key). Filter to what you can use,
then GET /api/quote?hash=...&chain=...&amount=... to price a swap against that
position on-chain. Read models return USD numbers; on-chain amounts are
strings in base units and always carry an explicit decimals field.
Writing is prepare-only and costs money. POST /v1/positions opens a maker
position; POST /v1/swaps prepares a taker swap against an existing one.
Both return UNSIGNED transactions for your own wallet to sign - the API never
signs, never broadcasts and never holds a key.
Paid routes answer 402 with the x402 terms when no credential is presented.
Pay with your own wallet and retry with the base64 payload in the
PAYMENT-SIGNATURE header (0.02 USD), or present an API key instead, which
costs nothing.
Before paying for a swap, call it: a strategy that is gated, or an amount the
maker cannot fill, returns a reason and NO transactions rather than a
transaction that is certain to revert.'
servers:
- url: https://yield.trdefi.com
description: Production
security: []
tags:
- name: Quotes
description: Indicative pricing. Nothing here signs or moves funds.
paths:
/api/quote:
get:
tags:
- Quotes
operationId: getQuote
summary: Quote against a specific live strategy
description: 'Nothing is signed and nothing moves: this is a read. The endpoint simulates the position as it stands right now, so the number is the maker''s own curve, not a market quote.
A maker may gate a position on the caller holding an access licence token, and most positions are gated. The response says which case it is instead of guessing:
- pass `wallet` and the gate becomes a 1inch Fusion price: `price_source: "fusion"`, `executable: true`, and a resolver fills it, so the wallet needs no credential;
- pass nothing and the gate becomes `indicative: true`, `executable: false` - the position''s own price, simulated as a licensed caller, which an unlicensed wallet cannot fill;
- `UNPROCESSABLE` / `GATED` only when neither of those is available.
The endpoint never returns a guessed price.'
parameters:
- name: hash
in: query
required: true
schema:
type: string
description: Strategy hash, 64 hex characters.
- name: chain
in: query
schema:
type: string
description: Chain key. Defaults to `ethereum`.
- name: amount
in: query
required: true
schema:
type: string
description: Amount in token base units, as a string.
- name: direction
in: query
schema:
type: string
enum:
- aToB
- bToA
default: aToB
description: Swap direction.
- name: from
in: query
schema:
type: string
description: Taker address used as msg.sender for the simulation. The gate reads tx.origin, so a caller holding the maker's credential gets the real price here.
- name: wallet
in: query
schema:
type: string
description: The wallet that would trade. On a gated position this returns a Fusion price (price_source "fusion", executable true) instead of an indicative one, because a 1inch resolver fills the order and the wallet needs no credential.
responses:
'200':
description: Indicative quote
content:
application/json:
schema:
type: object
additionalProperties: true
'400':
$ref: '#/components/responses/BadRequest'
'429':
$ref: '#/components/responses/RateLimited'
security: []
components:
schemas:
Error:
type: object
required:
- error
- code
- requestId
- retryable
properties:
error:
type: string
description: Human-readable message. May change without notice.
code:
type: string
description: Stable, machine-mappable. Branch on this, never on the message.
example: RATE_LIMITED
requestId:
type: string
retryable:
type: boolean
description: True when the same request may be retried after a backoff.
documentation:
type: string
format: uri
description: A link to the definition of this code.
issues:
type: array
description: Structured, client-fixable problems (allowance, balance, chain).
items:
type: object
properties:
type:
type: string
example: INSUFFICIENT_ALLOWANCE
expected:
type: string
actual:
type: string
spender:
type: string
headers:
RequestId:
description: Unique id for this request. Quote it in support tickets.
schema:
type: string
example: <hex string, echoed per request>
responses:
BadRequest:
description: Malformed or missing parameters
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Rate limit exceeded. `Retry-After` is always present.
headers:
Retry-After:
schema:
type: integer
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: RATE_LIMITED
message: Rate limit exceeded for stats
requestId: …
retryable: true
documentation: https://yield.trdefi.com/docs/api/errors#rate_limited
securitySchemes:
x402:
type: apiKey
in: header
name: PAYMENT-SIGNATURE
description: 'Pay per request instead of holding a key: retry with the base64 x402 payment payload. `PAYMENT-SIGNATURE` is the x402 v2 header; the deprecated v1 `X-PAYMENT` is still accepted. With no credential at all, the prepare endpoints answer a **402** carrying the payment terms in the `PAYMENT-REQUIRED` header and a `bazaar` discovery extension. A settled call returns its receipt in the `PAYMENT-RESPONSE` header.'
bearerAuth:
type: http
scheme: bearer
bearerFormat: trd_live_<keyId>_<secret>
description: An API key issued after review. Held **server-side only** — a key in client-side code is treated as compromised. It can prepare unsigned transactions and read the positions it prepared. It can never sign, broadcast or move value. Request one at https://yield.trdefi.com/docs/api#access