# Welcome to Hypertrade

**Hypertrade is a native on-chain DEX** (v2 + v3) **and aggregator** built for Hyperliquid, designed around a trader-friendly UI/UX that prioritizes speed, structure, and simplicity.

Swap tokens instantly, manage liquidity positions without leaving the pool interface, and track all activity in the built-in transaction history. Your active pools are always sorted at the top for quick access.

Alongside the DEX, **Hypertrade includes a routing engine** – the only aggregator on Hyperliquid with any-to-any token swaps across HyperEVM and HyperCore. No other aggregator lets you swap anything on HyperEVM to anything on HyperCore and back.


# Getting Started

### Connect Your Wallet

1. Go to [ht.xyz](https://ht.xyz/)
2. Click "Connect Wallet" and select your preferred wallet
3. Approve the connection request

### Make Your First Swap

1. Select the token you want to swap from
2. Select the token you want to receive
3. Enter the amount
4. Review the quote and click "Swap"
5. Confirm the transaction in your wallet

### Provide Liquidity

1. Navigate to the Pools section
2. Choose between v3 (concentrated) or v2 (full range) liquidity
3. Select a token pair and deposit amount
4. For v3: set your price range
5. Confirm and sign the transaction


# Liquidity Pools

Liquidity pools are on-chain pools of tokens that traders use to swap assets without relying on traditional order books.

Users deposit pairs of tokens into a pool, and these deposits collectively create the liquidity that powers every trade.

In return, liquidity providers earn a share of the trading fees generated by the pool.

Hypertrade enables liquidity provision through two pool models, v3 and v2, giving users flexibility in how they participate in Hypertrade DEX.


# Dual Liquidity Models

Hypertrade DEX supports:

* v3 pools, which allow LPs to concentrate liquidity within a chosen price range and earn fees only when the market trades inside that range
* v2 pools, which use the constant-product formula (x·y = k) and provide continuous liquidity across the full price curve

This allows LPs to choose between:

* a more efficient, targeted model (v3)
* a passive, broad-liquidity model (v2)


# How Pools Work

### v3 Pools

#### Mechanics

Liquidity is not spread across the whole curve. Instead, providers choose specific price ranges defined by ticks (discrete price intervals).

The pool's current tick reflects the current price. Only liquidity assigned to the active tick range participates in swaps and earns fees.

After each swap or liquidity change:

* token reserves adjust
* the active tick may shift
* fees are calculated and recorded for relevant positions

#### LP Behavior

Each position stores a lower tick, upper tick, and liquidity amount, defining the exact price interval where it is active.

Fees accrue only when the market price stays inside the selected range. When active, the provider earns a larger share of fees relative to the capital committed.

When the price exits the range, fee accrual stops until the price re-enters it. The position remains safe but becomes inactive.

This model offers higher potential returns per unit of capital but requires range selection and occasional position management.

Benefits:

* Lower slippage for traders due to deeper liquidity near the active price
* Tighter spreads because capital is concentrated where trades actually happen
* Higher capital efficiency for LPs who manage their ranges effectively

### v2 Pools

#### Mechanics

The v2 model follows the classic constant-product AMM design.

Each pool holds two assets. All pricing and swaps are determined by the relative balances of these two reserves.

The pool maintains the invariant x \* y = k. Swaps change the reserves, and the price adjusts automatically to keep the product constant.

Every trade adds a fixed 0.30% fee directly into the pool. As liquidity grows, LP token value increases because fees accumulate inside the reserves.

#### LP Behavior

Liquidity is distributed evenly across the entire price curve. Users receive LP tokens that represent their proportional share of the pool. As the pool grows from trading fees, the value of these LP tokens increases.

Fees accumulate passively: every swap routed through the pool generates fees, which are distributed to all LPs according to their share.

Liquidity is always active. Because it is spread across the full price range, the position participates in all trades regardless of the current market price.

This model suits users who prefer passive, set-and-forget liquidity with no need to manage price ranges.

### Summary

* v3 provides targeted, efficient liquidity concentrated around chosen price ranges.
* v2 provides continuous, passive liquidity across the entire curve.

Both operate fully on-chain and permissionlessly inside Hypertrade DEX, allowing users to participate without intermediaries.


# Dex Fees

### v3 Pools

When a new V3 pool is created, the pool creator selects a fee tier. This fee tier becomes the total swap fee paid by traders for every swap in that pool.

Fee distribution:

* Liquidity Providers (LPs): 86% of the selected fee tier
* Protocol / Treasury: **14% of the selected fee tier**

Example – 0.30% fee tier:

* LPs receive 0.258% of the traded amount
* Protocol receives 0.042% of the traded amount
* The trader pays 0.30% total

Key points:

* The pool creator, not a central authority, chooses the fee tier.
* A 14% protocol fee share is always active on Hypertrade-integrated V3 pools.
* LPs always receive the majority (86%) of whatever fee tier is chosen.

### v2 Pools

All V2 pools operate with a fixed base fee of 0.30% per swap.

Fee distribution:

* LPs receive 5/6 of the fee
* Protocol (feeTo) receives 1/6 of the fee

In percentage terms:

* Total fee paid by the trader: 0.30%
* Protocol share: 0.30% × (1/6) = 0.05%
* LP share: 0.30% × (5/6) = 0.25%


# Security

Hypertrade is fully non-custodial and permissionless. Users interact directly with the protocol's smart contracts, and no third party ever takes custody of their assets. All swaps, liquidity deposits, and withdrawals happen entirely on-chain, following deterministic rules encoded in the AMM.

#### Core security principles

* Immutable AMM logic - The core smart-contract logic cannot be altered after deployment, ensuring predictable and verifiable behavior.
* Transparent reserves - All token balances inside pools are visible on-chain at all times. Anyone can independently verify liquidity, fees, and swap outcomes.
* No privileged execution paths - There are no admin keys or special accounts that can alter pricing, move user funds, or bypass normal pool logic.
* Continuous auditing of smart contracts - Smart contracts are subject to ongoing review and external audits to detect and minimize potential vulnerabilities.

#### Result

Users always retain full control over their assets, interacting directly with verifiable, permissionless smart contracts rather than intermediaries.


# Contracts

### v3 Pools

| Factory                       | 0x1Cd8363DfAdA19911f745BA984fce02b42c943bF |
| ----------------------------- | ------------------------------------------ |
| NFT Position Manager          | 0xF56B42C7a9809fCFcFBF734A21b6e3F6b32f8077 |
| NFT Position Descriptor       | 0x6Df4e13333f61cAe5E0547A23831d6D1dCF661C9 |
| NFT Descriptor Library Module | 0x705d1A9D06a15a4Fa1585355F1bcABd0c6F41c94 |
| Swap Router                   | 0x23E3Bfb6f59EBFAA5c11a484C2306e3d791827fC |
| QuoterV2                      | 0x35C36CaC9E8da91e6CbC265528661cb52AD67Fdb |

### v2 Pools

| Factory     | 0x4B6AC7503d3FD79CE23D7AE463D14aAAF07F6573 |
| ----------- | ------------------------------------------ |
| Swap Router | 0x73aA777fF372A812cf98b9CD7B744567Ce094453 |
| Staker      | 0x6646E5256b8Cd30D0E68Aa6765519c91177F724f |


# Audits

Security audit was done by [Bailsec](https://bailsec.io/).

You can find our results [here](https://github.com/bailsec/BailSec/blob/main/Bailsec%20-%20Hypertrade%20-%20V3%20Core%20-%20Final%20Report.pdf)


# Hypertrade R2 Overview

Hypertrade R2 Aggregator is a DEX aggregator on Hyperliquid with full support for HyperCore and HyperEVM routing. R2 is the rebuilt generation of the router with improved routing logic. It uses our internal simulation engine to evaluate routes and secure the best executable rate across all liquidity sources, returning a quote on 100% of requests at a 292ms median latency.

R2 optimizes each trade by scanning every available DEX on HyperEVM as well as HyperCore Spot. The router evaluates Hypertrade DEX liquidity alongside all other venues and splits orders across multiple exchanges (multi-market) and multiple intermediate tokens (multi-hop) to secure the best available execution.

Hypertrade R2 currently supports the widest set of liquidity sources on Hyperliquid:

* HyperCore Spot&#x20;
* Hypertrade DEX (v2, v3)
* Hyperswap (v2, v3)
* ProjectX
* Hybra (v3)
* Kittenswap (v3)
* Ramses (v3)
* UltraSolid
* Nest


# API

The Hypertrade Aggregator API provides a unified interface for accessing Hypertrade R2 routing, quote simulation, and transaction construction. It is designed for integrations that require the best execution across all available liquidity sources on Hyperliquid.

The Aggregator API operates in two modes:

* EVM Hyper API
* EVM+CORE Hyper API

Both modes use our internal simulation engine for accurate route evaluation.

#### Aggregator API Overview

The Aggregator API computes the most efficient routing path for every swap by evaluating all available liquidity sources.

It scans:

* Hypertrade DEX pools (both v2 and v3)
* External HyperEVM DEXs
* HyperCore Spot liquidity

The API performs a full set of calculations required for optimal execution:

Quote simulations: Estimates output amounts across different liquidity sources and routes.

Slippage and price impact evaluation: Determines how trade size and pool depth affect execution quality.

Raw transaction construction: Builds the final transaction payload that can be submitted on-chain for execution.

The routing logic is fully deterministic and transparent — the same inputs always produce the same route, and every step of the calculation can be inspected and verified.

### When to Use EVM Hyper API

Use the EVM Hyper API when your integration operates exclusively inside HyperEVM.

In this mode, the API:

* aggregates liquidity across supported HyperEVM DEXs
* simulates quotes and evaluates slippage
* computes final output amounts and price impact
* constructs executable transaction payloads
* handles token approval flows
* provides ready-to-use integration templates

Routing is strictly contained within HyperEVM, making this mode suitable for applications that do not require cross-environment swaps.

#### When to Use EVM+CORE Hyper API

Use the EVM+CORE Hyper API when you need to route swaps between HyperEVM and HyperCore.

This mode includes all EVM API capabilities, plus:

* routing between HyperEVM ↔ HyperCore
* paths that may start and end in different environments
* optional hybrid sequences such as:
  * HyperEVM → HyperCore → HyperEVM
  * HyperCore → HyperEVM → HyperCore
* access to HyperCore Spot liquidity for improved execution quality

Hybrid routing can be enabled or disabled via configuration parameters, depending on integration requirements.

#### Implementation Details

Aggregator API endpoints provide:

* quote simulation
* price impact metrics
* multi-hop and multi-market route breakdown
* raw transaction construction
* routing mode configuration

For more implementation details, refer to the API Documentation or Integration Guide.


# 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_in` → `tokenIn`
* `amount_out` → `amountOut`
* `created_at` → `createdAt`

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

```json
{
  "tokens": {
    "0xb88339cb7199b77e23db6e890353e22632ba630f": {
      "symbol": "USDC",
      "name": "USDC",
      "address": "0xb88339cb7199b77e23db6e890353e22632ba630f",
      "decimals": 6,
      "logoURI": "https://assets.coingecko.com/coins/images/6319/standard/usdc.png",
      "coinId": "0xb88339cb7199b77e23db6e890353e22632ba630f_USDC",
      "price": "1.001753841",
      "type": "evm",
      "volumeUsd24": "0.000000"
    },
    "0x0d01dc56dcaaca66ad901c959b4011ec": {
      "symbol": "HYPE",
      "name": "Hyperliquid",
      "address": "0x0d01dc56dcaaca66ad901c959b4011ec",
      "decimals": 8,
      "logoURI": "https://coin-images.coingecko.com/coins/images/50882/small/hyperliquid.jpg",
      "coinId": "0x0d01dc56dcaaca66ad901c959b4011ec",
      "price": "36.229",
      "evmAddress": "0x0000000000000000000000000000000000000000",
      "coinIndex": 150,
      "coinTo": "0x54e00a5988577cb0b0c9ab0cb6ef7f4b",
      "type": "core",
      "volumeUsd24": "37753946.74"
    }
  }
}
```

### 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

```http
GET /api/v1/trade/quote?src=0x0000000000000000000000000000000000000000&dst=0xeb62eee3685fc5bb2b0d35c4c92609101426cdee&receiver=0x21f1cd2E4c1e50A684Ae75a76576c53b1A5D6876&amount=1000000000000000000&slippage=0.3
```

### Successful Response

```json
{
  "srcToken": {
    "symbol": "WHYPE",
    "name": "Wrapped HYPE",
    "address": "0x0000000000000000000000000000000000000000",
    "decimals": 18,
    "logoURI": "https://example.com/whype.png"
  },
  "dstToken": {
    "symbol": "USDC",
    "name": "USD Coin",
    "address": "0xeb62eee3685fc5bb2b0d35c4c92609101426cdee",
    "decimals": 6,
    "logoURI": "https://example.com/usdc.png"
  },
  "toAmount": "25.123456",
  "protocols": [
    {
      "inputTokenAddress": "0x000...000",
      "outputTokenAddress": "0xeb6...dee",
      "splits": [
        {
          "dex": "HyperSwap",
          "portion": 1.0,
          "fee": 3000,
          "poolAddress": "0x..."
        }
      ]
    }
  ],
  "gas": 0,
  "action": "evm",
  "routeCore": {
    "path": [],
    "pathIndexes": []
  },
  "economy": "0.5",
  "fee": "0.25"
}
```

### Error Response

```json
{
  "error": "src and dst tokens must be different",
  "statusCode": 400
}
```

### 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

<table><thead><tr><th>Parameter</th><th>Type</th><th width="159">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>src</code></td><td><code>string</code></td><td>Yes</td><td>Source token address.</td></tr><tr><td><code>dst</code></td><td><code>string</code></td><td>Yes</td><td>Destination token address.</td></tr><tr><td><code>amount</code></td><td><code>string</code></td><td>Yes</td><td>Input token amount in the smallest token unit.</td></tr><tr><td><code>slippage</code></td><td><code>number</code></td><td>Yes</td><td>Maximum slippage tolerance. Allowed range: <code>0.01</code> to <code>20</code>.</td></tr><tr><td><code>from</code></td><td><code>string</code></td><td>Yes</td><td>Sender wallet address.</td></tr><tr><td><code>receiver</code></td><td><code>string</code></td><td>No</td><td>Recipient wallet address. Default: zero address.</td></tr><tr><td><code>referrerAddress</code></td><td><code>string</code></td><td>No</td><td>Referrer wallet address for fee sharing.</td></tr><tr><td><code>fee</code></td><td><code>number</code></td><td>No</td><td>Integration fee in basis points.</td></tr><tr><td><code>includeHyperCore</code></td><td><code>boolean</code></td><td>No</td><td>Enables Hyperliquid Core routing. Default: <code>false</code>.</td></tr><tr><td><code>onlyOurDex</code></td><td><code>boolean</code></td><td>No</td><td>Routes only through Hypertrade DEX. Default: <code>false</code>.</td></tr><tr><td><code>integrator_id</code></td><td><code>string</code></td><td>No</td><td>Name of the API integrator, who uses API.</td></tr></tbody></table>

### Example Request

```http
GET /api/v1/trade/swap?src=0x0000000000000000000000000000000000000000&dst=0xeb62eee3685fc5bb2b0d35c4c92609101426cdee&amount=1000000000000000000&slippage=0.3&from=0x82Cbe7fCeEdBB2efa107Afc91184937De0d703c3
```

### Successful Response

```json
{
  "srcToken": {
    "symbol": "WHYPE",
    "name": "Wrapped HYPE",
    "address": "0x0000000000000000000000000000000000000000",
    "decimals": 18,
    "logoURI": "https://example.com/whype.png"
  },
  "dstToken": {
    "symbol": "USDC",
    "name": "USD Coin",
    "address": "0xeb62eee3685fc5bb2b0d35c4c92609101426cdee",
    "decimals": 6,
    "logoURI": "https://example.com/usdc.png"
  },
  "toAmount": "25.123456",
  "tx": {
    "from": "0x82cbe7fceedbb2efa107afc91184937de0d703c3",
    "to": "0xe4609ab5F4c268C42BA470FbCBB9b9aBF895f1a5",
    "data": "0xabc123...calldata",
    "value": "1000000000000000000",
    "gas": 0
  },
  "protocols": [],
  "action": "evm",
  "routeCore": {
    "path": [],
    "pathIndexes": []
  },
  "swap": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "wallet": "0x82cbe7fceedbb2efa107afc91184937de0d703c3",
    "recipient": "0x0000000000000000000000000000000000000000",
    "tokenIn": "0x0000000000000000000000000000000000000000",
    "tokenOut": "0xeb62eee3685fc5bb2b0d35c4c92609101426cdee",
    "amountIn": "1000000000000000000",
    "amountOut": "25.123456",
    "status": "pending",
    "usdAmount": "25.12",
    "feeGas": "0.01",
    "depositEvmTxHash": "",
    "depositCoreTxHash": "",
    "slippage": 0.3,
    "integrationFeeAddress": "0x0000000000000000000000000000000000000000",
    "integrationFeeBps": 0,
    "route": "evm",
    "onlyOurDex": 0,
    "createdAt": "2026-04-06T12:00:00Z",
    "updatedAt": "2026-04-06T12:00:00Z"
  }
}
```

### 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

```http
GET /api/v1/trade/swap/status?id=550e8400-e29b-41d4-a716-446655440000&wallet=0x82Cbe7fCeEdBB2efa107Afc91184937De0d703c3
```

### Successful Response

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "wallet": "0x82cbe7fceedbb2efa107afc91184937de0d703c3",
  "recipient": "0x0000000000000000000000000000000000000000",
  "tokenIn": "0x0000000000000000000000000000000000000000",
  "tokenOut": "0xeb62eee3685fc5bb2b0d35c4c92609101426cdee",
  "amountIn": "1000000000000000000",
  "amountOut": "25.123456",
  "status": "completed",
  "usdAmount": "25.12",
  "feeGas": "0.01",
  "depositEvmTxHash": "0xabc123...",
  "depositCoreTxHash": "",
  "slippage": 0.3,
  "integrationFeeAddress": "0x0000000000000000000000000000000000000000",
  "integrationFeeBps": 0,
  "route": "evm",
  "onlyOurDex": 0,
  "createdAt": "2026-04-06T12:00:00Z",
  "updatedAt": "2026-04-06T12:01:00Z"
}
```

### 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

```http
GET /api/v1/trade/swap/history?status=5&offset=1&size=10
Authorization: Bearer <jwt_token>
```

### Successful Response

```json
{
  "swaps": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "wallet": "0x82cbe7fceedbb2efa107afc91184937de0d703c3",
      "tokenIn": "0x0000000000000000000000000000000000000000",
      "tokenOut": "0xeb62eee3685fc5bb2b0d35c4c92609101426cdee",
      "amountIn": "1000000000000000000",
      "amountOut": "25.123456",
      "status": "completed",
      "route": "evm",
      "createdAt": "2026-04-06T12:00:00Z",
      "updatedAt": "2026-04-06T12:01:00Z"
    }
  ],
  "totalCount": 42
}
```

### 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

```http
GET /api/v1/trade/swap/cancel?id=550e8400-e29b-41d4-a716-446655440000&wallet=0x82Cbe7fCeEdBB2efa107Afc91184937De0d703c3
```

### Successful Response

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "wallet": "0x82cbe7fceedbb2efa107afc91184937de0d703c3",
  "status": "cancelled",
  "createdAt": "2026-04-06T12:00:00Z",
  "updatedAt": "2026-04-06T12:05:00Z"
}
```

### 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 /getSwapInfo` → `GET /quote`

Changes:

* `inputTokenAddress` → `src`
* `outputTokenAddress` → `dst`
* `inputAmount` → `amount`
* `feeAddress` → `referrerAddress`
* `feeBps` → `fee`
* `enableHyperCore` → `includeHyperCore`

### `POST /swap` → `GET /swap`

Changes:

* same parameter renames as above
* `userAddress` → `from`
* `recipientAddress` → `receiver`

### `GET /getTokens` → `GET /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_count` → `totalCount`

### `GET /closeSwapById?id=...&wallet=...` → `GET /swap/cancel?id=...&wallet=...`

Changes:

* response fields renamed to camelCase


# Aggregator Fees

#### No standard fee

Hypertrade Aggregator does not add a platform fee to your swap. There is no percentage taken from your input amount and no markup added to the route. The quote you see is built from the raw liquidity of the venues in the route.

#### Execution surplus

A swap is quoted at a minimum expected output based on current liquidity. By the time the transaction executes onchain, conditions can move in your favor, and the swap can return more than the quoted minimum. This difference is called execution surplus, also known as positive slippage.

At this stage, the protocol retains 100% of execution surplus. You always receive at least the quoted minimum output for your slippage setting. Surplus retention applies only to the upside beyond the quote, never to the quoted amount itself.

This policy funds the development and operation of the router and may change in future stages. Any change will be reflected on this page.

#### Integration fees

Apps and protocols that integrate the Aggregator API can attach their own fee to swaps routed through their integration using the fee parameter (in basis points) and `referrerAddress`. This fee is set by the integrator, not by Hypertrade, and is shown in the API response.

#### What you pay in total

* Venue fees: each DEX pool in the route charges its own swap fee (for example, 0.30% on V2-style pools). These are venue fees, not Hypertrade fees, and they are already reflected in your quote.
* Network gas: standard HyperEVM transaction costs.
* Hypertrade fee: none added to the quoted amount. Execution surplus above the quote is currently retained by the protocol.

<br>

<br>

<br>


# Hypertrade Points Program

The Hypertrade Points Program rewards active community members who contribute to the ecosystem.

### How to Earn Points

Points come from three sources:

* Providing liquidity to Hypertrade V2 or V3 pools
* Swapping through the Hypertrade Aggregator
* Referring new users and earning a share of the points they generate

Scoring is based on the fees your activity generates, not on capital parked in a pool. Active flow earns points. Idle TVL does not.

### Distribution

Points are calculated automatically and updated regularly based on your activity.

### Boosts & Multipliers

Certain activities may receive boosted points. Boosts are dynamic and may vary based on protocol needs.

### Fair Distribution

Hypertrade employs Sybil detection to ensure points go to genuine users. Addresses engaging in farming abuse may be disqualified.

### Rewards

Stage 1 rewards accrue in HYPE. There is no Hypertrade token to buy or stake, and points are not a token. Point totals determine relative shares of the Stage 1 rewards pool. The size of the pool and individual allocations are not fixed in advance.

### Daily Cap

Stage 1 has a daily cap of 700K points across the program. The cap exists so that no single wallet or burst of activity can take over the leaderboard in a day. Points accrue from genuine activity within that limit.

### Stage 1

Stage 1 runs from June 10 to September 10, 2026.

### Multipliers

Multipliers stack up to a 1.45x cap:

* Early Believer: 1.25x
* Eligible NFT collections: up to 1.08x (Hypurr, Hypio, PiP, Catbal/Illumeownati, Hypers, tinyhypercats)
* Leagues: up to 1.12x

### Leagues

League placement is based on your leaderboard position:

* Diamond: 1–10
* Platinum: 11–30
* Gold: 31–100
* Silver: 101–300
* Bronze: 301–500
* Wood: 501+


# Referrals & Handles

How do I refer someone to Hypertrade?

Go to [referrals page](https://ht.xyz/referrals) to create your handle and get your referral link. Share it with friends – anyone who joins through your link will be recorded as your referral.

You earn a percentage of the points generated by your referrals.

How do I use a referral handle?

Enter a handle at [referrals page](https://ht.xyz/referrals) or use a friend's referral link directly.


# Risks Overview

### Smart Contract Risk

While Hypertrade smart contracts are designed with security in mind and undergo audits, no smart contract can be guaranteed to be completely free of vulnerabilities. Users should only deposit funds they can afford to lose.

### Impermanent Loss

Liquidity providers are exposed to impermanent loss when the price ratio of deposited tokens changes compared to when they were deposited. This is especially relevant for v3 concentrated liquidity positions with narrow price ranges.

### Slippage Risk

Large trades relative to pool liquidity may experience significant slippage. Always check the expected output amount and price impact before confirming a swap.

### Market Risk

Token prices can be volatile. The value of your assets may decrease significantly in a short period of time.


# Our Links

### Hypertrade

[Website](https://ht.xyz/)

[Twitter](https://x.com/HypertradeX)

### Qwerty (Team)

[Website](https://qwerty.com/)

[Twitter](https://x.com/qwerty_hl)


# Frequently asked questions

1. **What is Hypertrade?**\
   Hypertrade is a native on-chain DEX (v2 + v3) and the only DEX aggregator on Hyperliquid that supports both HyperCore and HyperEVM.
2. **What are the fees on Hypertrade DEX?**\
   V3 pools: fee tiers from 0.01% to 0.30%. LPs get 86%, **protocol gets 14%.** V2 pools: fixed 0.30% fee split 0.25% to LPs and 0.05% to protocol.
3. **Does Hypertrade DEX Aggregator charge fees?**\
   There is no standard aggregator fee added to your swap. When a swap executes at a better price than quoted, the difference (execution surplus) is currently retained by the protocol. See the Fees page in the Aggregator section for details.
4. **How do I earn Hypertrade Points?**\
   By providing liquidity, swapping through the aggregator, and referring new users. Scoring is based on the fees your activity generates. Stage 1 runs June 10 – September 10, 2026, with a 700K daily points cap.
5. **How is Hypertrade R2 different from other aggregators?**\
   Hypertrade R2 is the only aggregator that supports any-to-any routing across HyperCore and HyperEVM, including HyperCore Spot.
6. **Can I integrate Hypertrade R2 into my own dApp?**\
   Yes. Use the Aggregator API and choose between EVM-only or EVM+CORE routing. The API returns ready-to-execute transactions and accurate quotes.
7. **Which liquidity sources does Hypertrade R2 use?**\
   HyperCore Spot, Hypertrade DEX, Hyperswap, ProjectX, Valantis, Hybra, Kittenswap, Ramses, Curve, Laminar, Gliquid, HyperCat, UltraSolid.
8. **What is the difference between Hypertrade DEX and the aggregator?**\
   Hypertrade DEX is the AMM (v3 concentrated liquidity + v2) where swaps and liquidity provision happen. Hypertrade R2 is the routing engine that finds the best execution across all DEXs.
9. **Is Hypertrade non-custodial?**\
   Yes. Hypertrade is fully non-custodial and permissionless. All operations happen directly on-chain without intermediaries.


# Brand Assets

{% file src="/files/kZAGFEhfdvBrUUcIFFqa" %}


