# True Markets DeFi REST

API for the True Markets DeFi service — non-custodial trading, quotes, balances, transfers, and wallet management on decentralized protocols.

## Base URLs

| Environment | Base URL |
|---|---|
| Production | `https://api.truemarkets.co` |
| UAT (sandbox) | `https://api.uat.truemarkets.co` |

> UAT is the testing environment. It may require VPN/allowlist access for some integrations — contact [support@truemarkets.co](mailto:support@truemarkets.co) if requests time out from a public network.

## Authentication

Authenticated endpoints require a JWT access token in the `Authorization: Bearer <token>` header. Public read-only endpoints (assets, watchlists, app config) work without a token.

### Getting credentials

1. **Create an account** at [https://www.truemarkets.co](https://www.truemarkets.co) (passkey, email, magic link, or Sign in with Apple).
2. **Register an API key** in your account's *API Keys* settings page. Generate an EC P-256 key pair locally and submit only the public key — the private key never leaves your machine. You'll receive a `key_id` (UUID).
3. **Mint JWTs** by calling `POST /v1/auth/api-key/token` with `key_id`, a current `timestamp` (Unix seconds, within ±30s of server UTC time), and `signature` — an ES256 (ECDSA P-256 + SHA-256) signature of the message `{key_id}.{timestamp}`, base64url-encoded. The response returns `access_token` and `refresh_token`.
4. **Call the API** with `Authorization: Bearer <access_token>`.
5. **Refresh** expired access tokens via `POST /v1/auth/token/refresh` with the `refresh_token` — no re-signing required.

## Support
- 💬 [Discord](https://discord.gg/SC92xRUZqw) — community and integration help
- 📧 [support@truemarkets.co](mailto:support@truemarkets.co) — account, network, onboarding


Version: v2026_01_26

## Servers

Production
```
https://api.truemarkets.co
```

UAT (sandbox)
```
https://api.uat.truemarkets.co
```

## Security

### bearerAuth

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

[True Markets DeFi REST](https://docs.truemarkets.co/_bundle/apis/defi-direct/openapi.yaml)

## Service

Application configuration, documentation, and service metadata endpoints.

### Get app configuration disclaimers

 - [GET /v1/defi/core/appconfig/disclaimers](https://docs.truemarkets.co/apis/defi-direct/openapi/service/getdisclaimers.md)

## Assets

Query available assets and their metadata across supported chains.

### Get all active assets

 - [GET /v1/defi/core/assets](https://docs.truemarkets.co/apis/defi-direct/openapi/assets/getassets.md)

### Get asset by chain and address

 - [GET /v1/defi/core/asset/{chain}/{address}](https://docs.truemarkets.co/apis/defi-direct/openapi/assets/getassetbychainandaddress.md)

## Balances

Query wallet balances for authenticated users or specific wallet addresses.

### Get authenticated user balances

 - [GET /v1/defi/core/balances](https://docs.truemarkets.co/apis/defi-direct/openapi/balances/getbalances.md): Returns balances for all wallets associated with the authenticated user

### Get balances for a specific wallet address

 - [GET /v1/defi/core/balances/{owner}](https://docs.truemarkets.co/apis/defi-direct/openapi/balances/getbalancesbyowner.md)

## Trading

Fetch quotes and execute trades on supported chains.

### Fetch a quote

 - [POST /v1/defi/core/quote](https://docs.truemarkets.co/apis/defi-direct/openapi/trading/createquote.md)

### Execute a trade synchronously

 - [POST /v1/defi/core/trade](https://docs.truemarkets.co/apis/defi-direct/openapi/trading/executetrade.md): Executes a trade using a cached quote and returns the transaction hash. Follows the same pattern as transfer/execute.

### Prepare a cancel for a resting Hyperliquid limit order

 - [POST /v1/defi/core/order/{id}/cancel/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/trading/preparecancelorder.md): Returns a Turnkey payload the client must stamp. Currently only supports Hyperliquid spot orders in OPEN status.

### Execute a prepared cancel

 - [POST /v1/defi/core/order/{id}/cancel/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/trading/executecancelorder.md)

## Transfers

Prepare and execute on-chain token transfers, including internal bridge transfers.

### Prepare a transfer

 - [POST /v1/defi/core/transfer/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/transfers/preparetransfer.md)

### Execute a transfer

 - [POST /v1/defi/core/transfer/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/transfers/executetransfer.md)

## Wallets

Create wallets, export private keys, and manage API keys for programmatic access.

### Create a new wallet

 - [POST /v1/defi/core/create-wallet](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/createwallet.md)

### Prepare a wallet export payload

 - [POST /v1/defi/core/wallet/export/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/preparewalletexport.md)

### Execute a wallet private key export

 - [POST /v1/defi/core/wallet/export/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/executewalletexport.md)

### Prepare an API key creation payload

 - [POST /v1/defi/core/wallets/api-keys/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/prepareapikey.md)

### Execute API key creation

 - [POST /v1/defi/core/wallets/api-keys/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/executeapikey.md)

### List API keys

 - [GET /v1/defi/core/wallets/api-keys](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/listapikeys.md)

### Prepare an API key deletion payload

 - [POST /v1/defi/core/wallets/api-keys/delete/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/preparedeleteapikey.md)

### Execute API key deletion

 - [POST /v1/defi/core/wallets/api-keys/delete/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/wallets/executedeleteapikey.md)

## Profile

Retrieve authenticated user profile and wallet information.

### Get the authenticated user profile

 - [GET /v1/defi/core/profile/me](https://docs.truemarkets.co/apis/defi-direct/openapi/profile/getprofile.md)

## Watchlists

Browse curated asset watchlists.

### Get all watchlists

 - [GET /v1/defi/core/watchlists](https://docs.truemarkets.co/apis/defi-direct/openapi/watchlists/getwatchlists.md): Returns all global/public watchlists.

### Get watchlist by ID

 - [GET /v1/defi/core/watchlists/{id}](https://docs.truemarkets.co/apis/defi-direct/openapi/watchlists/getwatchlistbyid.md): Returns a specific global/public watchlist with all its assets.

## History

Unified transaction history across trades, transfers, and on-ramps.

### Get transaction history

 - [GET /v1/defi/core/history](https://docs.truemarkets.co/apis/defi-direct/openapi/history/gethistory.md): Returns a unified view of all user transactions including trades, transfers, and onramps

## Onramp

Initiate and track fiat-to-crypto on-ramp transactions via Coinbase.

### Create an onramp transaction

 - [POST /v1/defi/core/onramp](https://docs.truemarkets.co/apis/defi-direct/openapi/onramp/createonramp.md): Initiates a Coinbase onramp flow for purchasing crypto with fiat

### Get onramp transaction status

 - [GET /v1/defi/core/onramp/transactions/{id}/status](https://docs.truemarkets.co/apis/defi-direct/openapi/onramp/getonrampstatus.md): Returns the status of a specific onramp transaction

## Recovery

Wallet recovery flow using email OTP and passkey re-registration.

### Initiate wallet recovery via email OTP

 - [POST /v1/defi/core/recovery/verify-wallet-email](https://docs.truemarkets.co/apis/defi-direct/openapi/recovery/verifywalletemail.md): Sends an OTP to the user's email to begin the wallet recovery process

### Verify wallet recovery OTP

 - [POST /v1/defi/core/recovery/verify-wallet](https://docs.truemarkets.co/apis/defi-direct/openapi/recovery/verifywallet.md): Verifies the OTP code and returns a credential bundle for passkey creation

### Prepare wallet recovery

 - [POST /v1/defi/core/recovery/register](https://docs.truemarkets.co/apis/defi-direct/openapi/recovery/registerrecovery.md): Builds the WebAuthn payload for registering a new passkey during recovery

### Execute wallet recovery

 - [POST /v1/defi/core/recovery/register-wallet](https://docs.truemarkets.co/apis/defi-direct/openapi/recovery/registerwalletrecovery.md): Submits the signed WebAuthn payload to complete wallet recovery

## Ramps

Provider-agnostic on-ramp and off-ramp transactions with redirect-based flows.

### Get ramp limits

 - [GET /v1/defi/core/ramps/limits](https://docs.truemarkets.co/apis/defi-direct/openapi/ramps/getramplimits.md): Returns provider amount limits for all supported ramp flows. Providers with unconfigured limits are omitted.

### Create a ramp transaction

 - [POST /v1/defi/core/ramps](https://docs.truemarkets.co/apis/defi-direct/openapi/ramps/createramp.md): Creates a provider-agnostic ramp (onramp or offramp) transaction and returns a redirect URL to complete the flow with the provider

### Get a ramp transaction

 - [GET /v1/defi/core/ramps/{id}](https://docs.truemarkets.co/apis/defi-direct/openapi/ramps/getramp.md): Returns the current status and details of a ramp transaction

### Prepare a ramp transfer

 - [POST /v1/defi/core/ramps/{id}/prepare](https://docs.truemarkets.co/apis/defi-direct/openapi/ramps/prepareramp.md): Prepares a transfer for a ramp transaction and returns unsigned payloads for signing

### Execute a ramp transfer

 - [POST /v1/defi/core/ramps/{id}/execute](https://docs.truemarkets.co/apis/defi-direct/openapi/ramps/executeramp.md): Executes a prepared ramp transfer with signed payloads

