For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Documentation

Use this API to integrate the Hypertrade Aggregator on HyperEVM.

Base URL: https://core.ht.xyz/api/v1/trade

Authentication

Most endpoints do not require authentication. Endpoints that require a JWT are explicitly marked below.

Response Format

All endpoints return JSON responses. HTTP status codes are returned in the response headers.

All response fields use camelCase.

Examples:

  • token_intokenIn

  • amount_outamountOut

  • created_atcreatedAt

Swap statuses are returned as strings:

  • pending

  • processing

  • completed

  • cancelled

  • failed


Get Tokens

GET /tokens

Returns all available tokens as a map keyed by token address.

Request

This endpoint does not require any parameters.

Successful Response

Token Fields

Field
Type
Description

symbol

string

Token ticker.

name

string

Token name.

address

string

Token address. 42 characters for EVM tokens, 34 characters for Core tokens.

decimals

number

Token decimals.

logoURI

string

Token logo URL.

coinId

string

Internal token identifier.

price

string

Current USD price.

type

string

Token type: evm or core.

volumeUsd24

string

24h trading volume in USD.

priceDelta24

number

24h price change. EVM only.

evmAddress

string

Paired EVM address. Core only.

coinIndex

number

Core token index for spot send. Core only.

coinTo

string

Core token pair filter. Core only.


Get Quote

GET /quote

Returns a swap quote without creating a swap order.

Query Parameters

Parameter
Type
Required
Description

src

string

Yes

Source token address.

dst

string

Yes

Destination token address.

amount

string

Yes

Input token amount in the smallest token unit.

slippage

number

Yes

Maximum slippage tolerance. Allowed range: 0.01 to 20.

referrerAddress

string

No

Referrer wallet address for fee sharing.

fee

number

No

Integrator fee amount, specified in basis points (bps), to be charged from the swap by the caller.

includeHyperCore

boolean

No

Enables Hyperliquid Core routing. Default: false.

onlyOurDex

boolean

No

Routes only through Hypertrade DEX. Default: false.

receiver

string

Yes

Receiver is the wallet address that should receive the output tokens

Example Request

Successful Response

Error Response

Possible Errors

  • the 'src' parameter cannot be empty

  • the 'dst' parameter cannot be empty

  • the 'amount' parameter cannot be empty

  • the 'slippage' parameter cannot be empty

  • slippage must be >= 0.01 && <= 20

  • token_from not found

  • token_to not found

  • token_from and token_to must be different

  • amount must be > 0

  • swap path not found

  • core swap must have minimum value of $15

  • core swap must have maximum value of $500000


Create Swap

GET /swap

Creates a swap order and returns transaction data for signing.

Query Parameters

Parameter
Type
Required
Description

src

string

Yes

Source token address.

dst

string

Yes

Destination token address.

amount

string

Yes

Input token amount in the smallest token unit.

slippage

number

Yes

Maximum slippage tolerance. Allowed range: 0.01 to 20.

from

string

Yes

Sender wallet address.

receiver

string

No

Recipient wallet address. Default: zero address.

referrerAddress

string

No

Referrer wallet address for fee sharing.

fee

number

No

Integration fee in basis points.

includeHyperCore

boolean

No

Enables Hyperliquid Core routing. Default: false.

onlyOurDex

boolean

No

Routes only through Hypertrade DEX. Default: false.

integrator_id

string

No

Name of the API integrator, who uses API.

Example Request

Successful Response

Swap Flow

  1. Call GET /swap with the required parameters.

  2. Receive the tx object in the response.

  3. Sign the transaction using tx.to, tx.data, and tx.value.

  4. Submit the signed transaction to the blockchain.

  5. The backend tracks the swap status automatically.

  6. Poll GET /swap/status?id=...&wallet=... to retrieve the latest swap status.

Swap Statuses

Status
Description

pending

Waiting for the user transaction.

processing

Transaction confirmed, backend is processing the swap.

completed

Swap completed successfully.

cancelled

Swap was cancelled.

failed

Swap failed.

Additional Errors

All /quote errors may also be returned here.

In addition, this endpoint may return:

  • the limit of undeposited maximum open swap orders has been exceeded


Get Swap Status

GET /swap/status

Returns swap details by swap ID.

Query Parameters

Parameter
Type
Required
Description

id

string

Yes

Swap UUID.

wallet

string

Yes

User wallet address.

Example Request

Successful Response

Possible Errors

  • id is required

  • wallet is required

  • invalid swap ID format

  • swap not found


Get Swap History

GET /swap/history

Returns paginated swap history.

Authentication required: Authorization: Bearer <token>

Query Parameters

Parameter
Type
Required
Description

status

number

No

Filter by swap status.

offset

number

No

Page number. Default: 1.

size

number

No

Page size. Default: 10. Maximum: 100.

Example Request

Successful Response

Possible Errors

  • Unauthorized, invalid or expired token

  • page must be greater than 0

  • size should be between 1 and 100


Cancel Swap

GET /swap/cancel

Cancels a pending swap.

Only swaps in the initial pending state can be cancelled.

Query Parameters

Parameter
Type
Required
Description

id

string

Yes

Swap UUID.

wallet

string

Yes

User wallet address.

Example Request

Successful Response

Possible Errors

  • id is required

  • wallet is required

  • invalid swap ID format

  • swap not found

  • swap status must be undeposited(0)


Migration Guide

If you are migrating from the previous API version, use the following endpoint mapping.

POST /getSwapInfoGET /quote

Changes:

  • inputTokenAddresssrc

  • outputTokenAddressdst

  • inputAmountamount

  • feeAddressreferrerAddress

  • feeBpsfee

  • enableHyperCoreincludeHyperCore

POST /swapGET /swap

Changes:

  • same parameter renames as above

  • userAddressfrom

  • recipientAddressreceiver

GET /getTokensGET /tokens

Changes:

  • response changed from array to tokens map

  • fields renamed to camelCase

GET /getSwapById?id=...&wallet=...GET /swap/status?id=...&wallet=...

Changes:

  • response fields renamed to camelCase

GET /getSwapHistory?status=...GET /swap/history?status=...

Changes:

  • response fields renamed to camelCase

  • total_counttotalCount

GET /closeSwapById?id=...&wallet=...GET /swap/cancel?id=...&wallet=...

Changes:

  • response fields renamed to camelCase

Last updated