# About LN Exchange

First Orderbook on Lightning Network

### What is LN Exchange?

{% embed url="<https://youtu.be/CaSe_5i169A?si=TWWk4H-xAd-2uHcg>" %}

**The first Orderbook on Lightning Network**, LN Exchange is a vertically integrated, decentralized trading powerhouse featuring **peer-to-peer,** **spot**, and **perpetual orderbook** trading for Bitcoins and Taproot Assets.

LN Exchange is powered by [Lnfi Network](https://www.lnfi.network), a financialization layer that brings tokenisation and web3 to Lightning Network. It unifies open standards and network economies - Bitcoin network, Lightning Network, Taproot Assets, and the Nostr protocol.

* Bitcoin network provides the battle-tested security for Bitcoin and issuance of Taproot Assets (alternative assets/tokens issued on Bitcoin).
* Lightning Network serves as the global, instant settlement network at zero/low fees.
* The Nostr protocol acts as the messaging layer, and specifically for our project, it enables users to submit their bid and ask orders to LN Exchange for order matching and execution, facilitating efficient trading processes.

### 💫What is LN Exchange’s mission?

LN Exchange aims to be the one-stop decentralised trading powerhouse that enables anyone to trade crypto with full transparency, low costs, and the best execution.

The team believes in democratized access to markets with hybrid custody.

Ultimately, the goal is for all traders to view LN Exchange as the go-to exchange to trade Bitcoin and Taproot Assets.

***

### 🔆Features of LN Exchange

#### ✅**Powerful**

Our platform is designed for best-in-class speed, liquidity, and price. With advanced technology and robust infrastructure, LN Exchange delivers the speed and reliability you expect from a professional trading platform.

#### ✅**One-stop trading powerhouse**

LN Exchange is your ultimate destination for all your trading needs, offering a comprehensive suite of services for both spot and perpetual trading of Bitcoins and Taproot assets.

#### ✅0 Gas with low competitive fees.

At LN Exchange, we prioritize affordability and accessibility for all traders. With our platform, you can say goodbye to gas fees commonly associated with decentralized exchanges.

By leveraging the Lightning Network's efficient payment channels and Nostr, we eliminate the need for gas fees, ensuring that your trading experience remains cost-effective.

#### ✅**Transparency**

At LN Exchange, we prioritize transparency and accountability in every aspect of our platform. With our built-in Explorer feature, all users' actions are fully trackable, providing a transparent view of the trading activity on our platform.

The Explorer allows users to monitor and track transactions in real time, providing insights into trading volumes, order book activity, and user interactions.

***

### Why Lightning Network?

In 2018, developers Joseph Poon and Thaddeus Dryja unveiled the Lightning Network, a groundbreaking solution that has transformed the landscape of digital finance. Operating as a layer atop the Bitcoin blockchain, the Lightning Network addresses critical issues related to transaction speed and cost, ushering in a new era of instant, global settlement.

### 🔆Key Features

#### ⚡Instantaneous Transactions

Lightning Network settlements occur instantly, providing rapid transaction confirmations, unlike the traditional Bitcoin blockchain.

#### ⚡Cost-Effectiveness

With Lightning, payments of any size, including sub-1 cent micropayments, are possible. This opens up new possibilities for global commerce and supports innovative payment models like streaming services.

#### ⚡**Privacy-Focused**

The Lightning Network employs peer-to-peer onion routing, ensuring that transaction paths are private, with each hop knowing only the next hop and nothing beyond that.

#### ⚡**Open-Access**

Lightning operates as an open and permissionless network, allowing anyone to utilize its services. This stands in contrast to most other USD payment networks, which operate as closed ecosystems.

#### ⚡**Risk-Free**

Lightning settles transactions directly in Bitcoin without any counterparty risk or reliance on third-party trust, making it a secure payment network.

#### ⚡Simplified Experience

All technical complexities, such as underlying hashing algorithms, are abstracted away from end users, providing a seamless and user-friendly experience.

> Today, the Lightning Network enables almost free and instant payments worldwide using Bitcoin denominations known as satoshis. It is accessible to all, regardless of location or financial status, and has the potential to revolutionize Internet commerce by welcoming billions of new users and enabling countless new use cases. And, Lnfi Network leverages Lightning Network for settlements.

***

### Why Nostr protocol?

Lnfi Network is at the forefront of leveraging the innovative Nostr protocol to empower decentralized applications across various domains. Nostr offers a unique middle ground between traditional internet architectures and fully decentralized stack, facilitating seamless connectivity and data portability.

With its streamlined approach and decentralized network of relays, Nostr enables applications to transcend limitations commonly encountered on blockchain-based systems.

> At the core of our platform is the interoperability provided by Nostr. Users can seamlessly transition between different applications while retaining their identity and data. Whether it's social media, job searching, dating, or any other domain, our platform ensures a smooth user experience across the board.

Through the utilization of Nostr, LN Exchange has addressed a significant limitation of the Lightning Network, which is hindered by a lack of transparency in transactions. By broadcasting all users' actions onto Nostr, these actions are recorded as Nostr events, which can then be indexed into an explorer. This enables data to be fully trackable, transparent, and resistant to tampering.

***

### Why Taproot Assets?

Taproot assets represent a notable addition to the various token standard in the cryptocurrency ecosystem.

The Taproot Assets Protocol, developed by Lightning Labs, significantly advances on-chain protocols. It facilitates the implementation of fungible and non-fungible tokens (Collectibles) and alternative coins with unprecedented efficiency and cost-effectiveness.

The protocol's brilliance lies in its utilization of Schnorr signatures and Merkle trees, which provide enhanced security and sophistication to digital assets while keeping on-chain footprint and transaction costs low.

What sets Taproot Assets apart is its dual-layer approach, which utilizes both Bitcoin's base layer and the Layer 2 Lightning Network. It inherits the security properties of Bitcoin and leverages the 1M TPS speed on the Lightning Network.


# P2P & Spot

### ⚡️Peer-to-Peer (P2P) Marketplace

LN Exchange provides a peer-to-peer marketplace where users can directly trade with each other, eliminating the need for intermediaries and allowing for fast and efficient transactions. Whether you're buying, selling, or exchanging assets, our platform ensures a seamless experience with instant settlements. The P2P Marketplace currently sits on [Lnfi Network](https://www.lnfi.network) and will be migrated to LN Exchange at a later stage.

### ⚡️Spot Orderbook

With LN Exchange, users can access spot orderbook functionalities, providing flexibility and diversity in trading strategies.&#x20;

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FuKhB0BzNzJyyz6N2q04g%2Fimage.png?alt=media&amp;token=2f1b22aa-d18e-4203-8cfc-1e10cf07a005" alt=""><figcaption></figcaption></figure>

While both the P2P Marketplace and Spot Orderbook are aimed at trading spots, their differences are set out below:

| Type                                | P2P Marketplace                                                                                         | Spot Orderbook                |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------- |
| Mechanism                           | Peer-to-peer                                                                                            | Orderbook                     |
| Listing                             | Permissionless (future)                                                                                 | Permissioned                  |
| Expected liquidity of trading pairs | Low                                                                                                     | High                          |
| Types of assets                     | <p>Fungible assets</p><p>Non-fungible assets (NFTs/Collectibles)<br>(to be supported in the future)</p> | Fungible (Tokens) assets only |

With our innovative platform, you can trade with confidence, knowing that you have access to cutting-edge technology, high-performance trading, and the support of a dedicated team.


# Perpetual

At LN Exchange, you can trade two types of perpetual contracts: **USDT-margined** and **ALTCOIN-margined**.&#x20;

These contracts allow you to trade on the price movements of crypto assets like Bitcoin, with or without leverage, and without an expiration date.

***

## USDT-M Perpetual Contracts

{% hint style="success" %}
Also known as **Linear Pepertual**
{% endhint %}

In **USDT-margined** perpetual contracts, you use USDT as collateral. This means your profit and loss (PnL) is also settled in USDT. It’s a simple type of contract, where everything — from the collateral to the payout — is in USDT. This makes it easy to track how much you’ve gained or lost based on the price of the asset in USDT.

{% hint style="info" %}
**Example**: You trade a BTC-USDT perpetual contract using USDT as collateral.&#x20;

If Bitcoin goes up and you’re in a long position, your profit is settled in USDT. \
If the price goes down and you’re in a short position, your loss is also calculated in USDT.
{% endhint %}

***

## ALTCOIN-M Perpetual Contracts

{% hint style="success" %}
Also known as **Quanto Perpetual**
{% endhint %}

In **ALTCOIN-margined** perpetual contracts, you use an ALTCOIN (like LN) as collateral, but you’re still trading contracts based on the price of another asset like Bitcoin (in USDT). The unique thing is that even though the trade is based on Bitcoin’s price in USDT, your profit or loss is settled in the ALTCOIN you used as collateral.

This setup allows you to use other cryptocurrencies to trade, without worrying about how the collateral’s price changes during the trade.

{% hint style="info" %}
**Example**: You open a LN-BTC-USDT contract. LN is used as the collateral. \
\
Your profit or loss will be settled in LN based on how Bitcoin’s price moves in USDT, but you don't have to worry about LN's price fluctuations during the trade.
{% endhint %}

Let’s break this down with a simple example:

#### Scenario:

You open a LN-BTC-USDT perpetual contract where the notional size is based on BTC.

* Underlying Asset: BTC
* Settlement or Collateral Currency: LN
* Bitcoin Multiplier or Contract Size = 0.01 (varies by the underlying asset & settlement or collateral currency)
* 1 contract size = 0.01 BTC or ( 0.01 × BTC price ) LN
* You enter a long position on BTC when BTC = 50,000 USDT.
* At the time of opening the trade, 1 LN = 1 USDT, so the contract size in LN is 0.01 × 50,000 = 500 LN per contract.&#x20;

#### After the Trade:

* BTC’s price increases from 50,000 USDT to 60,000 USDT (a 20% increase).

#### Calculating Profit:

* **Contract Size in LN:** At the new BTC price of 60,000 USDT, the contract size in LN changes to: 0.01 × 60,000 = 600 LN per contract.&#x20;
* **Profit in BURGER:** Your profit is based on the increase in the contract size in LN due to the BTC price change: \
  PnL in LN = ( New contract size − Old contract size ) × Number of Contracts. \
  PnL in LN = ( New contract size−Old contract size ) × Number of Contracts. \
  \
  If you have 1 contract, the PnL would be:

  PnL in LN = ( 600 − 500 ) = 100 LN.&#x20;

Thus, with the 0.01 BTC multiplier, and given the 10,000 USDT increase in BTC price, your profit would be 100 LN per contract. If you hold multiple contracts, this profit scales accordingly.

#### Why LN Price Doesn’t Matter During the Trade:

* Even if LN's price fluctuates during the trade, the calculation of profit or loss is always based on **BTC’s price in USDT**.

***

## Key Benefits

<table><thead><tr><th width="246">Benefits</th><th>USDT-M Contracts</th><th>ALTCOIN-M Contracts</th></tr></thead><tbody><tr><td>Collateral</td><td>USDT</td><td>ALTCOIN</td></tr><tr><td>Max Leverage</td><td>20X - 100X</td><td>20X</td></tr><tr><td>Transparent PnL</td><td>PnL tied to COIN price, settled in USDT</td><td>PnL tied to COIN price, settled in ALTCOIN</td></tr><tr><td>Risk from Collateral Volatility</td><td>No risk of liquidation from USDT depeg.</td><td>No liquidation risk from ALTCOIN price fluctuations.</td></tr><tr><td>Expiration</td><td>No expiry</td><td>No expiry</td></tr></tbody></table>

***

{% hint style="info" %}
When engaging in perpetual contract trading, traders must grasp several mechanics of the futures market.
{% endhint %}

## Key components traders should understand

#### ⚡**Multiplier**

This indicates the value of one contract. You can find this information in the Contract Specifications for each instrument.

#### ⚡**Position Marking**

Perpetual contracts follow the Fair Price Marking method. The mark price determines Unrealised Profit and Loss (PNL) as well as liquidations.

#### ⚡**Initial and Maintenance Margin**

These margins are pivotal as they determine the level of leverage available for trading and the threshold for liquidation.

#### ⚡Funding

Funding occurs every 8 hours. Any position held in a perpetual swap during this period will either pay or receive funding. Traders can monitor the current funding rate for a contract in the "Contract Details" section at the bottom left of the Trade tab. Additionally, historical rates can be found in the Funding History or in the individual "Contract Specifications".

#### ⚡Symbol

A symbol in trading identifies a specific financial instrument, combining both a base currency and a quote currency. BTC/USD indicates the price of one Bitcoin quoted in US dollars.

<figure><img src="https://lh7-us.googleusercontent.com/Lqnjuj-tCSWoQSUp3dfmP2WnShgIKWPfsfQ5vaMiqzMc7eKAGmRGLCHruDCzuwzIe1d2qozOm2AOtmBAGNhgw__6WuJhw5FxfucS2yAUBY-rv-I7wHWi1v0cUSkBxUsE8V0owCfosREqQE9_V4A98bQ" alt=""><figcaption></figcaption></figure>

Understanding these components is essential for effective and informed trading in perpetual contracts. Below outlines the comparison of the three support payout types:

<table data-full-width="false"><thead><tr><th>Payout Type</th><th>Linear (USDT-M)</th><th>Quanto (ALTCOIN-M)</th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>The price of a linear contract is expressed as the price of the underlying against the base currency.</td><td><p>A quanto contract is a derivative instrument where the underlying asset is denominated in one currency (COIN), but the contract itself is settled in another currency (COIN2) at a predetermined rate.</p><p><br></p><p>These contracts are structured to simplify trading and comprehension. However, it's important to note that when trading Quanto Perpetuals, your underlying margin and Profit and Loss (PNL) are denominated in COIN2. Despite the underlying and quote currencies not being COIN2, traders are still exposed to COIN/USD price risk.</p></td></tr><tr><td><strong>Who is it for?</strong></td><td>Traders who seek to take either long or short positions on COIN relative to USDT.</td><td>Traders who seek exposure to other COIN in dollars relative to COIN2.</td></tr><tr><td><strong>Price / Symbol</strong></td><td>COINUSDT</td><td>COINUSD</td></tr><tr><td><strong>Underlying</strong></td><td>COINUSDT</td><td>COINUSD</td></tr><tr><td><strong>Quote Currency</strong></td><td>USDT</td><td>USD</td></tr><tr><td><strong>Examples</strong></td><td>BTCUSDT</td><td>BTCUSD</td></tr><tr><td><strong>Multiplier / Contract Size</strong><br><strong>(could be in smaller or bigger sizes than 1 COIN or 1 USD)</strong></td><td>USDT per COIN</td><td>COIN2 per 1 USD</td></tr><tr><td><strong>COIN Value per contract</strong></td><td>Price * Multiplier</td><td>USD Value / COINUSDT Price</td></tr><tr><td><strong>COIN2 Value per contract</strong></td><td>-</td><td>COINUSD Price * COIN2 Multiplier</td></tr><tr><td><strong>USDT or USD Value per contract</strong></td><td>Price * Multiplier</td><td>COIN2 Value * COIN2 Spot Price</td></tr><tr><td><strong>Margin / PnL Currency</strong><br><br><strong>PnL Calculation</strong></td><td>Quote Currency or USDT<br><br># Contracts * Multiplier * (Exit Price - Entry Price)</td><td>COIN2<br><br># Contracts * Multiplier (in COIN2) * (COINUSD Exit Price - COINUSD Entry Price) </td></tr></tbody></table>


# Margining

Opening a contract position requires a certain amount of margin, and margin trading provides greater leverage for your contracts.

* **Initial Margin:**\
  The minimum margin required for opening a position.\
  Initial margin ratio = 1/leverage.\
  Initial margin = (Contract Quantity × Order Price × Multiplier​) / Leverage
* **Maintenance Margin Ratio:**\
  Maintenance Margin is the minimum amount of margin a trader must maintain in their position or account to continue holding a position. When unrealized losses cause the position margin in a position or account to fall below the required maintenance margin level, liquidation will be triggered.

***

## USDT-Margined Contracts Overview

**Margin**

All varieties of USDT Perpetual contracts use USDT as the collateral asset. Users only need to hold USDT to participate in trading various contract types.

**Pricing Unit**

The USDT Perpetual contracts are denominated in USDT.

**Contract Value**

The value of each USDT perpetual contract corresponds to the underlying asset. For instance, in the BTC/USDT contract, the contract value is 0.001 BTC.

**Profit and Loss Currency**

All varieties of USDT Perpetual contracts calculate profits and losses in USDT.

**Contract Specifications**

| **Trading Pair** | **Contract Value** | **Collateral Currency** | **Maximum Leverage** | **Maintenance Margin Rate** |
| ---------------- | ------------------ | ----------------------- | -------------------- | --------------------------- |
| BTC-USDT         | 0.001 BTC          | USDT                    | 20X                  | 2.5-50.0%                   |

*\*May be adjusted in the future.*

### Position Limits and Maintenance Margin Rates\*

**Main Zone USDT-Margined Contracts**\
Established assets with deep liquidity.

* BTC-USDT, ETH-USDT, SOL-USDT

<table data-full-width="true"><thead><tr><th width="82">Tier</th><th width="128">Lower Limit</th><th width="128">Upper Limit </th><th width="144">Max Leverage</th><th width="86">MMD</th><th>Maintenance Amount (USDT)</th></tr></thead><tbody><tr><td>1</td><td>0</td><td>50,000</td><td>20x</td><td>0.5%</td><td>0</td></tr><tr><td>2</td><td>50,000</td><td>100,000</td><td>20x</td><td>1.0%</td><td>250</td></tr><tr><td>3</td><td>100,000</td><td>200,000</td><td>20x</td><td>2.0%</td><td>1,250</td></tr><tr><td>4</td><td>200,000</td><td>250,000</td><td>20x</td><td>2.5%</td><td>2,250</td></tr><tr><td>5</td><td>250,000</td><td>500,000</td><td>10x</td><td>5.0%</td><td>8,500</td></tr><tr><td>6</td><td>500,000</td><td>1,000,000</td><td>5x</td><td>10.0%</td><td>33,500</td></tr><tr><td>7</td><td>1,000,000</td><td>1,250,000</td><td>4x</td><td>12.5%</td><td>58,500</td></tr><tr><td>8</td><td>1,250,000</td><td>2,500,000</td><td>2x</td><td>25%</td><td>214,750</td></tr><tr><td>9</td><td>2,500,000</td><td>5,000,000</td><td>1x</td><td>50%</td><td>839,750</td></tr></tbody></table>

**Frontier Zone USDT-Margined Contracts**\
Emerging markets with high volatility and growth potential.

<table data-full-width="true"><thead><tr><th width="82">Tier</th><th width="128">Lower Limit</th><th width="128">Upper Limit </th><th width="144">Max Leverage</th><th width="86">MMD</th><th>Maintenance Amount (USDT)</th></tr></thead><tbody><tr><td>1</td><td>0</td><td>25,000</td><td>20x</td><td>2.5%</td><td>0</td></tr><tr><td>2</td><td>20,000</td><td>200,000</td><td>10x</td><td>5%</td><td>625</td></tr><tr><td>3</td><td>200,000</td><td>500,000</td><td>5x</td><td>10%</td><td>10,625</td></tr><tr><td>4</td><td>500,000</td><td>750,000</td><td>4x</td><td>12.5%</td><td>23,125</td></tr><tr><td>5</td><td>750,000</td><td>1,500,000</td><td>2x</td><td>25%</td><td>116,875</td></tr><tr><td>6</td><td>1,500,000</td><td>3,000,000</td><td>1x</td><td>50%</td><td>491,875</td></tr></tbody></table>

*\*May be adjusted in the future.*

### Margin and Profit/Loss Calculation

**Initial Margin**

In USDT Perpetual contracts, the Initial Margin is calculated using the order value multiplied by the Initial Margin rate. The Initial Margin rate depends on the Leverage used.

Initial Margin Formula:

Initial Margin = (Contract Quantity × Order Price × Multiplier​) / Leverage

Example:

* Trader opens a Long BTC-USDT position of 100 contracts, each sizing 0.01 BTC, at a price of 10,000 USDT using 50x leverage.

Calculation:

`Initial Margin = (100×10,000×0.01) / 50 ​= 200 USDT`

### **Profit and Loss (PNL)**

After opening a position, the PNL can be seen in real-time based on market price changes. The calculation differs depending on whether the position is long or short.

#### **For Long positions**

Example:

* Trader B holds a Long position of 0.2 BTC-USDT with an Entry Price of 7,000 USDT. The latest Market Price shows 7,500 USDT.

**PNL Calculation:**

`PNL = Contract Quantity × (Latest Price − Entry Average Price) = 0.2 × (7,500−7,000) = 100 USDT`<br>

**For Short positions**

Example:

* Trader C holds a Short position of 0.4 BTC-USDT with an Entry Price of 6,000 USDT. The latest Market Price shows 5,000 USDT.

#### **PNL Calculation:**

`PNL = Contract Quantity × (Entry Average Price − Latest Price) = 0.4 × (6,000 − 5,000) = 400 USDT`

#### **Average Entry Price**

The Average Entry Price is recalculated whenever new positions are opened. The formula is as follows:

Average Entry Price Formula:

`Average Entry Price =`

`[( ContractQty1 x EntryPrice1 ) + ( ContractQty2 x EntryPrice2 ) + …] /`\
`( ContractQty1 + ContractQty2 + … )`

***

## ALTCOIN-margined Contracts Overview

**Margin**

ALTCOIN-M contracts are derivatives that allow the use of currencies other than the pricing currency and base currency as a margin for opening trading positions.\
\
For example, the LN-ETH-USDT contract uses LN as the margin for two contracts.

**Pricing Unit**

ALTCOIN-M contracts also use USDT as the pricing unit.

**Contract Value**

The contract value for ALTCOIN-M contracts is typically 0.01 ETH, although this is subject to the configuration of each contract.

**Profit and Loss Currency**

The profit and loss for ALTCOIN-M contracts are settled in the corresponding margin currency. For instance, the LN-ETH-USDT contract is settled in LN.

**Contract Specifications**

<table data-header-hidden><thead><tr><th width="210"></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Trading Pair</strong></td><td><strong>Contract Value</strong></td><td><strong>Collateral Currency</strong></td><td><strong>Maximum Leverage</strong></td><td><strong>Maintenance Margin Rate</strong></td></tr><tr><td>LN-ETH-USDT</td><td>0.01 ETH</td><td>LN</td><td>20X*</td><td>2.5-10.0%*</td></tr></tbody></table>

*\*May be adjusted in the future.*

### Position Limits and Maintenance Margin Rates\*

*\*May be adjusted in the future.*

{% hint style="danger" %}
Trading pairs like Altcoin-Margined are affected by fluctuations in the base currency market price. \
\
When the base currency’s price moves, the value of the contract changes accordingly, which in turn adjusts the required maintenance margin rate; this also impacts the margin amount needed to open a position. \
\
Please manage your leverage and margin appropriately to avoid unnecessary losses.
{% endhint %}

**LN-ETH-USDT Contracts**

<table data-full-width="true"><thead><tr><th width="82">Tier</th><th width="128">Lower Limit</th><th width="128">Upper Limit </th><th width="144">Max Leverage</th><th width="86">MMD</th><th>Maintenance Amount (LN)</th></tr></thead><tbody><tr><td>1</td><td>0</td><td>40,000</td><td>20x</td><td>0.5%</td><td>0</td></tr><tr><td>2</td><td>40,000</td><td>80,000</td><td>20x</td><td>1.0%</td><td>200</td></tr><tr><td>3</td><td>80,000</td><td>160,000</td><td>20x</td><td>2.0%</td><td>1,000</td></tr><tr><td>4</td><td>160,000</td><td>200,000</td><td>20x</td><td>2.5%</td><td>1,800</td></tr><tr><td>5</td><td>200,000</td><td>400,000</td><td>10x</td><td>5.0%</td><td>6,800</td></tr><tr><td>6</td><td>400,000</td><td>800,000</td><td>5x</td><td>10.0%</td><td>26,800</td></tr></tbody></table>

### Margin and Profit & Loss Calculation

#### Opening Margin

In ALTCOIN-M contracts, the initial margin is calculated by multiplying the order value by the initial margin rate. The initial margin rate depends on the leverage used.<br>

`Initial Margin = (Contract Quantity × Order Price × Contract Value) / Leverage`

**Example:**\
A trader uses a Leverage of 20x to open a Long position of 100 contracts for 10,000 USDT.\
\
`Initial Margin = (100 × 10,000 × 0.01) / 20 = 500 TOKEN`

#### &#x20;**Average Entry Price**

The Average Entry Price is calculated as follows:&#x20;

`Average Entry Price =`

`[( ContractQty1 x EntryPrice1 ) + ( ContractQty2 x EntryPrice2 ) + …] /`\
`( ContractQty1 + ContractQty2 + … )`

The Average Entry Price will be recalculated whenever a new position is opened.

#### **Profit and Loss**

After opening a position, the position and its Profit and Loss can be viewed in real-time. The formulas for calculating Profit and Loss vary depending on the direction of the trade.

* **For Long positions:**\
  `Profit and Loss = Contract Quantity × (Latest Price − Average Entry Price)`
* **For Short positions:**\
  `Profit and Loss = Contract Quantity × (Average Entry Price − Latest Price)`


# Mark Price

### **What is Mark Price?**

To enhance the stability of the futures market and reduce unnecessary liquidations during extreme market fluctuations, we use the Mark Price to calculate users' unrealized profits and losses as well as to trigger forced liquidations.

### **Mark Price Algorithm**

The mark price is calculated using the following formula:

`Mark Price = Median(Latest Price, Fair Price, Moving Average Price)`

Where:

* Latest Price: The mid-price on the exchange, calculated as the median of the best bid price (#1 Buy on the orderbook), best ask price (#1 Sell on the orderbook), and the last transaction price.<br>
* Fair Price: The index price adjusted by the previous Funding Rate, calculated as follows:\
  `Fair Price = Index Price × (1+Previous Funding Rate × (Time Until Next Funding / Funding Interval))`<br>
* Moving Average Price:\
  The index price plus the 60-minute moving average of the price difference:\
  `Price Difference = Mid Price − Index Price`

The mark price takes into account both the spot index price and the moving average of the basis. The moving average mechanism smooths out short-term price fluctuations in the futures contracts, reducing unnecessary forced liquidations caused by extreme price movements.

### **Index Price**

The index price is calculated through a weighted average of the latest transaction prices and the mid-prices (the median of the best bid and ask prices) from major exchanges for the underlying currency pair. It represents the fair market price for that currency pair.

<br>


# Fees Calculation

## **How Perpetual Trading Fees are Calculated**

Fee = \
`"Number of contracts * contract value * transaction price * initial fee rate * VIP tier discount * fee discount`

* The initial fee rate depends on whether the user is a taker or a maker after the transaction.\
  The fee rates for takers and makers will vary.
* During the testing period, the VIP tier is not implemented; all users are treated as the same tier.
* Once the official launch occurs, VIP tiers will be introduced based on users' historical trading volume, with corresponding fee discounts.
* Fee discount refers to a 5% discount on fees if the user is invited via an LN Exchange invite link from another user."

## Fees

{% hint style="info" %}
\*The fees may be adjusted.
{% endhint %}

### Spot Trading

| Fees  | %       |
| ----- | ------- |
| Maker | 0.04%\* |
| Taker | 0.05%\* |

### Perpetual Trading

#### USDT-M

<table><thead><tr><th>Fees</th><th>%</th><th data-hidden>BTC-USDT</th></tr></thead><tbody><tr><td>Maker</td><td>0.02%*</td><td></td></tr><tr><td>Taker</td><td>0.05%*</td><td></td></tr></tbody></table>

#### ALTCOIN-M

| Fees  | %       |
| ----- | ------- |
| Maker | 0.04%\* |
| Taker | 0.1%\*  |


# Liquidation

### **Overview**

The maintenance margin rate is an indicator of the risk associated with the collateral assets of a position. When the margin rate approaches the minimum maintenance margin, your position will be forcibly taken over by the system. We use the mark price to calculate the margin rate to avoid forced liquidations caused by insufficient liquidity or market manipulation. \
\
The maintenance margin rate is between 0.5%\* (for 125x\* max leverage) and 50%\* (for 1x\* max leverage) depending on the asset and risk limits by tiers.

*\*may be changed in the future*

### **About Stepwise Liquidation**

To prevent significant market impact and large liquidation losses when large positions are liquidated, we employ a stepwise liquidation mechanism. Each step corresponds to a different maintenance margin rate. When the system determines that the margin is insufficient for the maintenance margin of the current position tier, it will perform a liquidation operation to reduce the position size to the corresponding level.\
\
When a position reaches the liquidation condition, the system automatically executes the following measures to release the available margin and prevent forced liquidation:

1. The system will cancel all current orders for this contract.
2. The long and Short positions of the same contract will be matched and closed.
3. If, after executing the above steps, the user's margin rate remains less than the current tier's maintenance margin rate, forced liquidation will occur.
4. If the margin rate is still less than the current position's maintenance margin rate, the system will forcefully reduce the position to the net position limit of the next tier, ensuring that the margin rate exceeds 0%.
5. If the system calculates that the forced liquidation should be adjusted to the first tier but the margin rate still does not exceed 0%, then the entire position will be forcibly liquidated.

During forced liquidation, users cannot perform any operations related to this contract.\
\
**Example:**&#x20;

For BTC, when a user has a large position and is at tier 3 or above (e.g., holding 15,000 contracts) if the liquidation engine detects that the user's current margin rate is less than or equal to the required maintenance margin rate plus the liquidation fee rate, it will not directly liquidate all of the user's positions.&#x20;

Instead, it will perform a forced partial liquidation first. The system calculates the number of contracts needed to be reduced by two tiers:

`Contracts to Reduce =` \
`Current Contracts − Max Contracts of Tier 1 = 15,000 − 2,000 = 13,000`

If the user is in isolated margin mode, the system will place a forced partial liquidation order for the required number of contracts at a price slightly better than the latest transaction price. During this forced partial liquidation, the user's position in that contract direction will be frozen, and they will be unable to perform any contract-related operations.

<br>


# Funding Rates

At the delivery date of a futures contract, the Market Price of the contract will revert to the Index Price. However, Perpetual contracts do not have an expiration or delivery date, so a "Funding Fee Mechanism" is employed to anchor the Contract Price to the Spot Price.

***

### **Funding Fee Collection**

{% hint style="info" %}
Perpetual contracts settle every hour.\
\
Only traders with open positions at the moment of settlement will pay or receive the Funding Fee.\
If you close your position before settlement, you won’t be charged any Funding Fees.
{% endhint %}

The determination of whether a user should pay or receive a Funding Fee at settlement depends on the Funding Rate for that period and the user's Position status. When the Funding Rate is positive, Long positions pay the Funding Fee, and Short positions receive it. Conversely, when the Funding Rate is negative, Long positions receive the Funding Fee, and Short positions pay it.

Funding Fees are settled entirely between users, and the platform does not charge any fees.

***

### **Funding Fee Calculation**

The Funding Fee is calculated as follows:

`Funding Fee = Position Value × Funding Rate`

Where:

`Position Value = Number of Contracts × Contract Quantity × Mark Price`

***

### **Funding Rate Calculation**

The Funding Rate is designed to ensure that the Trading price of Perpetual contracts closely follows the reference price of the underlying asset. The Funding Rate for each period is calculated based on data from the previous period and is determined at the start of the current period, remaining unchanged throughout that period. This rate will be applied for the settlement of the Funding Fees at the end of the current period. Additionally, the predicted Funding Rate for the next period is calculated every minute, and the last calculated predicted Funding Rate will serve as the Funding Rate for the next period.

For example, the Funding Rate for the period from 08:00 to 09:00 is derived from the previous period’s data (07:00 to 08:00) and is finalised at 08:00. During the 07:00 to 08:00 period, a predicted Funding Rate is calculated every minute for the subsequent period, and the last calculated predicted Funding Rate will determine the Funding Rate for that next period.

***

### **Components of the Funding Rate**

1. **Comprehensive Interest Rate:**\
   Perpetual contracts consist of two currencies: the Underlying currency and the Quote currency. For instance, in the BTC-USDT perpetual contract, BTC is the underlying currency, while USDT is the quote currency.

   * Underlying Currency Interest Rate: The daily borrowing rate for the underlying currency in the market. For the BTC-USDT contract, this would be the daily borrowing rate for BTC.
   * Quote Currency Interest Rate: The daily borrowing rate for the quote currency in the market. For the BTC-USDT contract, this would be the daily borrowing rate for USDT.

The comprehensive interest rate is calculated as follows:\
`Comprehensive Interest Rate =` \
`(Quote Currency Rate−Underlying Currency Rate) / Funding Rate Settlement Frequency`

2. **Premium:**\
   Perpetual contracts may trade at a premium or discount relative to their fair price. The premium index measures the level of this premium and is included in the Funding Rate calculation. A higher premium results in a larger Funding Rate, incentivizing shorts to enter positions. Conversely, a lower premium leads to a smaller Funding Rate, encouraging longs to take positions. Adjusting the Funding Rate can help the contract price revert to a more reasonable level.

<br>


# Insurance Fund

**What is the Insurance Fund?**

The purpose of this insurance fund is to provide a safeguard, ensuring equitable closure of positions for all traders. Consequently, it fosters trust among larger traders, encouraging them to engage in trading activities on the LN Exchange.

**How is the Insurance Fund Generated?**

When the liquidation engine takes over a position, the profits generated from handling that position will be injected into the Insurance Fund. If the liquidation engine closes the position at a price better than the takeover price, the profit will be entirely injected into the Insurance Fund.

**How is the Insurance Fund Used?**

During liquidation, the liquidation engine takes over the user's position and remaining margin at the takeover price. If the position continues to incur losses after liquidation, this loss is regarded as a system liquidation loss. A portion of this loss will be compensated by the Insurance Fund, while the remaining part will be borne by the user.

All Perpetual contracts that use the same collateral share one Insurance Fund to cover potential losses and keep the system stable.

<br>


# Price Oracle

## Overview

The LN Exchange Price Oracle is the cornerstone of decentralized finance within the Lightning Network, primarily serving RFQ (Request for Quote) services. This platform provides dynamic pricing, including price fluctuations and a spread between buy and sell prices, ensuring accurate and reliable rates for assets traded on the network.

This guide will walk you through integrating with the platform, fetching prices, and adding currency pairs.

***

## Unified Interface Domain

**GRPC:** `grpc-oracle.lnfi.network:443`\
**REST:** `https://api-oracle.lnfi.network`

***

## Fetching Prices

#### **GRPC Calls**

{% code overflow="wrap" %}

```
Setup: Add the following configuration to your terminal --taproot-assets.experimental.rfq.priceoracleaddress=rfqrpc://grpc-oracle.lnfi.network:443
```

{% endcode %}

#### **REST Calls**

{% code overflow="wrap" %}

```
REST API documentation in the section below provides details on how to integrate.
```

{% endcode %}

***

## Adding Currency Pairs & Prices

### [Add Currency Pair](#add-currency-pair-and-price)

**Using BTC/USDT Price**

This method is intended for assets that are tied to the USDT stablecoin. When this method is used, the system automatically fetches the current BTC/USDT price, ensuring that your asset's value reflects real-time market conditions.

### [Fetch Price](#fetch-price)

After adding prices using either method, prices can be fetched immediately.

* If a currency pair or currency doesn’t exist, the system will automatically create them.
* Each asset can only be added once. When fetching prices, the system always uses the latest price.

Please refer to the API section for more details.

***

## Price Oracle API

### Quick Start

{% code title="Example:" lineNumbers="true" %}

```
oracle ~ % curl --location --request POST 'https://api-oracle.lnfi.network/price/custom' \
--header 'Content-Type: application/json' \
--data-raw '{
    "paymentAssetName": "BTC",
    "paymentAssetId": "0000000000000000000000000000000000000000000000000000000000000000",
    "subjectAssetName": "LUSDT",
    "subjectAssetId": "1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049",
    "subjectAssetDemical": "2",
    "priceFluctuationRate": "0.02"
}'
{"code":"0","msg":"Success","data":true,"succ":true}

oracle ~ % grpcurl -d '{"subjectAsset":{"assetIdStr":"1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049"},"paymentAsset":{"assetIdStr":"0000000000000000000000000000000000000000000000000000000000000000"}}' grpc-oracle.lnfi.network:443 priceoraclerpc.PriceOracle.QueryAssetRates
{
  "ok": {
    "asset_rates": {
      "subjectAssetRate": {
        "coefficient": "8733623000000",
        "scale": 6
      },
      "paymentAssetRate": {
        "coefficient": "100000000000"
      },
      "expiry_timestamp": "1766549104533"
    }
  }
}
```

{% endcode %}

***

## GRPC Section

### Fetch Price

* **URL**：`grpc-oracle.lnfi.network:443`
* **Method**：`priceoraclerpc.PriceOracle.QueryAssetRates`

**Request Parameters**

| Parameter Name          | Type   | Required | Description                           |
| ----------------------- | ------ | -------- | ------------------------------------- |
| subjectAsset.assetidStr | String | Yes      | Quoted currency asset ID (e.g., USDT) |
| subjectAsset.assetidStr | String | Yes      | Base currency asset ID (e.g., BTC)    |

{% hint style="info" %}
\*\*Request Example\*\*
{% endhint %}

```
grpcurl -d '{
    "paymentAsset": {
        "assetIdStr": "0000000000000000000000000000000000000000000000000000000000000000"
    },
    "subjectAsset": {
        "assetIdStr": "1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049"
    }
}' grpc-oracle.lnfi.network:443 priceoraclerpc.PriceOracle.QueryAssetRates
```

**Response Parameters**

| Parameter Name                | Type   | Description      |
| ----------------------------- | ------ | ---------------- |
| asset\_rates.subjectAssetRate |        |                  |
| rate                          | String | Price rate       |
| expiry\_timestamp             | String | Expiry Timestamp |

{% hint style="info" %}
**Response Example**
{% endhint %}

```
{
  "ok": {
    "asset_rates": {
      "subjectAssetRate": {
        "coefficient": "8733623000000",
        "scale": 6
      },
      "paymentAssetRate": {
        "coefficient": "100000000000"
      },
      "expiry_timestamp": "1766549104533"
    }
  }
}
```

***

## REST Section API

### REST Request Authentication

All private REST requests must include the following header

#### Header Parameters

| Parameter Name | Type   | Required | Value            |
| -------------- | ------ | -------- | ---------------- |
| Content-Type:  | String | Yes      | application/json |

***

### Fetch Price List

* **URL**：`/price/getList`
* **Method**：`GET`

**Request Parameters**

| Parameter Name    | Type   | Required | Value                                    |
| ----------------- | ------ | -------- | ---------------------------------------- |
| symbolAssetsId    | String | Yes      | Currency pair asset ID                   |
| transaction\_type | String | Yes      | Transaction type: 0 = buy, 1 = sell      |
| current           | String | No       | Page number (default is 1)               |
| size              | String | No       | Number of items per page (default is 10) |

{% hint style="info" %}
\*\*Request Example\*\*
{% endhint %}

{% code lineNumbers="true" %}

```
{
    "symbolAssetsId": "0000000000000000000000000000000000000000000000000000000000000000-1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049",
    "transaction_type": "1",
    "current": "1",
    "size": "10"
}
```

{% endcode %}

**Response Parameters**

| Parameter Name    | Type   | Description                         |
| ----------------- | ------ | ----------------------------------- |
| total             | String | Total number of records             |
| pages             | String | Total number of pages               |
| transaction\_type | String | Transaction type: 0 = buy, 1 = sell |
|                   |        |                                     |
| list              | List   |                                     |
| symbol            | String | Currency pair name                  |
| price             | String | Price                               |
| base              | String | Base currency name (e.g, BTC)       |
| baseAssetsId      | String | Base currency asset ID              |
| quote             | String | Quoted currency name (e.g, USDT)    |
| quoteAssetsId     | String | Quoted currency asset ID            |
| ctime             | String | Creation time                       |

{% hint style="info" %}
**Response Example**
{% endhint %}

{% code lineNumbers="true" %}

```
{
    "code": "0",
    "msg": "Success",
    "data": {
        "total": 1,
        "pages": 1,
        "list": [
            {
                "symbol": "BTC-LUSDT",
                "price": 10000,
                "ctime": "2024-08-19T10:01:03",
                "base": "BTC",
                "baseAssetsId": "0000000000000000000000000000000000000000000000000000000000000000",
                "quote": "LUSDT",
                "quoteAssetsId": "1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049"
            }
        ],
        "transaction_type": "1"
    },
    "succ": true
}
```

{% endcode %}

***

### Add Currency Pair

* **URL**：`/price/custom`
* **Method**：`POST`

**Request Parameters**

| Parameter Name       | Type   | Required | Description                               |
| -------------------- | ------ | -------- | ----------------------------------------- |
| paymentAssetName     | String | Yes      | Base currency name (e.g., BTC)            |
| paymentAssetId       | String | Yes      | Base currency asset ID                    |
| subjectAssetName     | String | Yes      | Quoted currency name (e.g., USDT)         |
| subjectAssetId       | String | Yes      | Quoted currency asset ID                  |
| subjectAssetDemical  | String | Yes      | Quoted currency asset precision (e.g., 4) |
| priceFluctuationRate | String | Yes      | Price fluctuation rate: Default is 2%     |

{% hint style="info" %}
**Request Example**
{% endhint %}

{% code lineNumbers="true" %}

```
{
    "paymentAssetName": "BTC",
    "paymentAssetId": "0000000000000000000000000000000000000000000000000000000000000000",
    "subjectAssetName": "LUSDT",
    "subjectAssetId": "1f0e5e108dbaca43b836c8f0990abb5118bbe52c24b9237414d14cd53b1ad049",
    "subjectAssetDemical": "4",  
    "priceFluctuationRate": "0.02"
}
```

{% endcode %}

**Response Parameters**

| Parameter Name | Type   | Description                        |
| -------------- | ------ | ---------------------------------- |
| code           | String | 0 indicates successful addition    |
| data           | String | true indicates successful addition |

{% hint style="info" %}
**Response Example**
{% endhint %}

{% code lineNumbers="true" %}

```
{
    "code": "0",
    "msg": "Success",
    "data": true,
    "succ": true
}
```

{% endcode %}


# Hybrid Custody & Security

### Background

LN Exchange facilitates deposits and withdrawals using the Lightning Network for its rapidity and zero   or minimal fees. However, the Lightning Network has a significant drawback: it necessitates the opening of a Lightning channel by two nodes before funds can be transferred between them.

The setup and management of a Lightning node are arduous, prompting many retailers to opt for custodial solutions instead.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FhcWv0xrbTaDlzkxBr54A%2Fimage.png?alt=media&amp;token=be54f12e-d58f-40ad-8faa-15ffcd977f01" alt=""><figcaption></figcaption></figure>

To tackle this challenge, LN Exchange introduces a hybrid custody framework:

#### ⚡Managed Custody

LN Exchange's current Managed Custody service, where users' funds are securely stored on LN Exchange's Lightning node, will continue. In the future, this service will support Pocket Universe, a system that requires both the node operator and the user to approve any fund movement requests, thereby enhancing security measures.

#### ⚡Self-Custody

In LN Exchange v1, users are only able to hold their assets in self-custody with their LN Nodes after withdrawing their assets upon completion of their trades. We are taking progressive steps towards partial and full self-custody trading whereby transactions are settled on Lightning Network automatically upon completion of their trades.

#### LN Node

LN Node is a Lightning node management solution powered by Nostr protocol, designed to abstract away the complexities associated with setup, management and provision of liquidity on the Lightning Network. Through LN Node, users will be able to manage their own nodes through natural language commands (similar to sending text messages) or a web interface, enabling self-hosting and interaction with Lnfi. They can also access node and account records, ensuring complete transparency.

> **Cloud Hosting**
>
> LN Exchange and [Lnfi Network](https://www.lnfi.network) have partnered with Voltage to offer a user-friendly cloud-based LN Node for establishing and managing Lightning nodes. Details can be found [here](https://docs.lnfi.network/lnfi-products/ln-node).

> **Hardware Devices**
>
> \[TBD]

Both solutions empower users to engage with LN Exchange and Lnfi while maintaining self-custody.

{% hint style="info" %}
Our hybrid custody model aims to decentralize and expand the Lightning Network's capabilities, further driving its adoption.
{% endhint %}


# Orderbook & Order Types

### ⚡Orderbook

The orderbook is LN Exchange’s primary edge in the context of a performant trading engine. Liquidity is augmented as positions from pairwise LP markets populate the orderbook.

Limit orders are placed on the book and held in the bids and asks fields of the Market. Orders are matched by price-time priority: orders are executed based on the best price, and if multiple orders are at the same price, the order with the earliest time will be matched first.

***

### ⚡Order types

#### Market

A Market Order is an order to buy or sell an asset right away at the best available price. It's used when you prioritize speed over getting a specific price.

#### Limit

A Limit Order is an order to buy or sell an asset at a specific price or better. It gives you control over the price but may not execute if the market doesn't reach your desired level.

***

### ⚡Order options

#### Take Profit

Automatically closes a position to secure profits when the asset hits a certain price level.

#### Stop Loss

Automatically closes a position to limit losses when the asset hits a certain price level.

#### Trigger

A Trigger Order is a conditional order that becomes active and executes when a specified trigger price is reached. It helps automate trading decisions and execute trades based on predefined conditions.

#### **Post Only Order**

&#x20;A Post Only order ensures that your order is only added to the order book as a maker order, meaning it won’t be immediately filled by an existing order. If the order matches an existing order (thus making you a taker), it is canceled. This guarantees that you will earn the maker fee, which is typically lower than the taker fee.

{% hint style="info" %}
**Use Case**

* **Traders focused on fee reduction**: Traders who want to minimize fees by ensuring they always act as makers (who provide liquidity) rather than takers (who remove liquidity).
* **Market makers**: Participants who consistently post limit orders to maintain liquidity in the market.
  {% endhint %}

#### Immediate or Cancel (IOC)

An IOC order attempts to fill as much of the order as possible immediately. Any portion of the order that cannot be filled right away is canceled. This type of order is useful when you want to execute a trade quickly but are willing to forgo any unfilled portion.

{% hint style="info" %}
**Use Case**

* **Traders needing quick execution**: Traders who prioritize speed and want to take advantage of current market prices without waiting for the entire order to fill.
* **High-frequency traders**: Traders or algorithms looking to execute trades rapidly and efficiently.
  {% endhint %}

#### Fill or Kill (FOK)

A FOK order requires that the entire order be filled immediately or not at all. If the full order cannot be executed instantly, the order is canceled. This type of order is useful when partial fills are not acceptable, and you need to ensure the complete transaction occurs at once.

{% hint style="info" %}
**Use Case**

* **Traders requiring certainty**: Traders who need the entire quantity of an order to be executed at once or not at all, often to ensure a specific position size.
* **Institutional traders**: Larger traders or institutions managing substantial positions who cannot afford to have only part of an order filled due to price slippage or other strategic reasons.
  {% endhint %}


# Points & Rewards Program

At LN Exchange, we hold deep appreciation for the invaluable contributions of our earliest supporters and friends. From the very beginning, they have played a pivotal role in nurturing and fostering the growth of our community. Their dedication and enthusiasm have laid the foundation upon which our platform stands today.

In line with our core values, fairness lies at the heart of our reward system. We've meticulously crafted a balanced approach to ensure that every member of our early community is given an equal opportunity to reap the benefits. Whether you've been with us since the inception of Lnfi Network or have recently joined our ranks, rest assured that your participation is highly valued and duly rewarded. We believe that every individual's efforts contribute significantly to the collective success of our community, and thus, we strive to recognize and appreciate each member accordingly.

{% hint style="success" %}
Additionally, a fraction of the total platform tokens will be allocated to early supporters pro-rata to their points at the end of the Rewards Program. The rewards would have to be claimed by the users at the end of the program.
{% endhint %}

In our upcoming journey, there are three distinct phases, each aimed at enriching the experience of our community members:

{% hint style="info" %}
[**Phase 1: Pre-Launch Marketing (**&#xD83D;�**Completed)**](#phase-1-pre-launch-marketing-completed)

During this initial phase, we're focusing on rewarding:

* past contributors for their invaluable support and dedication
* top ranking participants in our Zealy questing
* selected winners for our upcoming AMAs, Twitter & Telegram Giveaway events
* traders who trade on Lnfi Network's P2P Marketplace during Phase 1

LN Points will be allocated to the above as a token of appreciation for their role in shaping and nurturing our community.

Moreover, in Phase 1, we're extending our gratitude to traders on our P2P Marketplace. As integral participants in our ecosystem, traders will also receive points, acknowledging their active involvement and contribution to the vibrancy of LN Exchange.
{% endhint %}

{% hint style="info" %}
[**Phase 2: Early Access - Closed Test  (**&#xD83D;�**Completed on 25 Nov)**](#phase-2-early-access-closed-test-completed)

Phase 2 marks a significant milestone as we prepare to introduce our platform for a closed early access test.

During this phase, testers will be crucial in helping us refine and optimize our trading system.

LN Points will be awarded to testers based on their trading activity.
{% endhint %}

{% hint style="info" %}
[**Phase 3: Public Launch (Start on 25 Nov)**](#phase-3) **(**&#xD83D;�Complete&#x64;**)**

Phase 3 marks the culmination of our journey as LN Exchange prepares for a full-scale launch to the public.

LN Points will be awarded to users based on their trading activity.
{% endhint %}

***

### PHASE 1 - Pre-Launch Marketing **(**&#xD83D;�Complete&#x64;**)**

#### #1 - Earn LN Points for Past Contributors

{% hint style="info" %}
LN Points will be allocated to past contributors as per our record as of\
17 March 2024 23:59 UTC+8
{% endhint %}

Eligible historic contributions are as follows:

<table><thead><tr><th width="251">Past Contributions</th><th>Remarks</th></tr></thead><tbody><tr><td>Trading on Lnfi Network P2P Marketplace</td><td><p>0.05 LN points will be rewarded for every 10,000 sats <em>(equivalent to 0.05 LN points for every US$7 of BTC based on BTC's price of $70,000) traded.</em></p><p><br><em><strong>*Minimum requirement:</strong> To be eligible, users must have fulfilled BUY orders exceeding the value of 100,000 SATS on the P2P Marketplace before the designated time specified above to qualify. SELL orders will not be considered for eligibility. The calculation of LN points will factor in both BUY and SELL transaction volume.</em></p></td></tr><tr><td>Fairmint / Lightning Starter Participation</td><td>10 LN points for every past Fair Mint participation</td></tr><tr><td>Lightning Gift Creations</td><td>5 LN points for every gift created</td></tr><tr><td>Lock Assets Participation</td><td>50 LN points for every Lock Assets event created</td></tr></tbody></table>

#### #2 - Earn LN Points for ranking on the Zealy Leaderboard

{% hint style="info" %}
Join Zealy Quest >> <https://zealy.io/c/lnexchange/invite/fiEvLL2ew-DQ0Yx6BQy1n>
{% endhint %}

<table><thead><tr><th width="215">Ranking</th><th>Remarks</th></tr></thead><tbody><tr><td>Top 1 - 10</td><td>2,000 LN points each</td></tr><tr><td>Top 11 - 50</td><td>500 LN points each</td></tr><tr><td>Top 51 - 200</td><td>200 LN points each</td></tr><tr><td>Remaining</td><td>A random number of winners will be selected and awarded 10 LN points each</td></tr></tbody></table>

#### &#x20;#3 - Trade on Lnfi Network P2P Marketplace

0.2 LN points will be rewarded for every 10,000 sats (equivalent to 0.2 LN points for every US$7 of BTC based on BTC's price of $70,000) traded.

{% hint style="info" %}
**Minimum requirement:**

To be eligible, users must have fulfilled BUY orders exceeding the value of 100,000 SATS on the P2P Marketplace before the designated time specified above to qualify.

SELL orders will not be considered for eligibility. The calculation of LN points will factor in both BUY and SELL transaction volume
{% endhint %}

{% hint style="danger" %}
Washtrading restriction: Transactions flagged as washtrading may be subject to eligibility at the discretion of the team.
{% endhint %}

{% hint style="success" %}
The end date of Phase 1 and the start date of Phase 2 will be announced at a future date.
{% endhint %}

***

### PHASE 2 - Early Access Closed Test **(**&#xD83D;�Complete&#x64;**)**

{% hint style="danger" %}
During Phase 2: Closed Early Access, users can perform spot trading <mark style="background-color:orange;">on the mainnet</mark> **NOT** testnet i.e. <mark style="background-color:orange;">testers are trading with real tokens of value.</mark>&#x20;
{% endhint %}

#### **#1 - Spot Trading on LN Exchange**

For a limited time during Phase 2, participants will earn DOUBLE LN Points for the Spot Trading

0.1 LN points will be rewarded for every 10\* USDT trading volume.\
10 LN points per 1,000\* USDT trading volume.\
100 LN points per 10,000\* USDT trading volume.

<table><thead><tr><th width="143">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.04%*</td></tr><tr><td>Taker</td><td>0.05%*</td></tr></tbody></table>

{% hint style="info" %}
\*The specified trading volume or rules are subject to change at the team's discretion.\
\*The fees will be adjusted after the test period.
{% endhint %}

#### #2 - Perpetual Trading on LN Exchange

For a limited time during Phase 2, participants will earn DOUBLE LN Points for the Perpetual Trading\
\
**BTC-USDT \[**[**Details**](https://lnfinetwork.medium.com/ln-exchange-launches-usdt-margined-perpetual-trading-9a3ac4a1dfb6)**]**

0.1 LN Points for every 10\* USDT in trading volume.\
10 LN Points for every 1,000\* USDT in trading volume.\
100 LN Points for every 10,000\* USDT in trading volume.

<table><thead><tr><th width="144">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.02%*</td></tr><tr><td>Taker</td><td>0.05%*</td></tr></tbody></table>

**BURGER-BTC-USDT \[**[**Details**](https://lnfinetwork.medium.com/ln-exchange-launches-burger-btcusdt-perpetual-trading-market-making-crowdfunding-campaign-e383270f74bc)**]**

0.1 LN Points for every 1,500\* BURGER in trading volume. \
10 LN Points for every 150,000\* BURGER in trading volume. \
100 LN Points for every 1,500,000\* BURGER in trading volume.

{% hint style="info" %}
The total number of LN Points for the BURGER-BTC-USDT trading pair is capped at 20,000 weekly. If the weekly trading volume exceeds **300,000,000 BURGER**, LN Points will be distributed to each trader on a pro-rata basis according to their trading volume.
{% endhint %}

<table><thead><tr><th width="189">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.02%*</td></tr><tr><td>Taker</td><td>0.05%*</td></tr></tbody></table>

**TREAT-BTC-USDT \[**[**Details**](https://lnfinetwork.medium.com/ln-exchange-rolls-out-treat-btcusdt-perpetual-trading-trading-competition-a4abf8ef1529)**]**

0.1 LN Points for every 750\* TREAT in trading volume. \
10 LN Points for every 75,000\* TREAT in trading volume. \
100 LN Points for every 750,000\* TREAT in trading volume.

{% hint style="info" %}
The total number of LN Points for the TREAT-BTC-USDT pair is capped at 20,000 weekly. If the weekly trading volume exceeds **150,000,000 TREAT**, LN Points will be distributed pro-rata based on each trader’s volume.
{% endhint %}

<table><thead><tr><th width="189">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.02%*</td></tr><tr><td>Taker</td><td>0.05%*</td></tr></tbody></table>

{% hint style="info" %}
\*The specified trading volume or rules are subject to change at the team's discretion.\
\*The fees will be adjusted after the test period.
{% endhint %}

***

### PHASE 3: Pre-launch Trade Mining + Lnfi Community Partner Program Launch **(**&#xD83D;�Complete&#x64;**)**

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fklu9y2Jcjgk4DGApWoGM%2Fimage.png?alt=media&amp;token=16e06116-c4bc-4f68-8679-38af548679e5" alt=""><figcaption></figcaption></figure>

Starting November 25, 2024, we will launch Phase 3 of the LN Exchange “Points and Rewards” Program, marking the most critical participation period before the TGE.

At the same time, we are introducing the "Lnfi Community Partner" Program to grant great Trade Mining Multiplier and efficiency to our community.

#### **Introducing Referral Mechanics**

1. **Exclusive Referral Rights for Lnfi Community Partners**\
   Starting in Phase 3, LN Exchange will officially launch its Referral system. However, referral rights will be limited exclusively to Lnfi Community Partners, who can generate their unique Referral code on the official website to invite new users.<br>
2. **Referral Code Requirement for New Users**\
   During the initial rollout of the Referral system, new users registering on LN Exchange must provide a Referral code.\
   \
   \- **Existing LN Exchange users** will not be affected and do not need a Referral code to continue trading.\
   \
   \- **New users must complete their registration using a Referral code** shared by Lnfi Community Partners via the official Lnfi and LN Exchange communities, or other social media platforms.<br>
3. **No Referral Code For Lnfi Community Partners**\
   New users can start trading on LN Exchange without any Referral code by joining the Lnfi Community Partner program directly.

***

#### **How to earn LN Points and Rewards in Phase 3?**

{% hint style="info" %}
**Update on Phase 3 LN Points Explanation**

To enhance fairness and scalability, following community discussions, it has been decided that starting from 9 Dec 2024, TREAT will adopt the same calculation mechanism as USDT-M contracts. LN Points awarded will be anchored to fees generated, rather than trading volume.

**Note:** Phase 3 LN Points, generated from the start until December 8, 2024, have been based on trading volume.
{% endhint %}

1. **Spot Trading Rewards**\
   Earn LN points by participating in spot trading on LN Exchange.\
   \
   Eligible for LN Points: \
   *BTC-USDT*<br>

2. **Perpetual Trading Rewards**\
   Earn LN points by engaging in perpetual trading on LN Exchange.<br>

   Eligible for LN Points: \
   *BTC-USDT* ・ *TRUMP-USDT*・ *TREAT-BTC-USDT* ・ *BURGER-BTC-USDT*

   \
   ~~Adjustment to TREAT-BTC-USDT LN Points allocation~~

   * ~~0.1 LN Points for every 150\* TREAT in trading volume.~~
   * ~~10 LN Points for every 15,000\* TREAT in trading volume.~~
   * ~~100 LN Points for every 150,000\* TREAT in trading volume.~~
   * Removed 20,000 LN Points cap per week for trading TREAT. There will be no upper limit.<br>

     > \*Note: \
     > BURGER Trading Competition has ended as of 24 Nov 2024 23:59 UTC+8.\
     > You can continue earn LN Points by trading BURGER-BTC-USDT. \
     > The total number of LN Points for the BURGER-BTC-USDT trading pair is capped at 20,000 weekly. If the weekly trading volume exceeds **300,000,000 BURGER**, LN Points will be distributed to each trader on a pro-rata basis according to their trading volume.

3. **Referral Trading Mining (exclusive for Lnfi Community Partners)**\
   Lnfi Community Partners can earn LN points by inviting new users through their unique referral links. LN Points are awarded when the invited users conduct Spot or Perpetual trades. LN Points can be swapped for Lnfi’s Platform token, which will take place at the TGE.<br>

4. **Referral Trading Fee Rebates (exclusive for Lnfi Community Partners)**\
   Lnfi Community Partners also earn trading fee rebates for Spot and Perpetual trades conducted by users they invite via their referral links.

**How to join Lnfi Community Partner? \[**[**Join**](/lnfi-community-partner)**]**

### Phase 3 Trading Fees

#### **Spot Trading on LN Exchange**

<table><thead><tr><th width="143">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.08%*</td></tr><tr><td>Taker</td><td>0.10%*</td></tr></tbody></table>

#### Perpetual Trading on LN Exchange

**BTC-USDT, TRUMP-USDT, TREAT-BTC-USDT, BURGER-BTC-USDT**

<table><thead><tr><th width="189">Fees</th><th>%</th></tr></thead><tbody><tr><td>Maker</td><td>0.02%*</td></tr><tr><td>Taker</td><td>0.05%*</td></tr></tbody></table>

{% hint style="info" %}
\*The fees will be adjusted in the future.&#x20;
{% endhint %}

***

### Post-Launch Reward Program

The Reward Program will continue post-launch periodically, albeit on a smaller scale, to recognize and incentivize contributors according to the aforementioned LN Points system.

***

### **Disclaimer**

1. Any other fraudulent acts including but not limited to the use of bots shall be disqualified.
2. Lnfi Network & LN Exchange reserves the right at any time in its sole and absolute discretion to determine and/or amend or vary these terms and conditions without prior notice, including but not limited to canceling, extending, terminating, or suspending this points & rewards program, the eligibility terms and criteria, the selection and number of winners, and the timing of any action to be done, and all Participants shall be bound by these amendments.
3. It is important to note that, like any emerging technology, there may be unforeseen risks associated with the use of the platform and its token(s). The protocol and its creators disclaim any responsibility for any losses, damages, or unforeseen consequences that may arise from their use. Users engage with this token at their own risk and should exercise caution when exploring its capabilities.
4. By proceeding to take part in this campaign, you acknowledge that you do so voluntarily and are aware of the potential risks involved. You agree not to hold the protocol, its developers, or any affiliated parties liable for any adverse outcomes that may result from your interaction with this platform and its token(s).


# Explorer

All Market events, token events, and funding records for all Spot & Perpetual trading are publicly visible on LN Exchange's explorer.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-0e95a3cbca51c0920fc6bc36187ec5a366c62095%2Fimage%20(26).png?alt=media" alt=""><figcaption></figcaption></figure>

### How to use Explorer?

Select between Spot or Perpetual.\
Then, enter an Event ID or Npub Address on the search bar, and tap \[Search]

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-a4a10756bfa537285baaaa1f2a05cbf86ed7566c%2Fimage%20(28).png?alt=media" alt=""><figcaption></figcaption></figure>

To search for a specific transaction, use an Event ID.\
Event ID can be found at the bottom of the trading UI.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-b173427d9b117dd237e3c93bc4cbbc2c0da89cad%2Fimage%20(30).png?alt=media" alt=""><figcaption></figcaption></figure>

Searching via a Npub Address will allow you to see all the past transactions/events associated with the address.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-8e3a395b58699b4401b25070b502d7dbbc12d2ab%2Fimage%20(32).png?alt=media" alt=""><figcaption></figcaption></figure>

To see details of an event, tap on the >&#x20;

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-6dbe0caccaaad7c5227b853c875cc0a69315f37a%2Fimage%20(33).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-8d3eafe99bd732d3c96c16813d3b2fecea2210bb%2Fimage%20(34).png?alt=media" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="197">Type</th><th>Description</th></tr></thead><tbody><tr><td>Market Events</td><td><p>See all</p><p>i) Limit Orders<br>ii) Market Orders</p><p>... for all trading pairs.</p></td></tr><tr><td>Token Events</td><td>See all<br>i) Trading Fee<br>ii) Place Order<br>iii) Cancel Order<br>iv) Order Settlement</td></tr><tr><td>Funding Records</td><td>See all<br>i) Deposit<br>ii) Withdraw</td></tr></tbody></table>


# Lnfi Community Partner

As Bitcoin hits new all-time highs, the relentless cycle of its success keeps rewarding those who have supported and believed in it. At Lnfi, we proudly champion the Bitcoin ecosystem and are excited to witness this incredible milestone.

Throughout the development of Lnfi, we have deeply felt the support and trust of our users. The achievements of Lnfi today are closely tied to the contributions of our community members. We take pride in having you with us, which has led us to think more deeply about one question: “How can we establish a deeper connection and better align interests with Lnfi’s early supporters?”

This is the reason behind creating the "Lnfi Community Partner Program." Its core purpose is to promote the healthy development of the platform through decentralization and community co-creation while sharing the platform’s growth benefits with our supporters.

Lnfi has made impressive progress in product optimization, feature development, and more. We are excited to announce that the long-awaited Lnfi platform token is almost here. This token will be closely integrated with the "Lnfi Community Partner Program," offering even greater benefits to our Program Participants, including airdrops, trade mining, referral commissions, staking rewards, and more.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F9JxaBbV36LDB1WlTkI2g%2FEN%20-%20CP.png?alt=media&amp;token=0a42d21e-cdf5-4ecf-85d4-caa88f04851a" alt=""><figcaption></figcaption></figure>

### How to Join the "Lnfi Community Partner Program"

Lock at least 1,000 $TREAT tokens for at least one year using the Lock Assets tool.

{% hint style="info" %}
Note: After the official Lnfi token is launched, it will be replaced by locking the Lnfi token (ticker to be confirmed).
{% endhint %}

### Lnfi Community Partner Program Benefits:

**1. Exclusive Invitation Privileges:**\
Community Partners will gain exclusive access to the Referral Program. By inviting users, they can earn Lnfi token rewards, referral commissions, trading fee rebates, and other benefits. (Ordinary users do not have referral privileges and are not entitled to these rewards.)\
\
**2. 2X Trade Mining:**\
The Lnfi token rewards use a Trade Mining mechanism, allowing users to earn Lnfi tokens through trading Spot and Perpetual, or by inviting others to trade.

**Trading Spot and Perpetual**

* Community Partners will earn 2X LN Points for trading spot and perpetual contracts on LN Exchange. This effectively doubles the Lnfi token rewards, which are based on LN Points

**3. Referral Commissions:**

* Earn an additional 20% reward in Lnfi tokens (distribution based on LN Points) from direct referral users’ Trade Mining.
* Earn 30% commission from direct referral users' Spot trading fees.
* Earn 30% commission from direct referral users' Perpetual trading fees (applies to USDT-M and TREAT-M only).<br>

**4. Exclusive APY for locking Lnfi tokens or other assets**<br>

**5. Airdrop Rewards:**\
Before the platform token launch, a snapshot will be taken of all "Lnfi Community Partner" Nostr addresses. Airdrop rewards will be distributed based on account trading volume and valid referrals.<br>

**6. Dedicated "Lnfi Community Partner" Community Group Chat:**\
Access dedicated communication and service channels, as well as a feedback channel for suggestions and ideas.

***

### Steps to Become A Lnfi Community Partner

(1) Visit the official website at[ https://www.ln.exchange/](https://www.ln.exchange/), and tap on "Lnfi Community Partner Program" in the navigation bar. Then, select "Become a Lnfi Community Partner" to begin the Lock Asset process.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc8AGMkFvCpXGc2xo6MVDpvcPzyVeEJOFSxVjSgz73CoSVAR5ZBaHnlJ7aZPpDXeM88N-PwIZVSCyZZnkwtQtCIJsHqVOGpRDbuoGFCLQxUrcb89bClPTJumVO9KKbnORmNEnQsjQ?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

(2) Connect your Nostr Address, tap on \[Start Lock Assets], proceed to \[Approve] & \[Confirm] locking 1,000 $TREAT.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcxTX83uRV-ZLUM2hmRK2z5nJGfOF19lGkaHLoxXGhzjGSig7XXfgNNWSkAgW33pZ8s8PZHieDVHKyle0gEETPHjq6HwiIHOeP3_0yOyZaMrIY0gBuDdcYDQhQzpha65TZHLozX?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

(3) Once the locking process is complete, a success notification will appear.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf6t0uRKoRiYin-4fmc69ZJYh-36nDZ3jNXO4NrEoo0k5fmL5xSspe8bf64c1fIFIpWC-upxlFc43bYWa-Qrbsjt5giC8nXmelk5dwNAI_D1Yjtb1q94H7kvX7NuLiaLq85Pzyl?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

### How to Retrieve Your Unique Referral Code to Invite Others

Go to <https://www.ln.exchange> and tap on \[Referral] and select \[Get My Referral Code]. Share your code to invite new users!

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXccZcJDmQFpFda_09N5yLHfAo6eeEFzAvKgDEbFsOwWI2ZukB8U7TIU5CazSdKP442FRsO-3w45ws4tPjTOzMklZZ69G6axHLFgyg0WRtBWbr5uLSKThHNFxuPeob-EDiUYYvWidQ?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf-i8SZDoXFmEKwwoz_K3AahcbgCaJY7lVXbqbuy1lWBj2AeHFoQmsstkRg4ujPM6heK8QwaM8Qn5JJq_9tNW1NnhFPhuqCI7miqodNmq7cyigpk0cRWoIj9rOamU6LMxBA9CirVQ?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

### View Your Invited Users, Trading Rebates & LN Points

You can view your referral stats, Spot & Perpetual Trading Rebates, and LN Points in the \[Referral] Overview section.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeMXC2TN9Sg1PIVGCV9kHSknZuq7mcIQRmvNq_VAS273KFOo3Xifis4vFAUdKVTGipIMvTZviXOl17rvbbVoIR-NwJ3CP5egi2YzZmD4KjugRg5_3e3Ei-VzrqlVA8lMWPgt99YrA?key=0iogqSNmHDm5UU-mE6iWXy44" alt=""><figcaption></figcaption></figure>

***

### How to Join the "Lnfi Community Partner" Exclusive Community:

After locking your TREAT, please approach our Telegram Mod/Volunteer (@lnfiService) to be invited to the Community Partner Exclusive Group.\
\
Join the Lnfi Community Partner Program and become a co-creator of our journey to revolutionize LN Exchange. Together, we’ll achieve milestones, share rewards, and build a stronger, decentralized ecosystem. This is your chance to shape history, earn unparalleled benefits, and drive innovation in the Bitcoin space. Let’s grow and succeed—together!


# Trading Bonus Voucher

To enhance your trading experience, LN Exchange is excited to launch the **Perpetual Trading Bonus Voucher feature.**

{% hint style="info" %}
**Important Notes:**

1. Please use the Trading Bonus within the validity period after receiving them.
2. The unlocked Trading Bonus can be used as a margin for opening positions and to offset losses.
3. Unused Trading Bonus will be automatically reclaimed after expiration.
   {% endhint %}

We sincerely appreciate your support and trust in LN Exchange. If you have any questions, feel free to reach out to our customer support team.

For a detailed guide on how to use the Trading Bonus Voucher, please follow the guide below.

### **What is a Trading Bonus Voucher?**

A Trading Bonus Voucher can be used for Perpetual Trading, offsetting trading fees and funding fees.\
\
To be eligible to claim the Trading Bonus, your Perpetual account must have a minimum cumulative deposit of the required asset. (eg. USDT / TREAT / BURGER). If you do not meet the requirement, please deposit the required amount.

Once claimed, the Trading Bonus must be unlocked before it can be used. To unlock the Trading Bonus, you must achieve a minimum trading volume in the required asset (e.g., USDT, TREAT, or BURGER). The bonus will fully unlock upon reaching the maximum trading volume threshold. Please note that only new trading volume is eligible—previous trades will not be counted toward unlocking the bonus.

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfq-AW4f-aiNjA7YmA6or-CvglfNYvk-lkSBFto8VJx3cRgaWg3YadsjgbyaKNEmFMO5iJHFVBnxsV3yq_4K0LAakHMncTiTXY6ENut-VKysr8TI9XxOHLudKZE2oGqi93jYsPrxA?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

In the image above, you need at least 1,000 USDT in trading volume to begin unlocking. Once you reach 10,000 USDT in trading volume, you'll unlock the full 10 USDT trading bonus.

Any remaining locked Trading Bonus will be reclaimed after expiration. Please use it within the validity period.

Unlocked trading bonuses cannot be withdrawn but any profits earned from trading with the bonus can be withdrawn.

### How to claim your Trading Bonus Voucher?

If you have received a Trading Bonus Voucher, a \[Voucher Icon] will appear on the top bar next to your connected npub address.\
\
Tap on the \[Voucher Icon]

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcn2S48prpAGdZpJl-ZC3cCofFY-WsqpVVzHZApu92BhPQ5uG0Z9ygMTpeqLw6kTZH0TvbLdgIw30LALQ5cL9AU1exkJPgsfp6yXo3yFfbcNQX8wVK_2gnMzejOG-jvK3qrvVAS?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

Tap on \[CLAIM]&#x20;

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXczV9Bu58nW73O_ub9WlVKyBL4AnFVsXBWJWmUjx-Yl1M3a162pITlg-dK-RX1zuNTkhf8o4lTWRtpEnwabyuv2s_3knLkjAMhKSLSEknSx6ZuCINT3ua5uukt91pstzGtW9ljJ?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2C7A4tOVjAqaGI40Am8ZO05cOBKSmJEzZSrdR5snn_WiJT6sBBZhR4Z0jpZkFxwMBl48IOJ71xKyEOXjaIV2S8lVeU4Ybc04Z9TtnKNNYL4PmKQLgHsnfVE1KCiTY2QHsb2JVxw?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

Congrats, you have successfully claimed the Trading Bonus Voucher!

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZASAhrduEGSiG6s5E_o4R-UmAsnESBR-e_Zs5vLso5h_-kiLFSsYqtb2Ko09N5oLxmb92rZ-ZRFAMoAl-XZiarObLF-8rQBBQuHKmKWBaQSY-_pNKXePAfueWpbk8TGr1EoNIsQ?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

You will be able to view it in your Perpetual Trading Account Balance.

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeLlo80NmJPG3KWkNhU62AeuxaseBMGo07O-gLSfTVrZbwhZoQxfwh0nsu1eRtR9WQQveb_YmSZ0pm4TPW88iiRFOLpSCD4VKnm5RWICCM7MBOeI4lDrypRkkYGiU092PVr5Hw6ww?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

Or go to Account > Perpetual > Trading Bonus Voucher

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdXb42Ie0SE3zRszXi45m9UQZLB_EjN8_9NJRn6IlSgV-PYdi9Y2PuSrkeAIMxN0zclgFRmJmzAqZWWMH1PanuokvqAoC5hxwkFmGtuXqMMzfwZSIMzH52ewCvEt20q-i-9lR4Q7g?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

Reminder: The Trading Bonus Voucher has an expiry date. Trade the required volume to unlock it fully before it expires.

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXerr6TDMGU50bGVZOv8u0JvihVwke715rL5EkHYa-QWn7D8UI8RnpyGCOmP-afK-__-RzrNM-bHIdcagngKg2YwdB6fozcurl0HVkfsBp0Hde8ajteXdxBvVebO42yPJyQ3pu1yeQ?key=qYPilUL7BXaYEOs5AuZf-s0K" alt=""><figcaption></figcaption></figure></div>

<br>


# API

LN Exchange [Spot Trading API](/api/spot-trading-api)\
LN Exchange [Perpetual Trading API](/api/perpetual-trading-api)


# Spot Trading API

LN Exchange Spot Trading API

### Unified interface domain name:

Test environment:

{% hint style="info" %}
REST：<https://test-spots-api.ln.exchange>

WebSocket：wss\://test-spots-ws.ln.exchange/kline-api/ws
{% endhint %}

***

## Introduction

### Obtain API Key <a href="#uedxn" id="uedxn"></a>

Many API endpoints require an API Key for access. To obtain an API Key:

1. Create a user account on the platform.
2. Import a Nostr address to the account.
3. Retrieve your API Key. \
   **Note: The API Key is displayed only once. Keep it secure and do not share it.**

### Signature <a href="#ytpwl" id="ytpwl"></a>

To sign requests, follow these steps:

1. Sort parameters in ascending lexicographical order by parameter names.
2. Concatenate all parameters in `key=value` format.
3. Append your private key to the concatenated string.
4. Use MD5 to hash the string for signing.

{% code title="Example" lineNumbers="true" %}

```
String decodingSecret = "123456";
// First, sort the parameters in ascending order by their parameter names
Map<String, Object> sortedParams = new TreeMap<String, Object>(params);
Set<Map.Entry<String, Object>> entrys = sortedParams.entrySet();
// Traverse the sorted dictionary and concatenate all parameters in the "keyvalue" format
StringBuilder basestring = new StringBuilder();
for (Map.Entry<String, Object> param : entrys) {
    // Skip the signature field
    if("sign".equals(param.getKey())){
        continue;
    }

    if(!StringUtils.isBlank(param.getValue().toString())) {
        basestring.append(param.getKey());
        basestring.append(param.getValue().toString());
    }
}
basestring.append(decodingSecret);
// Use MD5 to sign the concatenated string
String curSign = MD5Util.getMD5(basestring.toString());
```

{% endcode %}

### **REST Authentication**

All REST private request headers must contain the following

#### **Request header parameters**

| Parameter Name | Type   | Required | Description        |
| -------------- | ------ | -------- | ------------------ |
| apikey         | String | Yes      | API key            |
| time           | String | Yes      | 13-digit timestamp |
| sign           | String | Yes      | Signature          |

***

## API section-OPEN:

### Access to public information

* **URL**：`/napi/common/public_info`
* **Method**：`GET`
* **Login required**: N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameter

| Parameters           | Type   | Description                     |
| -------------------- | ------ | ------------------------------- |
| nostrAddress         | String | Nostr address                   |
| wsUrl                | String | WebSocket connection address    |
| currentTimeMillis    | String | current timestamp               |
| coinList             | List   | currency List                   |
| coin                 | String | currency Name                   |
| precious             | String | currency precision              |
| symbolList           | List   | transaction Pair List           |
| id                   | String | transaction pair ID             |
| symbolName           | String | currency exchange name          |
| symbol               | String | transaction Pair Symbol         |
| makerFee             | String | Maker fees                      |
| takerFee             | String | Taker fee                       |
| base                 | String | base Currency                   |
| quote                | String | pricing Currency                |
| sort                 | String | sort Value                      |
| robot                | String | robot Address                   |
| symbolPricePrecision | String | trading Pair Price Precision    |
| minOrderVolume       | String | minimum Order Quantity          |
| minOrderMoney        | String | minimum Order Amount            |
| maxMarketVolume      | String | maximum Market Order Volume     |
| maxMarketMoney       | String | maximum Market Order Amount     |
| maxLimitVolume       | String | maximum Limit Order Quantity    |
| maxLimitMoney        | String | maximum Limit Order Amount      |
| coinPrecision        | String | currency precision              |
| depth                | List   | coin Pair Depth Precision Array |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "nostrAddress": "npub1gxns2uvk2rkhtzsk3mxa4ey3d3x375a9q7jc54qkt4j367rgrzwqv76xss",
        "wsUrl": "wss://dev-ln-spotws.ln.exchange/kline-api/ws",
        "currentTimeMillis": 1712456190308,
        "coinList": [
            {
                "coin": "BTC",
                "precious": 5
            },
            {
                "coin": "USDT",
                "precious": 4
            },
            {
                "coin": "ETH",
                "precious": 4
            },
            {
                "coin": "TREAT",
                "precious": 4
            }
        ],
        "symbolList": [
            {
                "id": 62,
                "symbolName": "TREAT-USDT",
                "symbol": "TREAT-USDT",
                "makerFee": 0.00080000,
                "takerFee": 0.00100000,
                "base": "TREAT",
                "quote": "USDT",
                "sort": 30,
                "robot": "npub1gxns2uvk2rkhtzsk3mxa4ey3d3x375a9q7jc54qkt4j367rgrzwqv76xss",
                "symbolPricePrecision": 2,
                "minOrderVolume": 1,
                "minOrderMoney": 1.0000000000000000,
                "maxMarketVolume": 90000000,
                "maxMarketMoney": 90000000.0000000000000000,
                "maxLimitVolume": 90000000,
                "maxLimitMoney": 90000000.0000000000000000,
                "coinPrecision": 4,
                "depth": [
                    "2",
                    "1",
                    "0"
                ]
            },
            {
                "id": 18,
                "symbolName": "BTC-USDT",
                "symbol": "BTC-USDT",
                "makerFee": 0.00080000,
                "takerFee": 0.00100000,
                "base": "BTC",
                "quote": "USDT",
                "sort": 1,
                "robot": "npub1gsl6fq6ntvxenym764z48qptvn3dctesah3acm03rfglwac7pxjsca7uyp",
                "symbolPricePrecision": 2,
                "minOrderVolume": 0,
                "minOrderMoney": 1.0000000000000000,
                "maxMarketVolume": 10000,
                "maxMarketMoney": 1000000.0000000000000000,
                "maxLimitVolume": 100000,
                "maxLimitMoney": 1000000.0000000000000000,
                "coinPrecision": 5,
                "depth": [
                    "2",
                    "1",
                    "0"
                ]
            }
        ]
    },
    "succ": true
}
```

***

### Get list of outstanding orders

* **URL**：`/open/v1/openOrders`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | yes      | currency exchange name |

**Request Example**

```json
{"symbolName":"BTC-USDT"}
```

#### Return parameter

| Parameters   | Type   | Description                                                                                              |
| ------------ | ------ | -------------------------------------------------------------------------------------------------------- |
| orderId      | String | order id                                                                                                 |
| symbolName   | String | currency exchange name                                                                                   |
| price        | String | order Price                                                                                              |
| origQty      | String | order quantity                                                                                           |
| executedQty  | String | number of transactions                                                                                   |
| avgPrice     | String | average Transaction Price                                                                                |
| status       | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired) |
| type         | String | order Type (1 limit; 2 market;)                                                                          |
| timeInForce  | String | order Type (1 limit; 2 market;)                                                                          |
| side         | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                              |
| transactTime | String | creation time                                                                                            |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "side": "BUY",
            "executedQty": 0E-16,
            "orderId": 2110961582587810435,
            "price": 65000.0000000000000000,
            "origQty": 1.0000000000000000,
            "avgPrice": 0E-8,
            "transactTime": 1710825215000,
            "action": "OPEN",
            "symbolName": "BTC-USDT",
            "type": "LIMIT",
            "timeInForce": "",
            "status": "INIT"
        }
    ],
    "succ": true
}
```

***

### Get Transaction Details

* **URL**：`/open/v1/myTrades`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description                                          |
| -------------- | ------ | -------- | ---------------------------------------------------- |
| symbolName     | String | Yes      | Currency exchange name                               |
| limit          | String | no       | get the number of bars: the default 100 maximum 1000 |
| fromId         | String | no       | query start ID (this ID is not included)             |

**Request Example**

```json
{"symbolName":"BTC-USDT","limit":"100","fromId":"123456"}
```

#### Return parameter

| Parameters | Type   | Description                                   |
| ---------- | ------ | --------------------------------------------- |
| price      | String | transaction Price                             |
| volume     | String | number of transactions                        |
| amount     | String | transaction amount                            |
| symbolName | String | currency exchange name                        |
| time       | String | transaction Time                              |
| side       | String | BUY and SELL direction (BUY BUY, SELL SELL)   |
| fee        | String | fees                                          |
| bidId      | String | pay id                                        |
| askId      | String | selling order id                              |
| bidUserId  | String | pay user ID                                   |
| askUserId  | String | sell order user ID                            |
| isBuyer    | String | buyer (true buyer, false seller)              |
| tradeId    | String | the ID of the transaction details.            |
| isMaker    | String | pendant (ture order taker, false order taker) |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "amount": 67000.000,
            "side": "BUY",
            "fee": "0.0008",
            "isMaker": true,
            "isBuyer": true,
            "bidId": 2110903085133234196,
            "bidUserId": 90000123,
            "volume": 1.0000000000000000,
            "price": 67000.0000000000000000,
            "askId": 2110903085133234197,
            "symbolName": "BTC-USDT",
            "time": 1710695925000,
            "tradeId": 1154932,
            "askUserId": 90000123
        }
    ],
    "succ": true
}
```

***

### Batch Order & Batch Withdrawal

* **URL**：`/open/v1/batchOrders`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description                                             |
| -------------- | ------ | -------- | ------------------------------------------------------- |
| symbolName     | String | Yes      | currency exchange name                                  |
| orders         | List   | yes      | order List                                              |
| side           | String | yes      | BUY and SELL direction (BUY BUY, SELL SELL)             |
| type           | String | yes      | order type (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY) |
| volume         | String | yes      | order quantity                                          |
| price          | String | no       | order Price                                             |
| clientOrderId  | String | no       | client order ID                                         |
| orderIds       | List   | yes      | list of cancellation ID                                 |

**Request Example（Bulk order）**

```json
{"symbolName":"BTC-USDT","orders":"[{\"volume\":1,\"side\":\"BUY\",\"price\":60000,\"type\":1}]"}
```

**Request Example（Batch withdrawal）**

```json
{"symbolName":"BTC-USDT","orderIds":[2116489841153081344,2116489841153081345]}
```

#### Return parameter

| Parameters | Type | Description              |
| ---------- | ---- | ------------------------ |
| ids        | List | successful order ID list |
| cancelIds  | List | order withdrawal ID list |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "ids": [
            "2116489841153081344"
        ],
        "cancelIds": []
    },
    "succ": true
}
```

***

### Get depth list

* **URL**：`/open/v1/depth`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| symbolName     | String | Yes      | Currency exchange name                              |
| limit          | String | no       | get the number of bars: the default 100 maximum 100 |

**Request Example**

```json
{"symbolName":"BTC-USDT","limit":"100"}
```

#### Return parameter

| Parameters | Type   | Description      |
| ---------- | ------ | ---------------- |
| asks       | String | sell order depth |
| bids       | String | paying Depth     |
| time       | String | latest timestamp |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "asks": [
            [
                65810,
                0.9845
            ],
            [
                65794,
                1.2804
            ],
            [
                65761,
                1.3675
            ]
        ],
        "bids": [
            [
                65834,
                1.4365
            ],
            [
                65992,
                1.4689
            ],
            [
                66008,
                0.242
            ]
        ],
        "time": null
    },
    "succ": true
}
```

***

### Batch withdrawal of all orders

* **URL**：`/open/v1/cancelAll`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | currency exchange name |

**Request Example**

```json
{"symbolName":"BTC-USDT"}
```

#### Return parameter

| Parameters | Type | Description |
| ---------- | ---- | ----------- |
|            |      |             |

#### Return Results

```json
{
    "code": 0,
    "msg": "SUCCESS",
    "time": 1707121453886,
    "data": []
}
```

***

### View account balance

* **URL**：`/open/v1/account`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameter

| Parameters    | Type   | Description |
| ------------- | ------ | ----------- |
| balanceList   | List   | asset List  |
| accountNormal | String | available   |
| accountLock   | String | freeze      |
| coin          | String | currency    |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "balanceList": [
            {
                "accountNormal": "13.75386926",
                "accountLock": "0",
                "coin": "BTC"
            },
            {
                "accountNormal": "475114.11",
                "accountLock": "257869.5337",
                "coin": "USDT"
            },
            {
                "accountNormal": "0",
                "accountLock": "0",
                "coin": "ETH"
            },
            {
                "accountNormal": "989997",
                "accountLock": "1",
                "coin": "TREAT"
            }
        ]
    },
    "succ": true
}
```

***

## API part-NAPI-direct call:

### Interaction-Nostr part:

Before requesting any interface, you must sign the Request Parameters via the Nostr protocol.

#### **Parameter Description**

| Parameter Name | Type   | Required | Description                                                                                                                              |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| sig            | String | yes      | Event entire signature                                                                                                                   |
| kind           | String | yes      | Event Type:(1 plaintext; 4 ciphertext;)                                                                                                  |
| created\_at    | String | yes      | Event timestamp                                                                                                                          |
| id             | String | yes      | Event message ID                                                                                                                         |
| content        | String | yes      | Event Content: (AES/CBC/PKCS5Padding) encryption required,(? The first half of iv =) is base64Message ,(? The second half of iv =) is iv |
| pubkey         | String | yes      | Fields returned by the public\_info interface: nostrAddress                                                                              |
| tags           | String | yes      | p: User nostrAddress r:json                                                                                                              |

**Request Sample**

```json
{
    "sig": "5375cda2249722881fdfd9fdd69edd861e93769f596ad76dfded3e576835b24406c52e66e85cf891630c7e088007fdf9dd282fadc47cdc0cd7a35f3fe71a385d",
    "kind": 4,
    "created_at": 1710325923,
    "id": "503c2610bb82b3672ccae9f8c8686672f245e2a837ad4bd50974481533d1d754",
    "content": "7moMWXa8coPGUJ20AosrlDJozo9kGgmtmgs2xlJnRXdOVyRGepCje1FeoYBfa4UPBO7nIC7F5Ii8nNiyahMZFA==?iv=EmF1gfPCxiiJiDANRtvUrA==",
    "pubkey": "0077fe56d9e72bff869021308c74ac79ce6d6f103a4f7e2b3db088ac0bfcf324",
    "tags": [
        [
            "p",
            "443fa483535b0d99937ed54553802b64e2dc2f30ede3dc6df11a51f7771e09a5"
        ],
        [
            "r",
            "json"
        ]
    ]
}
```

***

### Access to public information

* **URL**：`/napi/common/public_info`
* **Method**：`GET`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameter

| Parameters           | Type   | Description                     |
| -------------------- | ------ | ------------------------------- |
| nostrAddress         | String | Nostr address                   |
| wsUrl                | String | WebSocket connection address    |
| currentTimeMillis    | String | current timestamp               |
| coinList             | List   | currency List                   |
| coin                 | String | currency Name                   |
| precious             | String | currency precision              |
| symbolList           | List   | transaction Pair List           |
| id                   | String | transaction pair ID             |
| symbolName           | String | currency exchange name          |
| symbol               | String | transaction Pair Symbol         |
| makerFee             | String | Maker fees                      |
| takerFee             | String | Taker fee                       |
| base                 | String | base Currency                   |
| quote                | String | pricing Currency                |
| sort                 | String | sort Value                      |
| robot                | String | robot Address                   |
| symbolPricePrecision | String | trading Pair Price Precision    |
| minOrderVolume       | String | minimum Order Quantity          |
| minOrderMoney        | String | minimum Order Amount            |
| maxMarketVolume      | String | Maximum Market Order Volume     |
| maxMarketMoney       | String | maximum Market Order Amount     |
| maxLimitVolume       | String | maximum Limit Order Quantity    |
| maxLimitMoney        | String | maximum Limit Order Amount      |
| coinPrecision        | String | currency precision              |
| depth                | List   | coin Pair Depth Precision Array |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "nostrAddress": "npub1gxns2uvk2rkhtzsk3mxa4ey3d3x375a9q7jc54qkt4j367rgrzwqv76xss",
        "wsUrl": "wss://dev-ln-spotws.ln.exchange/kline-api/ws",
        "currentTimeMillis": 1712456190308,
        "coinList": [
            {
                "coin": "BTC",
                "precious": 5
            },
            {
                "coin": "USDT",
                "precious": 4
            },
            {
                "coin": "ETH",
                "precious": 4
            },
            {
                "coin": "TREAT",
                "precious": 4
            }
        ],
        "symbolList": [
            {
                "id": 62,
                "symbolName": "TREAT-USDT",
                "symbol": "TREAT-USDT",
                "makerFee": 0.00080000,
                "takerFee": 0.00100000,
                "base": "TREAT",
                "quote": "USDT",
                "sort": 30,
                "robot": "npub1gxns2uvk2rkhtzsk3mxa4ey3d3x375a9q7jc54qkt4j367rgrzwqv76xss",
                "symbolPricePrecision": 2,
                "minOrderVolume": 1,
                "minOrderMoney": 1.0000000000000000,
                "maxMarketVolume": 90000000,
                "maxMarketMoney": 90000000.0000000000000000,
                "maxLimitVolume": 90000000,
                "maxLimitMoney": 90000000.0000000000000000,
                "coinPrecision": 4,
                "depth": [
                    "2",
                    "1",
                    "0"
                ]
            },
            {
                "id": 18,
                "symbolName": "BTC-USDT",
                "symbol": "BTC-USDT",
                "makerFee": 0.00080000,
                "takerFee": 0.00100000,
                "base": "BTC",
                "quote": "USDT",
                "sort": 1,
                "robot": "npub1gsl6fq6ntvxenym764z48qptvn3dctesah3acm03rfglwac7pxjsca7uyp",
                "symbolPricePrecision": 2,
                "minOrderVolume": 0,
                "minOrderMoney": 1.0000000000000000,
                "maxMarketVolume": 10000,
                "maxMarketMoney": 1000000.0000000000000000,
                "maxLimitVolume": 100000,
                "maxLimitMoney": 1000000.0000000000000000,
                "coinPrecision": 5,
                "depth": [
                    "2",
                    "1",
                    "0"
                ]
            }
        ]
    },
    "succ": true
}
```

***

### Get the latest transaction information for all coins.

* **URL**：`/napi/common/all_markets�`
* **Method**：`GET`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameter

| Parameters    | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| symbolName    | String | currency exchange name                |
| rose          | String | 24-hour rise and fall                 |
| latestPrice   | String | latest Price                          |
| previousPrice | String | last price (penultimate latest price) |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "symbolName": "TREAT-USDT",
            "rose": "0.08135593",
            "latestPrice": "3.19",
            "previousPrice": "3.18"
        },
        {
            "symbolName": "BTC-USDT",
            "rose": "0.0094292155",
            "latestPrice": "70477.51",
            "previousPrice": "70472.75"
        }
    ],
    "succ": true
}
```

***

### Get depth list

* **URL**：`/napi/market/depth`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| symbolName     | String | Yes      | currency exchange name                              |
| limit          | String | no       | get the number of bars: the default 100 maximum 100 |
|                |        |          |                                                     |

**Request Example**

```json
{"symbolName":"BTC-USDT","limit":"100"}
```

#### Return parameter

| Parameters | Type   | Description      |
| ---------- | ------ | ---------------- |
| asks       | String | sell order depth |
| bids       | String | paying Depth     |
| time       | String | latest timestamp |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "asks": [
            [
                65810,
                0.9845
            ],
            [
                65794,
                1.2804
            ],
            [
                65761,
                1.3675
            ]
        ],
        "bids": [
            [
                65834,
                1.4365
            ],
            [
                65992,
                1.4689
            ],
            [
                66008,
                0.242
            ]
        ],
        "time": null
    },
    "succ": true
}
```

***

### Open currency exchange account

* **URL**：`/napi/user/enable_trade`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | Currency exchange name |

**Request Example**

```json
{"symbolName":"BTC-USDT"}
```

#### Return parameter

| Parameters | Type   | Description              |
| ---------- | ------ | ------------------------ |
| code       | String | successful opening for 0 |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": true,
    "succ": true
}
```

***

### Get user current delegate and current conditional delegate count

* **URL**：`/napi/order/get_user_order_count`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | currency exchange name |

**Request Example**

```json
{"symbolName":"BTC-USDT"}
```

#### Return parameter

| Parameters        | Type   | Description                      |
| ----------------- | ------ | -------------------------------- |
| orderCount        | String | normal Current Delegation Count  |
| triggerOrderCount | String | condition Current Delegate Count |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "orderCount": 1,
        "triggerOrderCount": 0
    },
    "succ": true
}
```

***

### Get the list of current delegates

* **URL**：`/napi/order/current_order_list`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | currency exchange name |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"symbolName":"BTC-USDT","page":1,"limit":100}
```

#### Return parameter

| Parameters     | Type   | Description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | Order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| symbolName     | String | currency exchange name                                                                                                                       |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "684db9069089bfb339fcc64ed89f91eb9ac9870ca569b8286286d90428bde804",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "positionType": 1,
                "avgPrice": 0E-8,
                "tradeFee": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710832100000,
                "volume": 1.0000000000000000,
                "dealVolume": 0E-16,
                "price": 60000.0000000000000000,
                "ctime": 1710832100000,
                "symbolName": "BTC-USDT",
                "id": "2115623941386416880",
                "orderBalance": 60000.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 0E-16,
                "status": 0
            }
        ]
    },
    "succ": true
}
```

***

### Obtain the historical delegation list.

* **URL**：`/napi/order/history_order_list`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | currency exchange name |
| wallet         | String | Yes      | wallet address         |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"symbolName":"BTC-USDT","wallet":"npub18luy0zu5gmllkwsyel3xaz5h33qgschq6kt7es3vuezg749pkdjs941234","page":1,"limit":200}
```

#### Return parameter

| Parameters     | Type   | Description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | Order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| symbolName     | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 6,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "avgPrice": 65000.00000000,
                "tradeFee": 0.0005307400000000,
                "realizedAmount": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710830986000,
                "volume": 1.0000000000000000,
                "dealVolume": 0.7582000000000000,
                "price": 65000.0000000000000000,
                "ctime": 1710825215000,
                "symbolName": "BTC-USDT",
                "id": "2110961582587810435",
                "orderBalance": 15717.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 49283.0000000000000000,
                "status": 2
            }
        ]
    },
    "succ": true
}
```

***

### Get the list of current plan delegations

* **URL**：`/napi/order/trigger_order_list`
* **Method**：`POST`
* Login require&#x64;**：**&#x59;

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | Yes      | currency exchange name |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"symbolName":"BTC-USDT","page":1,"limit":100}
```

#### Return parameter

| Parameters     | Type   | Description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | total                                                                                                                                        |
| trigOrderList  | List   | planned Order                                                                                                                                |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| triggerPrice   | String | trigger Price                                                                                                                                |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | Order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| expireTime     | String | condition Order Expiration Time                                                                                                              |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| symbolName     | String | currency exchange name                                                                                                                       |
| id             | String | order ID                                                                                                                                     |
| triggerType    | String | condition sheet type (1 stop loss,2 take profit,3 stop loss limit,4 take profit limit)                                                       |
| timeInForce    | String | effective Way (1 GTC, 2 IOC, 3 FOK, 4GTX, 5 PostOnly)                                                                                        |
| status         | String | valid Status (0 Valid, 1 Expired, 2 Completed, 3 Trigger Failed)                                                                             |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "trigOrderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "87bea8e5ddeee5d3c7ea218ec3b83524128750906e67e4cd9d5ad10517ec8e3c",
                "side": "BUY",
                "triggerPrice": 60000.0000000000000000,
                "memo": 0,
                "type": 1,
                "mtime": 1710837111000,
                "volume": 1.0000000000000000,
                "expireTime": 1712046712000,
                "price": 55000.0000000000000000,
                "ctime": 1710837111000,
                "symboltName": "BTC-USDT",
                "id": "887",
                "triggerType": 4,
                "timeInForce": 1,
                "status": 0
            }
        ]
    },
    "succ": true
}
```

***

### Get historical plan delegation list

* **URL**：`/napi/order/history_trigger_order_list`
* **Method**：`POST`
* **Login required：**&#x59;

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | yes      | currency exchange name |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"symbolName":"BTC-USDT","page":1,"limit":100}
```

#### Return parameter

| Parameters     | Type   | Description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | total                                                                                                                                        |
| trigOrderList  | List   | planned Order                                                                                                                                |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| triggerPrice   | String | trigger Price                                                                                                                                |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | Order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| expireTime     | String | condition Order Expiration Time                                                                                                              |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| symbolName     | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| triggerType    | String | condition sheet type (1 stop loss,2 take profit,3 stop loss limit,4 take profit limit)                                                       |
| timeInForce    | String | effective Way (1 GTC, 2 IOC, 3 FOK, 4GTX, 5 PostOnly)                                                                                        |
| status         | String | valid Status (0 Valid, 1 Expired, 2 Completed, 3 Trigger Failed)                                                                             |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "trigOrderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "87bea8e5ddeee5d3c7ea218ec3b83524128750906e67e4cd9d5ad10517ec8e3c",
                "side": "BUY",
                "triggerPrice": 60000.0000000000000000,
                "memo": 1,
                "type": 1,
                "mtime": 1710838297000,
                "volume": 1.0000000000000000,
                "expireTime": 1710838297000,
                "price": 55000.0000000000000000,
                "ctime": 1710837111000,
                "symbolName": "BTC-USDT",
                "id": "887",
                "triggerType": 4,
                "timeInForce": 1,
                "status": 4
            }
        ]
    },
    "succ": true
}
```

***

### Get historical transaction list

* **URL**：`/napi/order/his_trade_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| **Parameter Name** | **Type** | **Required** | **Description**        |
| ------------------ | -------- | ------------ | ---------------------- |
| symbolName         | String   | Yes          | currency exchange name |
| page               | String   | no           | page number: Default 1 |
| limit              | String   | no           | number: default 100    |

**Request Example**

```json
{"symbolName":"BTC-USDT","page":1,"limit":100}
```

#### Return parameter

| Parameters       | Type   | Description                                                        |
| ---------------- | ------ | ------------------------------------------------------------------ |
| count            | String | total                                                              |
| tradeHisList     | List   | transaction Order List                                             |
| symbol           | String | transaction Pair                                                   |
| pricePrecision   | String | price precision                                                    |
| eventId          | String | event ID                                                           |
| side             | String | BUY and SELL direction (BUY BUY, SELL SELL)                        |
| role             | String | active one-way direction:(Maker hangs one-way, Taker eats one-way) |
| fee              | String | fees                                                               |
| realizedAmount   | String | accumulated profit and loss of order                               |
| feeCoinPrecision | String | currency Display Precision                                         |
| volume           | String | number of transactions                                             |
| feeCoin          | String | fee Currency                                                       |
| price            | String | transaction Price                                                  |
| ctime            | String | transaction Time                                                   |
| symbolName       | String | currency exchange name                                             |
| id               | String | transaction ID                                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 3,
        "tradeHisList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "role": "Maker",
                "fee": 0.0002895900000000,
                "realizedAmount": 0E-16,
                "feeCoinPrecision": 4,
                "volume": 0.4137000000000000,
                "feeCoin": "USDT",
                "price": 65000.0000000000000000,
                "ctime": 1710830986000,
                "symbolName": "BTC-USDT",
                "id": "1156731"
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Market Data

* **URL**：`/napi/order/history_order_list_explorer`
* **Method**：`POST`
* Login required：N

#### Request Parameters

| Parameter Name | Type   | Required | Description                         |
| -------------- | ------ | -------- | ----------------------------------- |
| symbolName     | String | yes      | currency exchange name              |
| wallet         | String | no       | wallet address or eventId retrieval |
| page           | String | no       | page number: Default 1              |
| limit          | String | no       | number: default 100                 |
| type           | String | no       | order Type (1 limit; 2 market;)     |

**Request Example**

```json
{"symbolName":"BTC-USDT","wallet":"npub18luy0zu5gmllkwsyel3xaz5h33qgschq6kt7es3vuezg749pkdjs941234","page":1,"limit":200}
```

#### Return parameter

| Parameters     | Type   | description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | Order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| symbolName     | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 6,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "avgPrice": 65000.00000000,
                "tradeFee": 0.0005307400000000,
                "realizedAmount": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710830986000,
                "volume": 1.0000000000000000,
                "dealVolume": 0.7582000000000000,
                "price": 65000.0000000000000000,
                "ctime": 1710825215000,
                "symbolName": "BTC-USDT",
                "id": "2110961582587810435",
                "orderBalance": 15717.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 49283.0000000000000000,
                "status": 2
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Market Data-Details

* **URL**：`/napi/order/his_trade_list_explorer`
* **Method**：`POST`
* **Login required：**&#x4E;

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| symbolName     | String | yes      | currency exchange name |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |
| orderId        | String | yes      | order ID               |

**Request Example**

```json
{"symbolName":"BTC-USDT","orderId":"2115630744614604870","page":1,"limit":100}
```

#### Return parameter

| Parameters       | Type   | Description                                                        |
| ---------------- | ------ | ------------------------------------------------------------------ |
| count            | String | total                                                              |
| tradeHisList     | List   | transaction Order List                                             |
| symbol           | String | transaction Pair                                                   |
| pricePrecision   | String | price precision                                                    |
| eventId          | String | event ID                                                           |
| side             | String | BUY and SELL direction (BUY BUY, SELL SELL)                        |
| role             | String | active one-way direction:(Maker hangs one-way, Taker eats one-way) |
| fee              | String | fees                                                               |
| realizedAmount   | String | accumulated profit and loss of order                               |
| feeCoinPrecision | String | currency Display Precision                                         |
| volume           | String | number of transactions                                             |
| feeCoin          | String | fee Currency                                                       |
| price            | String | transaction Price                                                  |
| ctime            | String | transaction Time                                                   |
| symbolName       | String | currency exchange name                                             |
| id               | String | transaction ID                                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 3,
        "tradeHisList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "role": "Maker",
                "fee": 0.0002895900000000,
                "realizedAmount": 0E-16,
                "feeCoinPrecision": 4,
                "volume": 0.4137000000000000,
                "feeCoin": "USDT",
                "price": 65000.0000000000000000,
                "ctime": 1710830986000,
                "symbolName": "BTC-USDT",
                "id": "1156731"
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Money Flow

* **URL**：`/napi/trade/get_transaction_list_explorer`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                                                                                                                    |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| address        | String | no       | wallet address                                                                                                                                 |
| symbol         | String | no       | currency                                                                                                                                       |
| page           | String | no       | page number: Default 1                                                                                                                         |
| limit          | String | no       | number: default 100                                                                                                                            |
| type           | String | no       | type of flowing water (1 transfer-in 2 Transfer-out 6 Transaction Fee 13 Order Freeze 14 Order Cancellation Unfreeze 15 Transaction Transfer ) |

**Request Example**

```json
{"limit":20,"page":1,"type":"13","symbol":"USDT","address":""}
```

#### Return parameter

| Parameters     | Type   | Description                                                                                                                                    |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| ctimeL         | String | create timestamp                                                                                                                               |
| fromCoinSymbol | String | from Currency Name                                                                                                                             |
| toCoinSymbol   | String | to Currency Name                                                                                                                               |
| type           | String | type of flowing water (1 transfer-in 2 Transfer-out 6 Transaction Fee 13 Order Freeze 14 Order Cancellation Unfreeze 15 Transaction Transfer ) |
| amount         | String | quantity                                                                                                                                       |
| fromAddress    | String | from user address                                                                                                                              |
| toAddress      | String | to User Address                                                                                                                                |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "transList": [
            {
                "symbol": "btcusdt",
                "eventId": 4826157,
                "amount": "24303.211464",
                "type": 14,
                "toAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "toCoinSymbol": "USDT",
                "ctime": "2024-03-19 14:15:01",
                "fromCoinSymbol": "USDT",
                "fromAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "id": 4826157,
                "ctimeL": 1710857701000
            },
            {
                "symbol": "btcusdt",
                "eventId": 4826156,
                "amount": "30863.870946288",
                "type": 15,
                "toAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "toCoinSymbol": "USDT",
                "ctime": "2024-03-19 14:15:01",
                "fromCoinSymbol": "USDT",
                "fromAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "id": 4826156,
                "ctimeL": 1710857701000
            }
        ],
        "count": 9331
    },
    "succ": true
}
```

***

## API section-NAPI- RELAY instruction :

### Create User

* **URL**：`/napi/user/create_user`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description               |
| -------------- | ------ | -------- | ------------------------- |
| nostrAddress   | String | yes      | nostr protocol address    |
| sign           | String | no       | value after eth signature |
| broker         | String | yes      | merchant id: fixed 1000   |
| ethAddress     | String | yes      | eth address               |
| time           | String | yes      | latest timestamp          |
| referrals      | String | no       | invitation Code           |

**Request Example**

```json
{"nostrAddress":"npub1wmp4k62sqmw3plv6eu53p9rzpufxr09er25dlxrhjfzgsa644g8skxh943","sign":"0x83e814031c2e9d45202a3cabbe6cf2bdb28f55fc7c18f8f2280a4b162b0df87d4e66a1b9cd7c54d198321b65bcec022a41e5529a911cc3539b61a6978d34ac161b","broker":1000,"ethAddress":"0x29c044869E937DF22c47DeEe554E1D257858bf99","time":1711444596754,"referrals":"0x123444869E937DF22c47DeEe554E1D2123456789"}
```

#### Return parameter

| Parameters | Type   | description      |
| ---------- | ------ | ---------------- |
| code       | String | 0 is successful. |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": "null",
    "succ": "true"
}
```

***

### Limit Order & Market Order & Plan Order by Order

* **URL**：`/napi/order/order_create`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                                                             |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| side             | String | yes      | BUY and SELL direction (BUY BUY, SELL SELL)                                             |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not)                                |
| type             | String | yes      | order type (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY)                                 |
| volume           | String | yes      | order quantity (open market price order: Amount)                                        |
| symbolName       | String | yes      | currency exchange name                                                                  |
| price            | String | yes      | order Price                                                                             |
| clientId         | String | no       | client order ID                                                                         |
| triggerPrice     | String | yes      | trigger Price                                                                           |
| source           | String | yes      | order source (order Source: 1web,2app,3api,4 others)                                    |
| triggerType      | String | yes      | condition order type (0 normal condition order, 3 stop loss limit, 4 take profit limit) |
| expiredTime      | String | yes      | effective duration of conditional sheet                                                 |
| ctime            | String | yes      | creation time                                                                           |
| timeInForce      | String | yes      | effective Way (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY)                              |

**Request Example**

```json
{"side":"buy","isConditionOrder":false,"clientId":"web39","triggerPrice":0,"kind":10,"source":1,"type":1,"triggerType":1,"expiredTime":30,"volume":1,"price":60000,"ctime":1710843099430,"symbolName":"BTC-USDT","timeInForce":2}
```

#### Return parameter

| Parameters | Type | Description              |
| ---------- | ---- | ------------------------ |
| ids        | List | successful order ID list |
| cancelIds  | List | order withdrawal ID list |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "ids": [
            "2115627033762860615"
        ],
        "cancelIds": []
    },
    "succ": true
}
```

***

### Cancellation & Cancellation of Plan Delegation

* **URL**：`/napi/order/order_cancel`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                              |
| ---------------- | ------ | -------- | -------------------------------------------------------- |
| orderId          | String | yes      | order ID                                                 |
| clientId         | String | no       | client order ID                                          |
| symbolName       | String | yes      | currency exchange name                                   |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not) |

**Request Example**

```json
{"symbolName":"BTC-USDT","orderId":"2115623941386416880","isConditionOrder":false}
```

#### Return parameter

| Parameters | Type | description                      |
| ---------- | ---- | -------------------------------- |
| cancelIds  | List | list of successful withdrawal ID |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "cancelIds": [
            "2115627377360243492"
        ]
    },
    "succ": true
}
```

### All Cancellation Orders & All Cancellation Plan Delegation

* **URL**：`/napi/order/order_cancel_all`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                              |
| ---------------- | ------ | -------- | -------------------------------------------------------- |
| symbolName       | String | yes      | currency exchange name                                   |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not) |

**Request Example**

```json
{"symbolName":"BTC-USDT","isConditionOrder":false}
```

#### Return parameter

| Parameters | Type | description                      |
| ---------- | ---- | -------------------------------- |
| cancelIds  | List | list of successful withdrawal ID |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "cancelIds": [
            "2115627377360243492"
        ]
    },
    "succ": true
}
```

***

## WSS Section:

### OrderBook

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_depth_step0","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_depth_step0",
    "data": null,
    "tick": {
        "asks": [
            [
                68265,
                0.1528
            ]
        ],
        "buys": [
            [
                68195,
                0.1911
            ]
        ]
    },
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Latest Transaction (Full Volume)

#### Subscription Parameters

```javascript
{"event":"req","params":{"channel":"market_e_btcusdt_trade_ticker","cb_id":"e_btcusdt","top":100}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_trade_ticker",
    "data": [
        {
            "amount": "13973.44819",
            "ds": "2024-03-18 19:46:03",
            "price": "68329.82",
            "side": "SELL",
            "ts": 1710762363430,
            "vol": "0.2045"
        }
    ],
    "tick": null,
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Latest Deal (Increment)

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_usdt_btcusdt_trade_ticker","cb_id":"e_btcusdt","top":100}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_trade_ticker",
    "data": null
    "tick": {
            "amount": "13973.44819",
            "ds": "2024-03-18 19:46:03",
            "price": "68329.82",
            "side": "SELL",
            "ts": 1710762363430,
            "vol": "0.2045"
        },
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Trading Pair Real-Time Price Trading Volume

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_ticker","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_ticker",
    "data": null,
    "tick": {
        "amount": "15076475.921172",
        "close": "68264.21",
        "high": "68935.29",
        "low": "67341.29",
        "open": "68276",
        "rose": "-0.00017268",
        "vol": "221.3856"
    },
    "ts": 1710813265000,
    "status": "ok"
}
```

***

### Line K (Full quantity)

#### Subscription Parameters

```javascript
{"event":"req","params":{"channel":"market_e_btcusdt_kline_60min","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_kline_60min",
    "data": [
        {
            "amount": 4458871.49795525,
            "close": 66843.6282,
            "ds": "2024-03-05 16:00:00",
            "high": 66843.6282,
            "id": 1709625600,
            "low": 65533.34,
            "open": 66129.65,
            "tradeId": 0,
            "vol": 67.281
        }
    ],
    "tick": null,
    "ts": 1710813260000,
    "status": "ok"
}
```

***

### K-Line (Increment)

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_kline_60min","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_kline_60min",
    "data": null,
    "tick": {
        "amount": 13645.923,
        "close": 68264.21,
        "ds": "2024-03-19 09:00:00",
        "high": 68264.21,
        "id": 1710810000,
        "low": 68195.02,
        "open": 68195.02,
        "tradeId": 0,
        "vol": 0.2
    },
    "ts": 1710812746000,
    "status": "ok"
}
```


# Perpetual Trading API

### Unified Interface Domain Name：

Test environment：

{% hint style="info" %}
REST：<https://test-futures-api.ln.exchange>

WebSocket：wss\://test-futures-ws.ln.exchange/kline-api/ws
{% endhint %}

***

## Introduction

### Obtain API Key

* Many interfaces require API Key to access. Please create a user on the site first. Then call the interface: import nostr address and obtain API Key
* the API Key is displayed only once for security purposes. **Please keep your API key/secret**
* **never tell anyone your API key/secret**

### Signature

* First sort the parameters in ascending dictionary order of their parameter names
* traverses the sorted dictionary and splices all parameters together in the "keyvalue" format.
* **Plus your private key.**
* Using MD5 to Treat Signature String for Signing

{% code title="" lineNumbers="true" %}

```
String decodingSecret = "123456";
// First, sort the parameters in ascending order by their parameter names
Map<String, Object> sortedParams = new TreeMap<String, Object>(params);
Set<Map.Entry<String, Object>> entrys = sortedParams.entrySet();
// Traverse the sorted dictionary and concatenate all parameters in the "keyvalue" format
StringBuilder basestring = new StringBuilder();
for (Map.Entry<String, Object> param : entrys) {
    // Skip the signature field
    if("sign".equals(param.getKey())){
        continue;
    }

    if(!StringUtils.isBlank(param.getValue().toString())) {
        basestring.append(param.getKey());
        basestring.append(param.getValue().toString());
    }
}
basestring.append(decodingSecret);
// Use MD5 to sign the concatenated string
String curSign = MD5Util.getMD5(basestring.toString());
```

{% endcode %}

***

### REST Request Validation

All REST private request headers must contain the following

#### Request Header Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| apikey         | String | **Yes**  | **API key**            |
| time           | String | **Yes**  | **13-digit timestamp** |
| sign           | String | **Yes**  | **Signature**          |

***

## API section-OPEN：

### Access to public information

* **URL**：`/napi/common/public_info`
* **Method**：`GET`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameter

| Parameters           | Type   | Description                     |
| -------------------- | ------ | ------------------------------- |
| nostrAddress         | String | NostrAddress                    |
| wsUrl                | String | WebSocket Connection Address    |
| currentTimeMillis    | String | Current timestamp               |
| marginCoinList       | List   | List of Margin Currencies       |
| coinList             | List   | Currency List                   |
| coin                 | String | currency Name                   |
| precious             | String | currency precision              |
| contractList         | List   | contract List                   |
| id                   | String | Contract ID                     |
| contractName         | String | contract Name                   |
| symbol               | String | transaction Pair Symbol         |
| closeMakerFee        | String | Maker fees                      |
| closeTakerFee        | String | Taker fee                       |
| base                 | String | base Currency                   |
| quote                | String | pricing Currency                |
| sort                 | String | sort Value                      |
| robot                | String | robot Address                   |
| coinResultVo         | Object | coin pair information           |
| symbolPricePrecision | String | trading Pair Price Precision    |
| minOrderVolume       | String | minimum Order Quantity          |
| minOrderMoney        | String | minimum Order Amount            |
| maxMarketVolume      | String | maximum Market Order Volume     |
| maxMarketMoney       | String | Maximum Market Order Amount     |
| maxLimitVolume       | String | maximum Limit Order Quantity    |
| maxLimitMoney        | String | maximum Limit Order Amount      |
| marginCoinPrecision  | String | currency precision              |
| depth                | List   | coin Pair Depth Precision Array |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "wsUrl": "wss://dev-futuresws.ln.exchange/kline-api/ws",
        "nostrAddress": "npub1pnvxt989e2udtnwxst46xn648rqtn0zlm4a5xdudhd0sx976hwfspyx227,
        "marginCoinList": [
            "USDT",
            "TREAT"
        ],
        "contractList": [
            {
                "id": 18,
                "contractName": "E-BTC-USDT",
                "symbol": "BTC-USDT",
                "contractType": "E",
                "coType": "E",
                "deliveryKind": "0",
                "contractSide": 1,
                "multiplier": 0.01,
                "multiplierCoin": "BTC",
                "marginCoin": "USDT",
                "marginRate": 1,
                "closeMakerFee": 0.0002,
                "closeTakerFee": 0.0005,
                "capitalStartTime": 0,
                "capitalFrequency": 8,
                "settlementFrequency": 1,
                "brokerId": 1000,
                "base": "BTC",
                "quote": "USDT",
                "coinResultVo": {
                    "symbolPricePrecision": 1,
                    "depth": [
                        "0"
                    ],
                    "minOrderVolume": 1,
                    "minOrderMoney": 200,
                    "maxMarketVolume": 10000,
                    "maxMarketMoney": 1000000,
                    "maxLimitVolume": 100000,
                    "maxLimitMoney": 1000000,
                    "priceRange": 9999999,
                    "marginCoinPrecision": 5,
                    "fundsInStatus": 1,
                    "fundsOutStatus": 1
                },
                "sort": 1,
                "maxLever": 125,
                "minLever": 0,
                "robot": "npub1pnvxt989e2udtnwxst46xn648rqtn0zlm4a5xdudhd0sx976hwfspyx227",
                "auditor": 90000097
            },
            {
                "id": 63,
                "contractName": "TREAT-BTC-USDT",
                "symbol": "BTC-USDT",
                "contractType": "TREAT",
                "coType": "H",
                "deliveryKind": "0",
                "contractSide": 1,
                "multiplier": 0.001,
                "multiplierCoin": "BTC",
                "marginCoin": "TREAT",
                "marginRate": 1,
                "closeMakerFee": 0.0002,
                "closeTakerFee": 0.0005,
                "capitalStartTime": 0,
                "capitalFrequency": 8,
                "settlementFrequency": 1,
                "brokerId": 1000,
                "base": "BTC",
                "quote": "USDT",
                "coinResultVo": {
                    "symbolPricePrecision": 1,
                    "depth": [
                        "0"
                    ],
                    "minOrderVolume": 1,
                    "minOrderMoney": 200,
                    "maxMarketVolume": 10000,
                    "maxMarketMoney": 1000000,
                    "maxLimitVolume": 100000,
                    "maxLimitMoney": 1000000,
                    "priceRange": 9999999,
                    "marginCoinPrecision": 0,
                    "fundsInStatus": 1,
                    "fundsOutStatus": 1
                },
                "sort": 29,
                "maxLever": 25,
                "minLever": 0,
                "robot": "npub19386mnlhrn35auvqrshujkyf7mm9pty8v2atkuhr04ka8zxazucq4kam4p",
                "auditor": 90000102
            }
        ],
        "currentTimeMillis": 1725609265656,
        "coinList": [
            {
                "coin": "BTC",
                "precious": 4,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "",
                "assetsPrecision": 100000000,
                "fundsInMinAmount": 0.0001,
                "fundsOutMinAmount": 0.0002,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 3
            },
            {
                "coin": "USDT",
                "precious": 5,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "3f74dd174205195be44fbe6c49b9632b79cfb1c367160df902bb4d3d189e4cc8",
                "assetsPrecision": 1,
                "fundsInMinAmount": 0.01,
                "fundsOutMinAmount": 0.1,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 5000
            },
            {
                "coin": "TREAT",
                "precious": 0,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "b6c698a6d8f0d8e30fc4dd937e6f4034d6ca62e83a0a02f22a8a500ed58908cf",
                "assetsPrecision": 1,
                "fundsInMinAmount": 5,
                "fundsOutMinAmount": 10,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 1000
            }
        ]
    },
    "succ": true
}
```

***

### Get list of outstanding orders

* **URL**：`/open/v1/openOrders`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| Parameter Name | Type   | Required | Description   |
| -------------- | ------ | -------- | ------------- |
| contractName   | String | yes      | Contract Name |

**Request Example**

```json
{"contractName":"E-BTC-USDT"}
```

#### Return parameters

| Parameter Name | Type   | Description                                                                                              |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| orderId        | String | Order id                                                                                                 |
| contractName   | String | contract Name                                                                                            |
| price          | String | order Price                                                                                              |
| origQty        | String | order quantity                                                                                           |
| executedQty    | String | number of transactions                                                                                   |
| avgPrice       | String | average Transaction Price                                                                                |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired) |
| type           | Strin  | order Type (1 limit; 2 market;)                                                                          |
| timeInForce    | String | order Type (1 limit; 2 market;)                                                                          |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                              |
| transactTime   | String | creation time                                                                                            |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "side": "BUY",
            "executedQty": 0E-16,
            "orderId": 2110961582587810435,
            "price": 65000.0000000000000000,
            "origQty": 1.0000000000000000,
            "avgPrice": 0E-8,
            "transactTime": 1710825215000,
            "action": "OPEN",
            "contractName": "E-BTC-USDT",
            "type": "LIMIT",
            "timeInForce": "",
            "status": "INIT"
        }
    ],
    "succ": true
}
```

### Get Transaction Details

* **URL**：`/open/v1/myTrades`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description                                          |
| -------------- | ------ | -------- | ---------------------------------------------------- |
| contractName   | String | Yes      | Contract Name                                        |
| limit          | String | no       | get the number of bars: the default 100 maximum 1000 |
| fromId         | String | no       | query start ID (this ID is not included)             |

**Request Example**

```json
{"contractName":"E-BTC-USDT","limit":"100","fromId":"123456"}
```

#### Return parameters

| Parameters   | type   | description                                                        |
| ------------ | ------ | ------------------------------------------------------------------ |
| price        | String | Transaction Price                                                  |
| volume       | String | number of transactions                                             |
| amount       | String | transaction amount                                                 |
| contractName | String | contract Name                                                      |
| time         | String | transaction time                                                   |
| side         | Strin  | BUY and SELL direction (BUY BUY, SELL SELL)                        |
| fee          | String | fees                                                               |
| bidId        | String | pay id                                                             |
| askId        | String | selling order id                                                   |
| bidUserId    | String | pay user ID                                                        |
| askUserId    | String | sell order user ID                                                 |
| isBuyer      | String | buyer (true buyer, false seller)                                   |
| tradeId      | String | the ID of the transaction details.                                 |
| isMaker      | String | Whether the order is pending (ture order taker, false order taker) |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "amount": 67000.000,
            "side": "BUY",
            "fee": "0.0008",
            "isMaker": true,
            "isBuyer": true,
            "bidId": 2110903085133234196,
            "bidUserId": 90000123,
            "volume": 1.0000000000000000,
            "price": 67000.0000000000000000,
            "askId": 2110903085133234197,
            "contractName": "E-BTC-USDT",
            "time": 1710695925000,
            "tradeId": 1154932,
            "askUserId": 90000123
        }
    ],
    "succ": true
}
```

***

### Batch Order & Batch Withdrawal

* **URL**：`/open/v1/batchOrders`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description                                             |
| -------------- | ------ | -------- | ------------------------------------------------------- |
| contractName   | String | Yes      | Contract Name                                           |
| orders         | List   | yes      | order List                                              |
| side           | String | yes      | BUY and SELL direction (BUY BUY, SELL SELL)             |
| open           | String | yes      | OPEN position direction (OPEN position, CLOSE position) |
| type           | String | yes      | order type (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY) |
| volume         | String | yes      | order quantity                                          |
| price          | String | no       | order Price                                             |
| clientOrderId  | String | no       | client order ID                                         |
| orderIds       | List   | yes      | List of cancellation ID                                 |

**Request Example (Bulk Order)**

```json
{"contractName":"E-BTC-USDT","orders":"[{\"volume\":1,\"side\":\"BUY\",\"open\":\"OPEN\",\"price\":50000,\"type\":1}]"}
```

**Request Example (Bulk Withdrawal)**

```json
{"contractName":"E-BTC-USDT","orderIds":"[2368243249036902927,2368243249036902921]"}
```

#### Return parameters

| Parameters | type | description                                              |
| ---------- | ---- | -------------------------------------------------------- |
| ids        | List | Successful order ID list                                 |
| cancelIds  | List | list of order withdrawal ID when placing an order failed |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "ids": [
            "2116489841153081344"
        ],
        "cancelIds": []
    },
    "succ": true
}
```

### Get depth list

* **URL**：`/open/v1/depth`
* **Method**：`POST`
* **Login required**：N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| contractName   | String | Yes      | contract Name                                       |
| limit          | String | no       | get the number of bars: the default 100 maximum 100 |

**Request Example**

```json
{"contractName":"E-BTC-USDT","limit":"100"}
```

#### Return parameters

| Parameters | type   | description      |
| ---------- | ------ | ---------------- |
| asks       | String | Sale order depth |
| bids       | String | paying Depth     |
| time       | String | latest timestamp |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "asks": [
            [
                65810,
                0.9845
            ],
            [
                65794,
                1.2804
            ],
            [
                65761,
                1.3675
            ]
        ],
        "bids": [
            [
                65834,
                1.4365
            ],
            [
                65992,
                1.4689
            ],
            [
                66008,
                0.242
            ]
        ],
        "time": null
    },
    "succ": true
}
```

***

### Batch withdrawal of all orders

* **URL**：`/open/v1/cancelAll`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description   |
| -------------- | ------ | -------- | ------------- |
| contractName   | String | Yes      | Contract Name |

**Request Example**

```json
{"contractName":"E-BTC-USDT"}
```

#### Return parameters

| Parameters | type | description |
| ---------- | ---- | ----------- |
|            |      |             |

#### Return Results

```json
{
    "code": 0,
    "msg": "SUCCESS",
    "time": 1707121453886,
    "data": []
}
```

***

### View account balance

* **URL**：`/open/v1/account`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameters

| Parameters            | type   | description                                                                                                         |
| --------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| data                  | List   | Asset List                                                                                                          |
| accountNormal         | String | available                                                                                                           |
| accountLock           | String | freeze                                                                                                              |
| marginCoin            | String | currency of margin                                                                                                  |
| partPositionNormal    | String | position-by-position margin balance                                                                                 |
| totalPositionNormal   | String | initial margin occupied by a full position                                                                          |
| achievedAmount        | String | realized profit and loss                                                                                            |
| unrealizedAmount      | String | unrealized profit and loss                                                                                          |
| totalMarginRate       | String | Full position margin rate                                                                                           |
| totalEquity           | String | full Position Equity                                                                                                |
| partEquity            | String | position-by-position equity                                                                                         |
| totalCost             | String | cost of full warehouse occupancy                                                                                    |
| sumMarginRate         | String | margin rate for full account                                                                                        |
|                       |        |                                                                                                                     |
| positionVos           | List   | position collection                                                                                                 |
| contractId            | String | contract id                                                                                                         |
| contractName          | String | contract Name                                                                                                       |
| contractSymbol        | String | contract currency exchange                                                                                          |
| positions             | List   | position collection                                                                                                 |
| positionType          | String | position type (1 full position, 2 positions one by one)                                                             |
| side                  | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                         |
| volume                | String | Number of Positions                                                                                                 |
| openPrice             | String | opening Price                                                                                                       |
| avgPrice              | String | average price of position                                                                                           |
| closePrice            | String | average closing price                                                                                               |
| leverageLevel         | String | leverage multiple                                                                                                   |
| openAmount            | String | opening margin (including Variation)                                                                                |
| holdAmount            | String | position Margin                                                                                                     |
| closeVolume           | String | number of closed positions                                                                                          |
| pendingCloseVolume    | String | the number of open positions that have been hung out.                                                               |
| realizedAmount        | String | Realized profit and loss                                                                                            |
| historyRealizedAmount | String | historical cumulative realized profit and loss                                                                      |
| tradeFee              | String | Transaction Fees                                                                                                    |
| capitalFee            | String | capital expenses                                                                                                    |
| closeProfit           | String | closing profit and loss                                                                                             |
| shareAmount           | String | apportioned amount                                                                                                  |
| freezeLock            | String | position freeze status: 0 normal, 1 burst freeze, 2 delivery freeze                                                 |
| status                | String | position validity, 0 invalid 1 valid                                                                                |
| marginRate            | String | margin rate                                                                                                         |
| reducePrice           | String | price reduction                                                                                                     |
| returnRate            | String | rate of Return (Yield)                                                                                              |
| unRealizedAmount      | String | unrealized profit and loss                                                                                          |
| openRealizedAmount    | String | unrealized profit or loss on opening position                                                                       |
| positionBalance       | String | position Value                                                                                                      |
| settleProfit          | String | position settlement (current number of positions, average opening price and average position price profit and loss) |
| indexPrice            | String | Latest Mark Price                                                                                                   |
| keepRate              | String | ladder Minimum Maintenance Margin Rate                                                                              |
| maxFeeRate            | String | maximum commission rate for closing positions                                                                       |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "marginCoin": "USDT",
            "accountNormal": 95344.6858935000000000,
            "accountLock": 500.0000000000000000,
            "partPositionNormal": 79501.8235017791283000,
            "totalPositionNormal": 0,
            "achievedAmount": 0E-16,
            "unrealizedAmount": 33.70439150400000000000000000000000000000000000000000000000,
            "totalMarginRate": 0,
            "totalEquity": 95344.6858935000000000,
            "partEquity": 79535.52789328312830000000000000000000000000000000000000000000,
            "totalCost": 0,
            "sumMarginRate": 1.2656772919895387,
            "positionVos": [
                {
                    "contractId": 18,
                    "contractName": "E-BTC-USDT",
                    "contractSymbol": "BTC-USDT",
                    "positions": [
                        {
                            "id": 1637,
                            "uid": 90000161,
                            "contractId": 18,
                            "positionType": 2,
                            "side": "BUY",
                            "volume": 210.0000000000000000,
                            "openPrice": 60846.8571428600000000,
                            "avgPrice": 65983.9502897600000000,
                            "closePrice": 0E-16,
                            "leverageLevel": 100,
                            "openAmount": 0E-16,
                            "holdAmount": 78805.7116950341283000,
                            "closeVolume": 0E-16,
                            "pendingCloseVolume": 0E-16,
                            "realizedAmount": 0E-16,
                            "historyRealizedAmount": 77527.9276950341283000,
                            "tradeFee": -42.6620100000000000,
                            "capitalFee": 4850.5162152834360500,
                            "closeProfit": 0E-16,
                            "shareAmount": 0E-16,
                            "freezeLock": 0,
                            "status": 1,
                            "ctime": "2024-07-12T10:31:37",
                            "mtime": "2024-09-06T15:54:54",
                            "brokerId": 1000,
                            "marginRate": 0.5689653154132829,
                            "reducePrice": 28586.0581729505975461,
                            "returnRate": 8.4690370203363728,
                            "unRealizedAmount": 33.70439150400000000000000000000000000000000000000000000000,
                            "openRealizedAmount": 10821.59999999400000000000000000000000000000000000000000000000,
                            "positionBalance": 138566.29560849600000000000000000000000000000000000000000000000,
                            "settleProfit": 10787.89560849000000000000000000000000000000000000000000000000,
                            "indexPrice": 66000,
                            "keepRate": 0.004,
                            "maxFeeRate": 0.00050
                        }
                    ]
                }
            ],
            "totalHisRealizeAmount": null,
            "accountAmount": null,
            "totalShareAmount": null
        },
        {
            "marginCoin": "TREAT",
            "accountNormal": 0E-16,
            "accountLock": 0E-16,
            "partPositionNormal": 0E-16,
            "totalPositionNormal": 0,
            "achievedAmount": 0,
            "unrealizedAmount": 0,
            "totalMarginRate": 0,
            "totalEquity": 0E-16,
            "partEquity": 0E-16,
            "totalCost": 0,
            "sumMarginRate": 0,
            "positionVos": [],
            "totalHisRealizeAmount": null,
            "accountAmount": null,
            "totalShareAmount": null
        }
    ],
    "succ": true
}
```

***

## API part-NAPI-direct call：

### Interaction-Nostr part：

Before making a request to any interface, you must sign the request parameters through the Nostr protocol.

**Parameter Description**

| Parameter Name | Type   | Required | Description                                                                                                                              |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| sig            | String | Yes      | Event entire signature                                                                                                                   |
| kind           | String | yes      | Event Type:(1 plaintext; 4 ciphertext;)                                                                                                  |
| created\_at    | String | yes      | Event timestamp                                                                                                                          |
| id             | String | yes      | Event message ID                                                                                                                         |
| content        | String | yes      | Event Content: (AES/CBC/PKCS5Padding) encryption required,(? The first half of iv =) is base64Message ,(? The second half of iv =) is iv |
| pubkey         | String | yes      | fields returned by the public\_info interface: nostrAddress                                                                              |
| tags           | String | yes      | p: User nostrAddress r:json                                                                                                              |

**Request Sample**

```json
{
    "sig": "5375cda2249722881fdfd9fdd69edd861e93769f596ad76dfded3e576835b24406c52e66e85cf891630c7e088007fdf9dd282fadc47cdc0cd7a35f3fe71a385d",
    "kind": 4,
    "created_at": 1710325923,
    "id": "503c2610bb82b3672ccae9f8c8686672f245e2a837ad4bd50974481533d1d754",
    "content": "7moMWXa8coPGUJ20AosrlDJozo9kGgmtmgs2xlJnRXdOVyRGepCje1FeoYBfa4UPBO7nIC7F5Ii8nNiyahMZFA==?iv=EmF1gfPCxiiJiDANRtvUrA==",
    "pubkey": "0077fe56d9e72bff869021308c74ac79ce6d6f103a4f7e2b3db088ac0bfcf324",
    "tags": [
        [
            "p",
            "443fa483535b0d99937ed54553802b64e2dc2f30ede3dc6df11a51f7771e09a5"
        ],
        [
            "r",
            "json"
        ]
    ]
}
```

***

### Access to public information

* **URL**：`/napi/common/public_info`
* **Method**：`GET`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameters

| Parameters           | type   | description                     |
| -------------------- | ------ | ------------------------------- |
| nostrAddress         | String | Nostr address                   |
| wsUrl                | String | WebSocket connection address    |
| currentTimeMillis    | String | current timestamp               |
| marginCoinList       | List   | list of Margin Currencies       |
| coinList             | List   | currency List                   |
| coin                 | String | currency Name                   |
| precious             | String | currency precision              |
| contractList         | List   | contract List                   |
| id                   | String | contract ID                     |
| contractName         | String | contract Name                   |
| symbol               | String | transaction Pair Symbol         |
| closeMakerFee        | String | Maker fees                      |
| closeTakerFee        | String | Taker fee                       |
| base                 | String | base Currency                   |
| quote                | String | pricing Currency                |
| sort                 | String | sort Value                      |
| robot                | String | robot Address                   |
| coinResultVo         | Object | coin pair information           |
| symbolPricePrecision | String | trading Pair Price Precision    |
| minOrderVolume       | String | minimum Order Quantity          |
| minOrderMoney        | String | minimum Order Amount            |
| maxMarketVolume      | String | maximum Market Order Volume     |
| maxMarketMoney       | String | maximum Market Order Amount     |
| maxLimitVolume       | String | maximum Limit Order Quantity    |
| maxLimitMoney        | String | maximum Limit Order Amount      |
| marginCoinPrecision  | String | currency precision              |
| depth                | List   | Coin Pair Depth Precision Array |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "wsUrl": "wss://dev-futuresws.ln.exchange/kline-api/ws",
        "nostrAddress": "npub1pnvxt989e2udtnwxst46xn648rqtn0zlm4a5xdudhd0sx976hwfspyx227,
        "marginCoinList": [
            "USDT",
            "TREAT"
        ],
        "contractList": [
            {
                "id": 18,
                "contractName": "E-BTC-USDT",
                "symbol": "BTC-USDT",
                "contractType": "E",
                "coType": "E",
                "deliveryKind": "0",
                "contractSide": 1,
                "multiplier": 0.01,
                "multiplierCoin": "BTC",
                "marginCoin": "USDT",
                "marginRate": 1,
                "closeMakerFee": 0.0002,
                "closeTakerFee": 0.0005,
                "capitalStartTime": 0,
                "capitalFrequency": 8,
                "settlementFrequency": 1,
                "brokerId": 1000,
                "base": "BTC",
                "quote": "USDT",
                "coinResultVo": {
                    "symbolPricePrecision": 1,
                    "depth": [
                        "0"
                    ],
                    "minOrderVolume": 1,
                    "minOrderMoney": 200,
                    "maxMarketVolume": 10000,
                    "maxMarketMoney": 1000000,
                    "maxLimitVolume": 100000,
                    "maxLimitMoney": 1000000,
                    "priceRange": 9999999,
                    "marginCoinPrecision": 5,
                    "fundsInStatus": 1,
                    "fundsOutStatus": 1
                },
                "sort": 1,
                "maxLever": 125,
                "minLever": 0,
                "robot": "npub1pnvxt989e2udtnwxst46xn648rqtn0zlm4a5xdudhd0sx976hwfspyx227",
                "auditor": 90000097
            },
            {
                "id": 63,
                "contractName": "TREAT-BTC-USDT",
                "symbol": "BTC-USDT",
                "contractType": "TREAT",
                "coType": "H",
                "deliveryKind": "0",
                "contractSide": 1,
                "multiplier": 0.001,
                "multiplierCoin": "BTC",
                "marginCoin": "TREAT",
                "marginRate": 1,
                "closeMakerFee": 0.0002,
                "closeTakerFee": 0.0005,
                "capitalStartTime": 0,
                "capitalFrequency": 8,
                "settlementFrequency": 1,
                "brokerId": 1000,
                "base": "BTC",
                "quote": "USDT",
                "coinResultVo": {
                    "symbolPricePrecision": 1,
                    "depth": [
                        "0"
                    ],
                    "minOrderVolume": 1,
                    "minOrderMoney": 200,
                    "maxMarketVolume": 10000,
                    "maxMarketMoney": 1000000,
                    "maxLimitVolume": 100000,
                    "maxLimitMoney": 1000000,
                    "priceRange": 9999999,
                    "marginCoinPrecision": 0,
                    "fundsInStatus": 1,
                    "fundsOutStatus": 1
                },
                "sort": 29,
                "maxLever": 25,
                "minLever": 0,
                "robot": "npub19386mnlhrn35auvqrshujkyf7mm9pty8v2atkuhr04ka8zxazucq4kam4p",
                "auditor": 90000102
            }
        ],
        "currentTimeMillis": 1725609265656,
        "coinList": [
            {
                "coin": "BTC",
                "precious": 4,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "",
                "assetsPrecision": 100000000,
                "fundsInMinAmount": 0.0001,
                "fundsOutMinAmount": 0.0002,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 3
            },
            {
                "coin": "USDT",
                "precious": 5,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "3f74dd174205195be44fbe6c49b9632b79cfb1c367160df902bb4d3d189e4cc8",
                "assetsPrecision": 1,
                "fundsInMinAmount": 0.01,
                "fundsOutMinAmount": 0.1,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 5000
            },
            {
                "coin": "TREAT",
                "precious": 0,
                "fundsInStatus": 1,
                "fundsOutStatus": 1,
                "assetsId": "b6c698a6d8f0d8e30fc4dd937e6f4034d6ca62e83a0a02f22a8a500ed58908cf",
                "assetsPrecision": 1,
                "fundsInMinAmount": 5,
                "fundsOutMinAmount": 10,
                "fundsOutDuration": 60,
                "fundsOutDurationAmount": 1000
            }
        ]
    },
    "succ": true
}
```

***

### Get all tag prices and index prices

* **URL**：`/napi/common/public_all_index_tag_price`
* **Method**：`GET`
* **Login required**：N

#### Request Parameters

| Parameter Name | Type | Required | Description |
| -------------- | ---- | -------- | ----------- |
|                |      |          |             |

**Request Example**

```json
{}
```

#### Return parameters

| Parameters      | type   | description          |
| --------------- | ------ | -------------------- |
| contract\_name  | String | Contract Name        |
| currentFundRate | String | current Funding Rate |
| tag\_price      | String | tag Price            |
| index\_price    | String | index price          |
| nextFundRate    | String | next Fund Rate       |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "currentFundRate": "0.0037500000000000",
            "tag_price": "65998.6662470565391541",
            "index_price": "55739",
            "contract_name": "E-BTC-USDT",
            "nextFundRate": "0.0037500000000000"
        },
        {
            "currentFundRate": "0.0037500000000000",
            "tag_price": "65998.6662470565391541",
            "index_price": "55739",
            "contract_name": "TREAT-BTC-USDT",
            "nextFundRate": "0.0037500000000000"
        }
    ],
    "succ": true
}
```

***

### Get depth list

* **URL**：`/napi/market/depth`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| contractName   | String | Yes      | contract Name                                       |
| limit          | String | no       | get the number of bars: the default 100 maximum 100 |

**Request Example**

```json
{"contractName":"E-BTC-USDT","limit":"100"}
```

#### Return parameters

| Parameters | type   | description      |
| ---------- | ------ | ---------------- |
| asks       | String | Sale order depth |
| bids       | String | paying Depth     |
| time       | String | latest timestamp |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "asks": [
            [
                65810,
                0.9845
            ],
            [
                65794,
                1.2804
            ],
            [
                65761,
                1.3675
            ]
        ],
        "bids": [
            [
                65834,
                1.4365
            ],
            [
                65992,
                1.4689
            ],
            [
                66008,
                0.242
            ]
        ],
        "time": null
    },
    "succ": true
}
```

***

### Open currency exchange account

* **URL**：`/napi/user/enable_trade`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name | Type   | Required | Description   |
| -------------- | ------ | -------- | ------------- |
| contractName   | String | Yes      | contract Name |

**Request Example**

```json
{"contractName":"E-BTC-USDT"}
```

#### Return parameters

| Parameters | type   | description              |
| ---------- | ------ | ------------------------ |
| code       | String | Successful opening for 0 |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": true,
    "succ": true
}
```

***

### Get user current delegate and current conditional delegate count

* **URL**：`/napi/order/get_user_order_count`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| **Parameter Name** | **Type** | **Required** | **Description** |
| ------------------ | -------- | ------------ | --------------- |
| contractName       | String   | Yes          | Contract Name   |

**Request Example**

```json
{"contractName":"E-BTC-USDT"}
```

#### Return parameters

| Parameters        | type   | description                      |
| ----------------- | ------ | -------------------------------- |
| orderCount        | String | Normal Current Delegation Count  |
| triggerOrderCount | String | condition Current Delegate Count |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "orderCount": 1,
        "triggerOrderCount": 0
    },
    "succ": true
}
```

***

### Get the list of current delegates

* **URL**：`/napi/order/current_order_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| contractName   | String | Yes      | contract Name          |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"contractName":"E-BTC-USDT","page":1,"limit":100}
```

#### Return parameters

| Parameters     | type   | description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | Total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | Update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| contractName   | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "684db9069089bfb339fcc64ed89f91eb9ac9870ca569b8286286d90428bde804",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "positionType": 1,
                "avgPrice": 0E-8,
                "tradeFee": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710832100000,
                "volume": 1.0000000000000000,
                "dealVolume": 0E-16,
                "price": 60000.0000000000000000,
                "ctime": 1710832100000,
                "contractName": "E-BTC-USDT",
                "id": "2115623941386416880",
                "orderBalance": 60000.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 0E-16,
                "status": 0
            }
        ]
    },
    "succ": true
}
```

***

### Obtain the historical delegation list.

* **URL**：`/napi/order/history_order_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| contractName   | String | Yes      | contract Name          |
| wallet         | String | yes      | wallet address         |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"contractName":"E-BTC-USDT","wallet":"npub18luy0zu5gmllkwsyel3xaz5h33qgschq6kt7es3vuezg749pkdjs941234","page":1,"limit":200}
```

#### Return parameters

| Parameters     | Type   | Description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | Total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | Update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| contractName   | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 6,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "avgPrice": 65000.00000000,
                "tradeFee": 0.0005307400000000,
                "realizedAmount": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710830986000,
                "volume": 1.0000000000000000,
                "dealVolume": 0.7582000000000000,
                "price": 65000.0000000000000000,
                "ctime": 1710825215000,
                "contractName": "E-BTC-USDT",
                "id": "2110961582587810435",
                "orderBalance": 15717.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 49283.0000000000000000,
                "status": 2
            }
        ]
    },
    "succ": true
}
```

### Get the list of current plan delegations

* **URL**：`/napi/order/trigger_order_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| **Parameter Name** | **Type** | **Required** | **Description**        |
| ------------------ | -------- | ------------ | ---------------------- |
| contractName       | String   | Yes          | contract Name          |
| page               | String   | no           | page number: Default 1 |
| limit              | String   | no           | number: default 100    |

**Request Example**

```json
{"contractName":"E-BTC-USDT","page":1,"limit":100}
```

#### Return parameters

| Parameters     | Type   | description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | Total                                                                                                                                        |
| trigOrderList  | Lis    | planned Order                                                                                                                                |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| triggerPrice   | String | trigger Price                                                                                                                                |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | Update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| expireTime     | String | condition Order Expiration Time                                                                                                              |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| contractName   | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| triggerType    | String | condition sheet type (1 stop loss,2 take profit,3 stop loss limit,4 take profit limit)                                                       |
| timeInForce    | String | effective Way (1 GTC, 2 IOC, 3 FOK, 4GTX, 5 PostOnly)                                                                                        |
| status         | String | Valid Status (0 Valid, 1 Expired, 2 Completed, 3 Trigger Failed)                                                                             |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "trigOrderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "87bea8e5ddeee5d3c7ea218ec3b83524128750906e67e4cd9d5ad10517ec8e3c",
                "side": "BUY",
                "triggerPrice": 60000.0000000000000000,
                "memo": 0,
                "type": 1,
                "mtime": 1710837111000,
                "volume": 1.0000000000000000,
                "expireTime": 1712046712000,
                "price": 55000.0000000000000000,
                "ctime": 1710837111000,
                "contractName": "E-BTC-USDT",
                "id": "887",
                "triggerType": 4,
                "timeInForce": 1,
                "status": 0
            }
        ]
    },
    "succ": true
}
```

### Get historical plan delegation list

* **URL**：`/napi/order/history_trigger_order_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| contractName   | String | Yes      | contract Name          |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"contractName":"E-BTC-USDT","page":1,"limit":100}
```

#### Return parameters

| Parameters     | type   | description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | Total                                                                                                                                        |
| trigOrderList  | List   | planned Order                                                                                                                                |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| triggerPrice   | String | trigger Price                                                                                                                                |
| memo           | String | order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | Update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| expireTime     | String | condition Order Expiration Time                                                                                                              |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| contractName   | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| triggerType    | String | condition sheet type (1 stop loss,2 take profit,3 stop loss limit,4 take profit limit)                                                       |
| timeInForce    | String | effective Way (1 GTC, 2 IOC, 3 FOK, 4GTX, 5 PostOnly)                                                                                        |
| status         | String | valid Status (0 Valid, 1 Expired, 2 Completed, 3 Trigger Failed)                                                                             |
|                |        |                                                                                                                                              |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 1,
        "trigOrderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "87bea8e5ddeee5d3c7ea218ec3b83524128750906e67e4cd9d5ad10517ec8e3c",
                "side": "BUY",
                "triggerPrice": 60000.0000000000000000,
                "memo": 1,
                "type": 1,
                "mtime": 1710838297000,
                "volume": 1.0000000000000000,
                "expireTime": 1710838297000,
                "price": 55000.0000000000000000,
                "ctime": 1710837111000,
                "contractName": "E-BTC-USDT",
                "id": "887",
                "triggerType": 4,
                "timeInForce": 1,
                "status": 4
            }
        ]
    },
    "succ": true
}
```

***

### Get historical transaction list

* **URL**：`/napi/order/his_trade_list`
* **Method**：`POST`
* **Login required**：Y

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| contractName   | String | Yes      | contract Name          |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |

**Request Example**

```json
{"contractName":"E-BTC-USDT","page":1,"limit":100}
```

#### Return parameters

| Parameters       | type   | description                                                        |
| ---------------- | ------ | ------------------------------------------------------------------ |
| count            | String | Total                                                              |
| tradeHisList     | List   | transaction Order List                                             |
| symbol           | String | transaction Pair                                                   |
| pricePrecision   | String | price precision                                                    |
| eventId          | String | event ID                                                           |
| side             | String | BUY and SELL direction (BUY BUY, SELL SELL)                        |
| role             | String | active one-way direction:(Maker hangs one-way, Taker eats one-way) |
| fee              | String | fees                                                               |
| realizedAmount   | String | accumulated profit and loss of order                               |
| feeCoinPrecision | String | currency Display Precision                                         |
| volume           | String | number of transactions                                             |
| feeCoin          | String | fee Currency                                                       |
| price            | String | transaction Price                                                  |
| ctime            | String | transaction time                                                   |
| contractName     | String | contract Name                                                      |
| id               | String | transaction ID                                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 3,
        "tradeHisList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "role": "Maker",
                "fee": 0.0002895900000000,
                "realizedAmount": 0E-16,
                "feeCoinPrecision": 4,
                "volume": 0.4137000000000000,
                "feeCoin": "USDT",
                "price": 65000.0000000000000000,
                "ctime": 1710830986000,
                "contractName": "E-BTC-USDT",
                "id": "1156731"
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Market Data

* **URL**：`/napi/order/history_order_list_explorer`
* **Method**：`POST`
* **Login required**：N

#### Request Parameters

| Parameter Name | Type   | Required | Description                         |
| -------------- | ------ | -------- | ----------------------------------- |
| contractName   | String | Yes      | Contract Name                       |
| wallet         | String | no       | wallet address or eventId retrieval |
| page           | String | no       | page number: Default 1              |
| limit          | String | no       | number: default 100                 |
| type           | String | no       | order Type (1 limit; 2 market;)     |

**Request Example**

```json
{"contractName":"E-BTC-USDT","wallet":"npub18luy0zu5gmllkwsyel3xaz5h33qgschq6kt7es3vuezg749pkdjs941234","page":1,"limit":200}
```

#### Return parameters

| Parameters     | type   | description                                                                                                                                  |
| -------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| count          | String | Total                                                                                                                                        |
| orderList      | List   | order                                                                                                                                        |
| symbol         | String | transaction Pair                                                                                                                             |
| pricePrecision | String | price precision                                                                                                                              |
| eventId        | String | event ID                                                                                                                                     |
| side           | String | BUY and SELL direction (BUY BUY, SELL SELL)                                                                                                  |
| address        | String | user Address                                                                                                                                 |
| avgPrice       | String | average Transaction Price                                                                                                                    |
| tradeFee       | String | transaction Fees                                                                                                                             |
| memo           | String | Order Status Remarks                                                                                                                         |
| type           | String | order type (1 limit; 2 market; 3 IOC; 4 FOK; 5 POST\_ONLY; 6 warehouse explosion, only displayed on the page, not recorded in the database;) |
| mtime          | String | update time                                                                                                                                  |
| volume         | String | order quantity                                                                                                                               |
| dealVolume     | String | number of transactions                                                                                                                       |
| price          | String | order Price                                                                                                                                  |
| ctime          | String | creation time                                                                                                                                |
| contractName   | String | contract Name                                                                                                                                |
| id             | String | order ID                                                                                                                                     |
| orderBalance   | String | order Balance                                                                                                                                |
| dealMoney      | String | Amount of transactions                                                                                                                       |
| status         | String | order Status (Order Status: 0 init,1 new,2 filled,3 part\_filled,4 canceled,5 pending\_cancel,6 expired)                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 6,
        "orderList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "address": "npub1z8vkcn30lrt6uwmkhrslnw43qglzrhudx0aw3ervkfrfv4gs20wq3rt8zq",
                "avgPrice": 65000.00000000,
                "tradeFee": 0.0005307400000000,
                "realizedAmount": 0E-16,
                "memo": 0,
                "type": 1,
                "mtime": 1710830986000,
                "volume": 1.0000000000000000,
                "dealVolume": 0.7582000000000000,
                "price": 65000.0000000000000000,
                "ctime": 1710825215000,
                "contractName": "E-BTC-USDT",
                "id": "2110961582587810435",
                "orderBalance": 15717.00000000000000000000000000000000000000000000000000000000,
                "dealMoney": 49283.0000000000000000,
                "status": 2
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Market Data-Details

* **URL**：`/napi/order/his_trade_list_explorer`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description            |
| -------------- | ------ | -------- | ---------------------- |
| contractName   | String | Yes      | contract Name          |
| page           | String | no       | page number: Default 1 |
| limit          | String | no       | number: default 100    |
| orderId        | String | yes      | order ID               |

**Request Example**

```json
{"contractName":"E-BTC-USDT","orderId":"2115630744614604870","page":1,"limit":100}
```

#### Return parameter

| Parameters       | Type   | Description                                                        |
| ---------------- | ------ | ------------------------------------------------------------------ |
| count            | String | Total                                                              |
| tradeHisList     | List   | transaction Order List                                             |
| symbol           | String | transaction Pair                                                   |
| pricePrecision   | String | price precision                                                    |
| eventId          | String | event ID                                                           |
| side             | String | BUY and SELL direction (BUY BUY, SELL SELL)                        |
| role             | String | active one-way direction:(Maker hangs one-way, Taker eats one-way) |
| fee              | String | fees                                                               |
| realizedAmount   | String | accumulated profit and loss of order                               |
| feeCoinPrecision | String | currency Display Precision                                         |
| volume           | String | number of transactions                                             |
| feeCoin          | String | fee Currency                                                       |
| price            | String | transaction Price                                                  |
| ctime            | String | transaction time                                                   |
| contractName     | String | contract Name                                                      |
| id               | String | transaction ID                                                     |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "count": 3,
        "tradeHisList": [
            {
                "symbol": "BTC-USDT",
                "pricePrecision": 2,
                "eventId": "4ef6a6d0169d7622c449edad7932befc2998902b1258187cbf2ede8a8715850c",
                "side": "BUY",
                "role": "Maker",
                "fee": 0.0002895900000000,
                "realizedAmount": 0E-16,
                "feeCoinPrecision": 4,
                "volume": 0.4137000000000000,
                "feeCoin": "USDT",
                "price": 65000.0000000000000000,
                "ctime": 1710830986000,
                "contractName": "E-BTC-USDT",
                "id": "1156731"
            }
        ]
    },
    "succ": true
}
```

***

### Browser-Money Flow

* **URL**：`/napi/trade/get_transaction_list_explorer`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                                                                                                                    |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| address        | String | No       | wallet address                                                                                                                                 |
| symbol         | String | no       | currency                                                                                                                                       |
| page           | String | no       | page number: Default 1                                                                                                                         |
| limit          | String | no       | number: default 100                                                                                                                            |
| type           | String | no       | type of flowing water (1 transfer-in 2 Transfer-out 6 Transaction Fee 13 Order Freeze 14 Order Cancellation Unfreeze 15 Transaction Transfer ) |

**Request Example**

```json
{"limit":20,"page":1,"type":"13","symbol":"USDT","address":""}
```

#### Return parameter

| Parameters     | type   | description                                                                                                                                    |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| ctimeL         | String | Create timestamp                                                                                                                               |
| fromCoinSymbol | String | from Currency Name                                                                                                                             |
| toCoinSymbol   | String | to Currency Name                                                                                                                               |
| type           | String | type of flowing water (1 transfer-in 2 Transfer-out 6 Transaction Fee 13 Order Freeze 14 Order Cancellation Unfreeze 15 Transaction Transfer ) |
| amount         | String | quantity                                                                                                                                       |
| fromAddress    | String | from user address                                                                                                                              |
| toAddress      | String | to User Address                                                                                                                                |

#### Return Results

```json
{
    "code": "0",
    "msg": "success",
    "data": {
        "transList": [
            {
                "symbol": "btcusdt",
                "eventId": 4826157,
                "amount": "24303.211464",
                "type": 14,
                "toAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "toCoinSymbol": "USDT",
                "ctime": "2024-03-19 14:15:01",
                "fromCoinSymbol": "USDT",
                "fromAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "id": 4826157,
                "ctimeL": 1710857701000
            },
            {
                "symbol": "btcusdt",
                "eventId": 4826156,
                "amount": "30863.870946288",
                "type": 15,
                "toAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "toCoinSymbol": "USDT",
                "ctime": "2024-03-19 14:15:01",
                "fromCoinSymbol": "USDT",
                "fromAddress": "npub1m5vfe4uz9sk3e0n30lj0undcu2akyzrhva8zzr902qmj3ymvnqcsv3edk2",
                "id": 4826156,
                "ctimeL": 1710857701000
            }
        ],
        "count": 9331
    },
    "succ": true
}
```

***

### Get Daily Trading Volume

* **URL**：`/napi/common/getDayTradeAmount`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                                                                  |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| dayTimestamp   | String | No       | query date 0 timestamp (milliseconds), not passed default: query current day |

**Request Example**

```json
{}    
{"dayTimestamp":"1735516800000"}
```

#### Return parameter

| Parameters   | Type   | Description          |
| ------------ | ------ | -------------------- |
| contractName | String | Contract Name        |
| dayNtlVlm    | String | daily trading volume |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": [
        {
            "contractName": "E-BURGER-USDT",
            "dayNtlVlm": 11839.5551
        },
        {
            "contractName": "E-BTC-USDT",
            "dayNtlVlm": 246326.83141
        }
    ],
    "succ": true
}
```

### Acquisition day fee, Total fee

* **URL**：`/napi/common/getTradeFee`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description                               |
| -------------- | ------ | -------- | ----------------------------------------- |
| startTimestamp | String | Yes      | query date start timestamp (milliseconds) |
| endTimestamp   | String | yes      | query date end timestamp (milliseconds)   |

**Request Example**

```json
{"startTimestamp":"1735516800000","endTimestamp":"1735603199000"}
```

#### Return parameters

| Parameters | Type   | Description        |
| ---------- | ------ | ------------------ |
| dailyFees  | String | Daily fee          |
| totalFees  | String | total Handling Fee |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "totalFees": "91.34757952128017",
        "dailyFees": "7.716232098"
    },
    "succ": true
}
```

***

## API section-NAPI- RELAY instruction：

### Create User

* **URL**：`/napi/user/create_user`
* **Method**：`POST`
* **Login required:** N

#### Request Parameters

| Parameter Name | Type   | Required | Description               |
| -------------- | ------ | -------- | ------------------------- |
| nostrAddress   | String | Yes      | nostr protocol address    |
| sign           | String | no       | value after eth signature |
| broker         | String | yes      | merchant id: fixed 1000   |
| ethAddress     | String | yes      | eth address               |
| time           | String | yes      | latest timestamp          |
| referrals      | String | no       | invitation Code           |

**Request Example**

```json
{"nostrAddress":"npub1wmp4k62sqmw3plv6eu53p9rzpufxr09er25dlxrhjfzgsa644g8skxh943","sign":"0x83e814031c2e9d45202a3cabbe6cf2bdb28f55fc7c18f8f2280a4b162b0df87d4e66a1b9cd7c54d198321b65bcec022a41e5529a911cc3539b61a6978d34ac161b","broker":1000,"ethAddress":"0x29c044869E937DF22c47DeEe554E1D257858bf99","time":1711444596754,"referrals":"0x123444869E937DF22c47DeEe554E1D2123456789"}
```

#### Return parameter

| Parameters | Type   | Description      |
| ---------- | ------ | ---------------- |
| code       | String | 0 is successful. |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": "null",
    "succ": "true"
}
```

### Limit order & Market price order & Plan to entrust order

* **URL**：`/napi/order/order_create`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                                                             |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| side             | String | Yes      | BUY and SELL direction (BUY BUY, SELL SELL)                                             |
| open             | String | yes      | OPEN position direction (OPEN position, CLOSE position)                                 |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not)                                |
| type             | String | yes      | order type (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY)                                 |
| volume           | String | yes      | order quantity (open market price order: Amount)                                        |
| contractName     | String | yes      | contract Name                                                                           |
| price            | String | yes      | order Price                                                                             |
| clientId         | String | no       | client order ID                                                                         |
| triggerPrice     | String | yes      | trigger Price                                                                           |
| source           | String | yes      | order source (order Source: 1web,2app,3api,4 others)                                    |
| triggerType      | String | yes      | condition order type (0 normal condition order, 3 stop loss limit, 4 take profit limit) |
| expiredTime      | String | Yes      | validity duration of conditional sheet                                                  |
| ctime            | String | yes      | creation time                                                                           |
| timeInForce      | String | yes      | effective Way (1 limit, 2 market,3 IOC,4 FOK,5 POST\_ONLY)                              |

**Request Example**

```json
{"side":"buy","open":"OPEN","isConditionOrder":false,"clientId":"web39","triggerPrice":0,"kind":10,"source":1,"type":1,"triggerType":1,"expiredTime":30,"volume":1,"price":60000,"ctime":1710843099430,"contractName":"E-BTC-USDT","timeInForce":2}
```

#### Return parameter

| Parameters | Type | description                                              |
| ---------- | ---- | -------------------------------------------------------- |
| ids        | List | Successful order ID list                                 |
| cancelIds  | List | list of order withdrawal ID when placing an order failed |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "ids": [
            "2115627033762860615"
        ],
        "cancelIds": []
    },
    "succ": true
}
```

***

### Withdrawal & Revocation of Plan Delegation

* **URL**：`/napi/order/order_cancel`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                              |
| ---------------- | ------ | -------- | -------------------------------------------------------- |
| orderId          | String | Yes      | order ID                                                 |
| clientId         | String | no       | client order ID                                          |
| contractName     | String | yes      | contract Name                                            |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not) |

**Request Example**

```json
{"contractName":"E-BTC-USDT","orderId":"2115623941386416880","isConditionOrder":false}
```

#### Return parameter

| Parameters | Type | Description                      |
| ---------- | ---- | -------------------------------- |
| cancelIds  | List | List of successful withdrawal ID |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "cancelIds": [
            "2115627377360243492"
        ]
    },
    "succ": true
}
```

***

### Withdraw all orders\&Cancellation of all plan commissions

* **URL**：`/napi/order/order_cancel_all`
* **Method**：`POST`
* **Login required:** Y

#### Request Parameters

| Parameter Name   | Type   | Required | Description                                              |
| ---------------- | ------ | -------- | -------------------------------------------------------- |
| contractName     | String | Yes      | contract Name                                            |
| isConditionOrder | String | yes      | whether it is a conditional list (true is, false is not) |

**Request Example**

```json
{"contractName":"E-BTC-USDT","isConditionOrder":false}
```

#### Return parameter

| Parameters | Type | Description                      |
| ---------- | ---- | -------------------------------- |
| cancelIds  | List | List of successful withdrawal ID |

#### Return Results

```json
{
    "code": "0",
    "msg": "Success",
    "data": {
        "cancelIds": [
            "2115627377360243492"
        ]
    },
    "succ": true
}
```

***

## WSS：

### OrderBook

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_depth_step0","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_depth_step0",
    "data": null,
    "tick": {
        "asks": [
            [
                68265,
                0.1528
            ]
        ],
        "buys": [
            [
                68195,
                0.1911
            ]
        ]
    },
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Latest Transaction (Full Volume)

#### Subscription Parameters

```javascript
{"event":"req","params":{"channel":"market_e_btcusdt_trade_ticker","cb_id":"e_btcusdt","top":100}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_trade_ticker",
    "data": [
        {
            "amount": "13973.44819",
            "ds": "2024-03-18 19:46:03",
            "price": "68329.82",
            "side": "SELL",
            "ts": 1710762363430,
            "vol": "0.2045"
        }
    ],
    "tick": null,
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Latest Deal (Increment)

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_usdt_btcusdt_trade_ticker","cb_id":"e_btcusdt","top":100}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_trade_ticker",
    "data": null
    "tick": {
            "amount": "13973.44819",
            "ds": "2024-03-18 19:46:03",
            "price": "68329.82",
            "side": "SELL",
            "ts": 1710762363430,
            "vol": "0.2045"
        },
    "ts": 1710812527000,
    "status": "ok"
}
```

***

### Trading Pair Real-Time Price Trading Volume

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_ticker","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_ticker",
    "data": null,
    "tick": {
        "amount": "15076475.921172",
        "close": "68264.21",
        "high": "68935.29",
        "low": "67341.29",
        "open": "68276",
        "rose": "-0.00017268",
        "vol": "221.3856"
    },
    "ts": 1710813265000,
    "status": "ok"
}
```

***

### K line (full quantity)

#### Subscription Parameters

```javascript
{"event":"req","params":{"channel":"market_e_btcusdt_kline_60min","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "rep",
    "channel": "market_e_btcusdt_kline_60min",
    "data": [
        {
            "amount": 4458871.49795525,
            "close": 66843.6282,
            "ds": "2024-03-05 16:00:00",
            "high": 66843.6282,
            "id": 1709625600,
            "low": 65533.34,
            "open": 66129.65,
            "tradeId": 0,
            "vol": 67.281
        }
    ],
    "tick": null,
    "ts": 1710813260000,
    "status": "ok"
}
```

***

### K-Line (increment)

#### Subscription Parameters

```javascript
{"event":"sub","params":{"channel":"market_e_btcusdt_kline_60min","cb_id":"e_btcusdt"}}
```

#### Push data

```javascript
{
    "event_rep": "",
    "channel": "market_e_btcusdt_kline_60min",
    "data": null,
    "tick": {
        "amount": 13645.923,
        "close": 68264.21,
        "ds": "2024-03-19 09:00:00",
        "high": 68264.21,
        "id": 1710810000,
        "low": 68195.02,
        "open": 68195.02,
        "tradeId": 0,
        "vol": 0.2
    },
    "ts": 1710812746000,
    "status": "ok"
}
```


# Brand Kit

## PNG

LN Exchange - Horizontal - White Letters \[[Link](https://drive.google.com/file/d/1mxlxs2Mj1Tqn4FnyVTgt9BpHXHMzk2g3/view?usp=drive_link)]

LN Exchange - Horizontal - Black Letters \[[Link](https://drive.google.com/file/d/12syUNb1C8nGLoCPXuz3s4v7FWDI6gFP6/view?usp=drive_link)]

LN Exchange Icon - White \[[Link](https://drive.google.com/file/d/14w6yaBVDTKCUdOMAmCY11AlIVjz5cxad/view?usp=drive_link)]

LN Exchange Icon - Black \[[Link](https://drive.google.com/file/d/1QLQIM29yDdpP_NHYudtDbks4ContUMRW/view?usp=drive_link)]

***

## COLORS

| <img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Frk4IhTskSyDi4n5oywIq%2FCyan.png?alt=media&amp;token=81b7a134-a80f-41e1-a27a-a3b1c22b072f" alt="" data-size="original"> | <img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FVdnDbPMq27auXNKbnCbV%2FCeleste.png?alt=media&amp;token=174eb503-8353-4d4e-9ba9-30045df6d3c1" alt="" data-size="original"> | <img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FWIz10XBwk02aBtaSCGgD%2FWhite.png?alt=media&amp;token=1a364816-4862-4811-af9e-74b0712d8eca" alt="" data-size="original"> |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |


# Connect Nostr

{% hint style="info" %}
How do I get a Nostr Address to connect to LN Exchange?\
Refer to user guides on <https://docs.lnfi.network/user-guides/desktop-users>
{% endhint %}

To connect to LN Exchange, tap on \[Connect Nostr].

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-da72a89a1265bf956c3c6e95d16e43b3aa5a011b%2Fimage%20(36).png?alt=media" alt=""><figcaption></figcaption></figure>

LN Exchange currently supports the following wallets:\
OKX Wallet | TokenPocket | OneKey | Alby

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-1a00e7b65d51b328dc57d0ae289caed6c1746707%2Fimage%20(2).png?alt=media" alt=""><figcaption></figcaption></figure></div>

Once connected, you will see the "Connect success." notification and you're ready to go.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-4e6954886a95e908d87b7730d18c9f0a076d8c94%2Fimage%20(3).png?alt=media" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
If you receive numerous prompts while browsing LN Exchange (note: while browsing, not performing transactions), you can set your Nostr extension permission to "Don't ask again for read public key".

This will ensure an uninterrupted browsing experience on LN Exchange. However, you will still receive prompts when performing transactional actions (Buy/Sell, etc.).
{% endhint %}

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-3204bdc4a02494d65bd37ae426c2ed126f0f9e9a%2Fimage%20(55).png?alt=media" alt=""><figcaption></figcaption></figure></div>


# Invite-Only: Use Referral Code or Become Lnfi Community Partner

Access to LN Exchange is currently invite-only for new users. Use a Referral code to get started.

{% hint style="info" %}
Existing users do not require a Referral Code to get trade.
{% endhint %}

**Don't have a Referral Code?**

1. You can request a referral code from "Lnfi Community Partner" through official Lnfi Network channels, such as\
   \- Telegram: <https://t.me/lnfinetwork>\
   \- Twitter: <https://x.com/lnfinetwork>, <https://x.com/lnexchange><br>
2. Lock 1,000 TREAT and become a "Lnfi Community Partner" to access LN Exchange instantly. Learn more about becoming a Lnfi Community Partner and the benefits.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FcyNJFnBULmX6SIy0tNbj%2Fimage.png?alt=media&amp;token=1e3839a5-6659-4379-8dce-3ea1a996b852" alt=""><figcaption></figcaption></figure>


# Language Selection

To switch to your preferred language, tap on the \[Settings] button on the top right. then tap on \[Language].

{% hint style="info" %}
Currently, only English and Traditional Chinese are supported. We will include more in the later stages of development.
{% endhint %}

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F1Ptq7JOgf0o6hDU1amVn%2Fimage.png?alt=media&amp;token=ebb60eaf-91ba-438a-8b2b-7ab0cf5ae44a" alt=""><figcaption></figcaption></figure>

Select your preferred language to continue.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FrHneozDYpjAKka6fKFrG%2Fimage.png?alt=media&amp;token=2dea2953-4660-40b0-9a39-6379edca433f" alt=""><figcaption></figcaption></figure>


# Deposit / Withdraw

[Deposit / Withdraw](#deposit-withdraw) via Lnfi, Blockchain Mainnets, or Lightning Network\
[Transfer between Spot / Perpetual Account](#transfer-between-spot-perpetual-account) (Available in future update)

***

## Deposit / Withdraw via Lnfi, Blockchain Mainnets, or Lightning Network

1. Tap on \[+] icon.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FtG2cTBuUP5kqGl0cI5PW%2Fimage.png?alt=media&amp;token=3abb5946-6097-4a0a-abc7-d0960047df56" alt=""><figcaption></figcaption></figure>

2. Select between \[Deposit] or \[Withdraw]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FyoNaDe92fFyp1Pnw0VUE%2Fimage.png?alt=media&amp;token=11de433e-5280-455d-9c5b-7be66d02f2c1" alt="" width="460"><figcaption></figcaption></figure></div>

3. Select \[Spot Account] or \[Perpetual Account]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FdkQFRWT0ON6PuvBF4hY4%2Fimage.png?alt=media&amp;token=6e2e5ce2-1d30-4963-bf7c-edacd25f905c" alt="" width="455"><figcaption></figcaption></figure></div>

4. Select the \[Asset]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fl734Tns8Vz520CFHOkg8%2Fimage.png?alt=media&amp;token=3ccc8cbc-509a-4197-ac55-8cf3853d3e88" alt="" width="469"><figcaption></figcaption></figure></div>

Select to deposit/withdraw via \[Lnfi], \[Blockchain Mainnets], or \[Lightning Network].

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FDurEWhaz2GUeR231S3cW%2Fimage.png?alt=media&amp;token=878d1e21-c54e-4dcd-bbdc-41efacafd81e" alt="" width="464"><figcaption></figcaption></figure></div>

5. Select your preferred option to proceed with the user guide:

[Deposit / Withdraw via Lnfi](#deposit-withdraw-via-lnfi)

[Deposit / Withdraw via Blockchain Mainnets](#deposit-withdraw-via-blockchain-mainnets)

[Deposit / Withdraw via Lightning Network](#deposit-withdraw-via-lightning-network)

***

## Deposit / Withdraw via Lnfi

1. Enter the \[Amount], then select \[Approve] and continue to \[Deposit]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FOYdjNq7ElV4k1pkd0ePN%2Fimage.png?alt=media&amp;token=22c84f73-5814-4d77-88d4-7677f08418b4" alt="" width="481"><figcaption></figcaption></figure></div>

2. You will receive a notification once successful. The deposit/withdrawal records can be found on LN Exchange Explorer > Funding Records.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FPpJwLrVcIxABDdxksRh2%2Fimage.png?alt=media&amp;token=17c3b65d-9751-4994-82a0-56c45c418cb6" alt="" width="373"><figcaption></figcaption></figure></div>

***

## Deposit / Withdraw via Blockchain Mainnets

{% embed url="<https://youtu.be/CYnfFDdb_yQ>" %}

{% embed url="<https://youtu.be/6VdlONYwcZQ>" %}

1. Enter the \[Amount], then select \[Submit]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F60EbLdUZgU0rqRYIYE3K%2Fimage.png?alt=media&amp;token=ea351fdd-cd80-4b0a-8955-90c8c582d9ab" alt="" width="470"><figcaption></figcaption></figure></div>

2. Ensure you select the correct Blockchain Mainnet and verify the asset you are sending or receiving. Tap the green \[Deposit / Withdraw] button below to continue.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FEYCTbutA6Jf6XFNnSN87%2Fimage.png?alt=media&amp;token=f6491abc-80fb-4fec-9359-f61754813640" alt="" width="467"><figcaption></figcaption></figure></div>

3. There is an additional step for Withdraw, you need to tap on \[Pay Invoice]\
   ![](https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F0ebaXKr22pWHpcYSF8e3%2Fimage.png?alt=media\&token=aedb8662-531c-4509-91e1-11a803f33dfc)

***

## Deposit / Withdraw via Lightning Network

1. For Deposit, tap on \[Create Invoice]

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F9H9aOk5uTHCsQZDpxiMU%2Fimage.png?alt=media&amp;token=9330324c-a3f4-49a9-9510-ea0e3508230a" alt="" width="369"><figcaption></figcaption></figure></div>

2. Copy the \[Invoice] and paste to your Lightning-enabled wallet to complete the transfer.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F5Zy4mhepFtIOyDHlafbG%2Fimage.png?alt=media&amp;token=b2c4b778-e390-43e2-a24e-f69bf9eac094" alt="" width="371"><figcaption></figcaption></figure></div>

3. For Withdraw via Lightning Network, generate a Lightning Invoice on your Lightning-enabled wallet. Then paste the Invoice ID into the LN Exchange Withdraw Invoice Field. Tap on \[Submit] to complete the withdrawal.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FUvhyPERlUyUHQKPF5Gxm%2Fimage.png?alt=media&amp;token=09b50f2c-532c-4104-9420-a64cf77ef821" alt="" width="375"><figcaption></figcaption></figure></div>

***

## Transfer between Spot / Perpetual Account&#x20;

Will be available in future update.

1. Tap on \[+] icon.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FjtraGwOKSVBuLYKmL8BM%2Fimage.png?alt=media&amp;token=68d12879-a3f1-4f60-9861-86d0fbdd6fe7" alt=""><figcaption></figcaption></figure>

2. Switch between Spot and Perpetual Accounts as the source for transfers.&#x20;

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FX8ircGQP0p2FO6G86WBn%2Fimage.png?alt=media&amp;token=61b288af-e573-4dc1-a182-d705797a9b6d" alt="" width="416"><figcaption></figcaption></figure></div>

3. Select \[Asset], and input \[Amount]. Tap on \[Transfer] to proceed with the transfer.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F76ovzqL9tK37IkHX38p5%2Fimage.png?alt=media&amp;token=ba93a88a-cd00-4034-96fb-422d18186d0c" alt="" width="416"><figcaption></figcaption></figure></div>

4. You will receive a notification once successful.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FDx6jnl72Hv1isfeuJ5Ss%2Fimage.png?alt=media&amp;token=dd967334-0dd2-4506-ad1f-e62792ab32a0" alt="" width="356"><figcaption></figcaption></figure></div>


# Spot Trading

Buy and sell on the Spot market

{% hint style="info" %}
If your LN Exchange account is new, tap on \[Enable trading] to trade spot.
{% endhint %}

## Spot Trading Interface

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FIl7bigs8GySSpvf2Y6Nw%2Fimage.png?alt=media&amp;token=79c98467-8837-4b98-bb8f-35a55066cd3a" alt=""><figcaption></figcaption></figure>

1. Select the Trading Pair.
2. Trading volume of the trading pair in the past 24 hours.
3. Buy / Sell Order section with Limit, Market & Trigger Order Type.
4. Deposit or Withdraw. Displays the balance of BTC & USDT of your Spot account.

***

## Open Orders Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-07d1a33091eb2d2a36e71ec0b62efaf6ba1448a7%2Fimage%20(51).png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Time/Event ID**\
   Records the time when the order is created and the corresponding Nostr Event ID. Anyone can search the Nostr Event ID on the LN Exchange Explorer to view the specific details.
2. **Order ID**

   The numerical identifier for this order.
3. **Asset**\
   Indicates the asset type of this order.
4. **Type**\
   Indicates the order type.
5. **Side**\
   Indicates if this order is Buy or Sell.
6. **Price**\
   The price at which the order will be executed.
7. **Remaining/Amount**\
   The remaining amount / the total order amount.
8. **Remaining/Order Value**\
   The remaining order value / the total order value.
9. Filled\
   Indicates the % of order completion.
10. **Status**\
    Indicates the status of the order. Unfilled or Filled.
11. **Cancel**\
    Immediately close all positions or individually close positions.

***

## Trigger Orders Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-b2d896d6a17fe7aa5b6bfcac608857a60a4f7e7e%2Fimage%20(54).png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Time/Event ID**\
   Records the time when the order is created and the corresponding Nostr Event ID. Anyone can search the Nostr Event ID on the LN Exchange Explorer to view the specific details.
2. **Trigger Price**\
   The price level at which a trigger order becomes active.
3. **Price**\
   The price at which the order will be executed.
4. **Amount**\
   The amount of the asset involved in the order.
5. **Expiration Time**\
   The deadline by which an order must be executed or it will be automatically canceled\\

***

## How to Trade Spot

### Limit Order

{% hint style="info" %}
A Limit Order is an order to buy or sell an asset at a specific price or better. It gives you control over the price but may not execute if the market doesn't reach your desired level.
{% endhint %}

Choose between \[Buy] or \[Sell], and then select \[Limit]

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F305KLyDIUq44Qh125GQX%2Fimage.png?alt=media&amp;token=493cc7c6-be38-469b-9067-77fe091d965b" alt=""><figcaption></figcaption></figure>

The default mode is Limit Order.

{% hint style="info" %}
Learn about [Order Types](/orderbook-order-types-fees), such as Market Orders & Trigger Orders, etc.
{% endhint %}

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FBjkknKUUqD9SxKrx6XXd%2Fimage.png?alt=media&amp;token=6a4e55d9-a17d-4bcf-8553-44e97f2ce642" alt=""><figcaption></figcaption></figure>

Let's take buying BTC using Limit Order as an example. Select BTC/USDT trading pair.

For example, if BTC is trading at 63,000 USDT but you want to buy it at 60,000 USDT, you can place a limit order. Your order will be executed when the market price drops to 60,000 USDT.

Enter the desired price at \[Price] and the \[Buy Amount].

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FhDn7KRRfQXGePoCM759i%2Fimage.png?alt=media&amp;token=c9f81e31-5c31-42da-a7ff-1c4fabbd7f01" alt=""><figcaption></figcaption></figure>

Tap on \[Buy BTC] to proceed with the order.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FGAiF0PpfVrlg7XAf6igf%2Fimage.png?alt=media&amp;token=0f01c8e5-45b2-40ea-b8ab-93e7871413b0" alt=""><figcaption></figcaption></figure>

Once completed, your Limit Order will appear under \[Open Order] if it is still pending price action.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fgit-blob-546fab8dad34eecb173e55b2eaf8cb1b4f2937ab%2Fimage%20(47).png?alt=media" alt=""><figcaption></figcaption></figure>

***

### Market Order

{% hint style="info" %}
A **Market Order** is an order to buy or sell an asset immediately at the best available current price. When you place a market order, you're prioritizing speed of execution over the price, meaning the order will fill as quickly as possible at whatever the current market price is, rather than waiting for a specific price.
{% endhint %}

In this example, we use the BTC/USDT pair.  Choose between \[Buy] or \[Sell], and then select \[Market].

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FSzaTqWbor3jncPYYvgzZ%2Fimage.png?alt=media&amp;token=0c82eb17-a17e-4660-9551-d7582437b898" alt=""><figcaption></figcaption></figure>

Enter the total amount of USDT you want to use to buy BTC, then tap on \[Buy BTC].&#x20;

{% hint style="info" %}
Market orders may be filled immediately, check the Order History for records if it does not appear under Open Orders.
{% endhint %}

***

### Trigger Order

{% hint style="info" %}
A **Trigger Order** is a type of order that becomes active only when the market reaches a specified price, known as the **trigger price**. Unlike a regular market or limit order, the trigger order remains dormant until the market price hits the set trigger. Once this happens, the trigger order automatically converts into a market or limit order and executes based on the current market conditions.
{% endhint %}

In this example, we use the BTC/USDT pair. Choose between \[Buy] or \[Sell], and then select \[Trigger]

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FooM66ifcJfqTuSh3JzRf%2Fimage.png?alt=media&amp;token=ddafab0e-8349-4514-871a-7ea118cb316f" alt=""><figcaption></figcaption></figure>

For example, if BTC is trading at 59,800 but you want to buy it at 58,500 USDT but only if the BTC price drops to 59,000, you can place a trigger order. Your order will be placed when the market price drops to 59,000.

Enter the amount for\
**\[Trigger Price]** - This is the price level at which the order to buy will be activated.

**\[Price]** - This is the limit price you've set for your buy order. Once the trigger price is reached, the order will be placed to buy Bitcoin, but only if the market price is at or below the price level.

**\[Buy Amount]** - This is the amount of Bitcoin you wish to purchase.

Once completed, your Trigger Order will appear under \[Trigger Orders] if it is still pending price action.

#### Possible Scenarios for using Trigger Order

1. **Breakout and Pullback**: The trader expects the price to break above 59,000 USDT, signaling a potential upward trend, but anticipates a pullback to 58,500 USDT before continuing higher. The order is set to buy at a lower price after confirming the breakout.
2. **Safety Net for Buying Lower**: The trader might be using the trigger as a way to confirm that the price has reached a certain level, but still wants to buy at a lower price if the market retraces. This setup ensures they only enter the market if the price has shown upward momentum but at a better price point.
3. **Volatile Market**: In a highly volatile market, the trader might use this approach to avoid buying during a rapid price surge but still wants to catch a potential dip after the surge.

{% hint style="info" %}
This strategy is more complex and is usually employed by experienced traders who anticipate specific market behaviors and want to manage risk while maximizing potential gains.
{% endhint %}

For other types of orders such as Post Only, IOC, FOK orders, please refer to \[[Order Types](/orderbook-order-types-fees)].

***

## Cancel Orders

To cancel an Open Order or Trigger Order, simply tap the \[Cancel] button in the corresponding tab.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FpDwYjcg2ADlgmC8wF4Ve%2Fimage.png?alt=media&amp;token=ac6ec9e3-e14f-4ee6-967c-b8abb3588df1" alt=""><figcaption></figcaption></figure>

If you need to cancel all orders quickly, tap the \[Cancel All] button.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FThRHTfo2uzDPZFKgQvbr%2Fimage.png?alt=media&amp;token=bcf6c542-53bf-4c72-a5a0-59af8b5d5e32" alt=""><figcaption></figcaption></figure>


# Perpetual Trading

Trade USDT-margined and ALTCOIN-margined perpetual contracts with no expiration and leverage.

{% hint style="info" %}
If your account is new, tap on \[Enable trading] to start trading.
{% endhint %}

{% embed url="<https://youtu.be/PodEfAR8nxc>" %}

## Perpetual Trading Interface

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FemVzug9vMk37czKrhVC5%2Fimage.png?alt=media&amp;token=1001f8ff-9112-46f6-b35c-214f21c9640f" alt=""><figcaption></figcaption></figure>

Select the Trading Pair. Tap on \[All Markets].\
1.2  Select \[USDⓈ-M] for USDT-margined perpetual contracts\
1.3  Select \[ALTCOIN-M] for ALTCOIN-margined perpetual contracts<br>

1. Last price and [Mark price](/perpetual/mark-price).\
   \
   **Last price:** This is the last traded price of the contract, which may differ from the mark price. It reflects the most recent transaction on the exchange.\
   \
   [**Mark price**](/perpetual/mark-price)**:** The mark price is used to settle profits and losses and trigger forced liquidation. The mark price may deviate from the latest market price to prevent losses due to market manipulation.\
   \
   [Funding Rate](/perpetual/funding-rates), Countdown, and Next Funding\
   \
   [**Funding Rate**](/perpetual/funding-rates)**:** The funding rate that long and short positions must exchange at the next funding rate interval. If the rate is positive, long positions pay short positions. If the rate is negative, short positions pay long positions.\
   \
   **Countdown:** The countdown shows the time remaining until the next funding occurs.\
   \
   Trading volume of the trading pair in the past 24 hours.
2. [Deposit or Withdraw](/getting-started/deposit-withdraw). Displays the USDT balance of your USDT-margined account or your ALTCOIN balance of your ALTCOIN-margined account.&#x20;
3. Open / Close Order section with Limit, Market & Trigger Order Type. Cross & Isolated Mode available with leverage options.

***

### Positions Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FIZExN7yzAbEiDt6neXAt%2Fimage.png?alt=media&amp;token=f21b63eb-c3e6-4a0c-922d-d3e388888109" alt=""><figcaption></figcaption></figure>

**Positions** on Perpetual Contracts refer to the traders' open trades, representing their market outlook. A position indicates whether the trader expects the underlying asset's price to rise or fall. In Perpetual Trading, Positions are classified as **Long** or **Short**, and they remain open until the trader chooses to close them or they are liquidated due to insufficient margin.

<details>

<summary><strong>Positions Interface Explanation</strong></summary>

You can view your order in the Positions tab if it is executed. The position information is described as follows:

### **1. Size/Avbl (Size/Available)**

Displays the total quantity of the current position and the available quantity to close. If there is an active closing order, the available quantity to close will be less than the total size quantity.

### **2. Entry Price**

The Average Entry Price of the current position, calculated as\
\
`Average Entry Price = [( ContractQty1 x EntryPrice1 ) + ( ContractQty2 x EntryPrice2 ) + …] /( ContractQty1 + ContractQty2 + … )`

Each time a new position is added, the Entry Price is recalculated.

### **3. Mark Price**

Our Perpetual contracts platform uses a uniquely designed Mark Price system to prevent unnecessary forced liquidation in highly leveraged products. Without this system, the Mark price could deviate unnecessarily from the price index due to market manipulation or lack of liquidity, leading to unnecessary forced liquidation. \
\
This system uses the Mark Price for liquidation price determination, thereby avoiding unnecessary liquidations.

### **4. Margin/Ratio**

#### **Margin:**

All contracts in perpetual trading require a margin. Margin trading allows your contract to use greater leverage.

* Isolated Margin:\
  `Margin = Initial margin for opening a position + manually added or subtracted margin + unrealized PNL`\
  \
  Initial margin = Position Value / Leverage.
* Cross Margin:\
  `Margin = Total balance of the Cross-margin account + unrealized PNL`

#### **Initial Margin Ratio**

The minimum margin required to open a position, where the \
Initial Margin Ratio `= 1 / Leverage Multiplier`

#### **Maintenance Margin Ratio**

The minimum margin required to maintain a position. Falling below this level will trigger a full or partial liquidation event.

### **5. PNL(ROE%):**

The Profit and Loss of the current position are calculated based on the Average Entry Price and Mark price. This includes both realized and unrealized PNL.&#x20;

`Return rate = PNL / Margin`

#### **Realized PNL:**

Profits already settled into the user's balance, including Trading fees, Funding Fees, Closing PNL, and Settlement Earnings. Since unrealized PNL is settled every minute, Realized PNL is constantly updated.

### **6. Liq. Price (Liquidation Price)**

When the mark price reaches the liquidation price of the position, the system will liquidate the position. Please monitor the risk of your positions and increase your margin or close positions promptly.

### **7. Closing Position**

#### **Market Close:**

* **Market Order (full position)**\
  When using this Market Order to close your positions, it will close your entire position at the best available Market Price.

**Limit Close:**

* **Limit Order**\
  For Limit Order closing, you need to specify the closing price and quantity.
* **Market Order (specify quantity)**\
  For this Market Order, you need to specify the quantity for closing.

### **8. TP/SL For Position**

Set Take Profit or Stop Loss for the entire position.

</details>

***

### Open Order Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FkMncnK5Qb5lrG89MufQq%2Fimage.png?alt=media&amp;token=63668567-2b92-4a18-a755-aa2357f4779c" alt=""><figcaption><p>Open Orders Tab Interface</p></figcaption></figure>

**Open Orders** on perpetual contracts are buy or sell orders that have been placed on the exchange but have not yet been executed or filled. These orders are essentially waiting to be matched with a corresponding counterparty at the desired price.

<details>

<summary>Open Order Interface Explanation</summary>

### 1. Order ID

Order ID assigned to this Open Order. Users can search for this Order ID on LN Exchange Explorer to view the recorded details.

### 2. Direction

Types of Direction:

* **Open Long**: Buying a contract expecting the price to rise.
* **Close Long**: Selling the long position to lock in profit or minimize loss.
* **Open Short**: Selling a contract expecting the price to fall.
* **Close Short**: Buying back the short position to secure profit or limit loss.

### 3. Price

The **price** refers to the value at which the user is requesting to execute a trade, whether you're opening a long or short trade.

### 4. Amount

The **amount** refers to the quantity of the asset the user wishes to buy or sell.

### 5. Filled

**Filled** refers to the portion of the user's order that has been successfully executed at the specified price. \
\
For example, if you placed an open order to buy **1 BTC** at a price of **60,850** and **0.5 BTC** of that order is filled, it means that half of your order has been executed, and you now own **0.5 BTC** at that price. The remaining portion of the order would still be open until it is either filled, canceled, or expires.

### 6. Reduced Only

**Reduce Only** is an order type that ensures the user's trade will only decrease their existing position size, preventing any increase in exposure.

* **Reduce Only (Yes)**: The order can only decrease the position size.
* **Reduce Only (No)**: The order can increase, decrease, or maintain the position size.

### 7. TP/SL

If TP/SL has been set while placing the order,  the user can view the TP/SL details. Users cannot set or modify TP/SL in the Open Orders Tab.&#x20;

### 8. Action

**Cancel** - Cancel this order.\
Use the **Cancel All button** to cancel all Open Orders in one click.

</details>

### Trigger Order/Stop Limit Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FhnIkcGVzwMOoAFp5V4TX%2Fimage.png?alt=media&amp;token=d741cdd5-6ec5-412d-8b85-a59b725a60e6" alt=""><figcaption></figcaption></figure>

**Trigger Orders** and **Stop Limit Orders** are advanced order types used in trading to help manage risk and automate trading strategies. These orders activate when a specified price level, known as the trigger price, is reached. Once this trigger price is hit, the order executes as a market or limit order, based on the user's configuration.

<details>

<summary>Trigger Orders/Stop Limit Interface Explanation</summary>

### 1. Expiration Time

The **expiration time** in a trigger order specifies how long the order remains active before it automatically expires if not executed. It determines the validity of the order and can configured in settings.

### 2. Type

There are typically 4 main types:&#x20;

* **Limit (Take Profit)**
* **Limit (Stop Loss)**
* **Market (Take Profit)**
* **Market (Stop Loss)**

### 3. Direction

Types of Direction:

* **Open Long**: Buying a contract expecting the price to rise.
* **Close Long**: Selling the long position to lock in profit or minimize loss.
* **Open Short**: Selling a contract expecting the price to fall.
* **Close Short**: Buying back the short position to secure profit or limit loss.

### 4. Trigger Price

The **trigger price** is the specific price level that activates a trigger order. When the market reaches this price, the order becomes active and can be executed as either a market or limit order, depending on how it's set up. \
\
For example, if you set a trigger price of $50 for a sell order, the order will activate when the market price reaches $50.

### 5. Price

The **price** refers to the value at which the user wants the order to be executed once the trigger price is reached, whether they are looking to open a long or short position.

### 6. Amount

The **amount** refers to the quantity of the asset the user wishes to buy or sell.

### 7. Reduce Only

**Reduce Only** is an order type that ensures the user's trade will only decrease their existing position size, preventing any increase in exposure.

* **Reduce Only (Yes)**: The order can only decrease their position size.
* **Reduce Only (No)**: The order can increase, decrease, or maintain their position size.

### 8. Action

**Cancel** - Cancel this order.\
Use the **Cancel All button** to cancel all Open Orders in one click.

</details>

***

### Order History Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FXeksnEaDLHUzCgSiqM9V%2Fimage.png?alt=media&amp;token=7f7b63e0-3c7a-4d0a-8762-6b7bbbc1d539" alt=""><figcaption></figcaption></figure>

This is a record of all the orders the user has placed, whether they’ve been filled, partially filled, or are still open or expired.

<details>

<summary>Order History Interface</summary>

### 1. Order ID

Order ID assigned to this Order. User can search for this Order ID on LN Exchange Explorer to view the recorded details.

### 2. Type

There are typically 2 main types:&#x20;

* **Limit**
* **Market**

### 3. Direction

Types of Direction:

* **Open Long**: Buying a contract expecting the price to rise.
* **Close Long**: Selling the long position to lock in profit or minimize loss.
* **Open Short**: Selling a contract expecting the price to fall.
* **Close Short**: Buying back the short position to secure profit or limit loss.

### 4. Price

The price refers to the value at which a user has placed an order to buy or sell an asset.&#x20;

### 5. Amount

The **amount** refers to the quantity of the asset the user wishes to buy or sell.

### 6. Executed Amount

The **executed amount** refers to the portion of the total order that has been successfully completed, meaning how much of the requested buy or sell order was actually fulfilled.

### 7. Average Price

The **average price** refers to the weighted average cost per unit of an asset based on multiple executed trades or orders. It is calculated by taking the total cost of all filled orders and dividing it by the total executed amount.

### 8. Profit

Indicates if the order has yielded a profit or a loss.

### 9. Fee

A fee is the cost incurred to execute a trade. Fees for maker and taker orders may vary, affecting overall profit margins.

### 10. Status

There are 4 types of status:

* Filled
* Partial Filled
* Cancelled
* Expired

</details>

***

### Trigger Order History Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FZVAbjyp5RkyaO7zyx4SG%2Fimage.png?alt=media&amp;token=4bc650a1-0a5d-4150-9e62-5681d0b241c8" alt=""><figcaption></figcaption></figure>

**Trigger Order History** is a record of all trigger orders placed by the user —orders that are set to execute once a specific trigger price is reached.

<details>

<summary>Trigger Order History Interface</summary>

### 1. Order ID

Order ID assigned to this Order. User can search for this Order ID on LN Exchange Explorer to view the recorded details.

### 2. Direction

Types of Direction:

* **Open Long**: Buying a contract expecting the price to rise.
* **Close Long**: Selling the long position to lock in profit or minimize loss.
* **Open Short**: Selling a contract expecting the price to fall.
* **Close Short**: Buying back the short position to secure profit or limit loss.

### 3. Trigger Price

The **trigger price** is the specific price level that activates a trigger order. When the market reaches this price, the order becomes active and can be executed as either a market or limit order, depending on how it's set up. \
\
For example, if you set a trigger price of $50 for a sell order, the order will activate when the market price reaches $50.

### 4. Price

The price refers to the value at which a user has placed an order to buy or sell an asset.&#x20;

### 5. Amount

The **amount** refers to the quantity of the asset the user wishes to buy or sell.

### 6. Executed Amount

The **executed amount** refers to the portion of the total order that has been successfully completed, meaning how much of the requested buy or sell order was actually fulfilled.

### 7. Average Price

The **average price** refers to the weighted average cost per unit of an asset based on multiple executed trades or orders. It is calculated by taking the total cost of all filled orders and dividing it by the total executed amount.

### 8. Profit

Indicates if the order has yielded a profit or a loss.

### 9. Fee

A fee is the cost incurred to execute a trade. Fees for maker and taker orders may vary, affecting overall profit margins.

### 10. Reduce Only

**Reduce Only** is an order type that ensures the user's trade will only decrease their existing position size, preventing any increase in exposure.

* **Reduce Only (Yes)**: The order can only decrease their position size.
* **Reduce Only (No)**: The order can increase, decrease, or maintain their position size.

### 11. Status

There are 4 types of status:

* Expired
* Filled
* Fail
* Cancelled

</details>

***

### Trade History Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fr3844izzxPRn7NRuJsFh%2Fimage.png?alt=media&amp;token=52ad27d0-d49c-4905-b47c-8904c441459a" alt=""><figcaption></figcaption></figure>

This is a record of all completed trades that have taken place, showcasing the actual transactions. A single order may be divided into multiple trades to fully execute it.

<details>

<summary>Trade History Interface</summary>

### 1. Direction&#x20;

Types of Direction:

* **Open Long**: Buying a contract expecting the price to rise.
* **Close Long**: Selling the long position to lock in profit or minimize loss.
* **Open Short**: Selling a contract expecting the price to fall.
* **Close Short**: Buying back the short position to secure profit or limit loss.

### 2. Average Price

The **average price** represents the mean price at which an asset was bought or sold during a trade. It is calculated by dividing the total cost of the trade by the total number of units traded. This figure helps traders assess their entry or exit point.

### 3. Amount&#x20;

The amount indicates the total number of units or contracts traded in a specific transaction. It reflects how much of the asset was bought or sold.

### 4. Fee

The fee is the cost incurred when executing a trade, which can be a percentage of the trade value or a fixed amount. Fees may vary depending on whether the order is a maker or taker and can impact overall profitability.

### 5. Role&#x20;

The role specifies whether the trader acted as a maker or taker in the transaction. A maker adds liquidity to the market by placing limit orders, while a taker removes liquidity by placing market orders that fill existing orders. Understanding the role helps traders evaluate their trading strategy and the associated costs.

### 6. Realized Profits&#x20;

Realized profits/loss refer to the gains that a trader has actually made from a trade after closing a position.

</details>

***

### Position History Tab

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FsminjZuTKJNPG6ebygB3%2Fimage.png?alt=media&amp;token=6559f055-90c8-42cc-9d2e-6994faba8f15" alt=""><figcaption></figcaption></figure>

**Position History** is a record of all Open and Closed positions that a user has held in their trading account. It provides detailed information about the user's trading activities related to specific contracts.

<details>

<summary>Position History Interface</summary>

### 1. Entry Price&#x20;

The Average Entry Price of the entire position. If the position was filled in a single transaction without any additional entries, the Average Entry Price will be the price of the first transaction.\
\
If there were multiple entries, it would be the weighted average price after all entries.&#x20;

Each time a new position is added, the Entry Price is recalculated\
\
i.e.\
`Average Entry Price = [( ContractQty1 x EntryPrice1 ) + ( ContractQty2 x EntryPrice2 ) + …] /( ContractQty1 + ContractQty2 + … )`

### 2. Avg. Close Price:

The weighted average of the prices for multiple closing transactions.

### 3. Open Size / Closed Size:

The total number of Open and Closed contracts accumulated for the position.

### 4. Trade Fee:

The total accumulated fees for Opening and Closing the position.

### 5. Funding Fee:

The total Funding Fees paid or received during the holding period, are settled directly between users on the platform.

### 6. Closed PNL:

This is the sum of the profit or loss for each time the position is closed. The PNL is calculated based on the difference between the Average Entry Price and the Average Close Price, without considering fees and Funding Fees.

### 7. Total PNL:&#x20;

The total profit or loss realized during the holding period of the position. \
`Realized PNL = Fees + Funding Fees + Position PNL + Allocation.`

</details>

***

## Cross & Isolated Margin Mode

### **Cross Margin Mode**

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FB29if6AEROcV50w883CB%2Fimage.png?alt=media&amp;token=1df9fdcd-0f36-4d6e-aade-5a2ed58265c9" alt="" width="284"><figcaption></figcaption></figure></div>

With cross margin, all your open positions using the same asset share the same pool of funds. If one of your positions faces liquidation, your entire balance and any other open positions using that asset may be lost.

{% hint style="info" %}
If you’re trading BTC-USDT or ETH-USDT, all your positions that use USDT share the same pool of funds. If one of your positions is liquidated, your entire USDT balance and any open positions across both BTC-USDT and ETH-USDT could be lost.
{% endhint %}

**Advantages**

* **Increased Leverage**: Use your entire balance to support larger positions.
* **Reduced Liquidation Risk**: Profits from one trade can cover losses in others.

**Disadvantages**

* **Higher Risk**: If one position is liquidated, it can affect all positions using the same margin.
* **Less Control**: All positions rely on the same pool of funds.

### **Isolated Margin Mode**

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fa4vzbjVESWXm8PuDPAnD%2Fimage.png?alt=media&amp;token=ba7bec01-b9ca-4dc6-bb93-fdc42a3deb74" alt="" width="280"><figcaption></figcaption></figure></div>

With isolated margin, you can manage your risk by setting a specific amount of margin for each position. If the margin for a position reaches 100%, it will be liquidated. You can also add or remove margin from your positions as needed.

{% hint style="info" %}
For example, if you allocate 100 USDT for your BTC-USDT position and 50 USDT for your ETH-USDT position, only those amounts are at risk.&#x20;

If the margin for your BTC-USDT position reaches 100%, that position will be liquidated, but your ETH-USDT position and its margin will remain safe. You can also add or remove USDT margin from each position whenever you need.
{% endhint %}

**Advantages:**

* **Limited Leverage**: Less capital available for larger positions.
* **Quick Liquidation Risk**: If the margin reaches 100%, that position is liquidated immediately.

**Disadvantages:**

* **Controlled Risk**: Limit margin for each position, protecting your overall balance.
* **Individual Management**: Each position is separate, allowing for targeted risk control.

***

## Leverage

{% hint style="danger" %}
**While leverage can increase your gains, it also increases your risk, so it's important to use it carefully.**
{% endhint %}

Leverage allows you to control a larger position in the market with a smaller amount of your capital.&#x20;

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FIE7CvXQhVZsBm5aw42U1%2Fimage.png?alt=media&amp;token=14f04602-7733-4ce8-a1f8-ba67abad788d" alt=""><figcaption></figcaption></figure></div>

For example, if you use 10x leverage, you can trade with $1,000 by only putting down $100 of your own money. This amplifies both potential profits and potential losses.&#x20;

{% hint style="info" %}
The Leverage cannot be changed if you have an open order/position.
{% endhint %}

USDT-margined maximum leverage: 20\
ALTCOIN-margined maximum leverage: 20\
\
\*Maximum Leverage may be adjusted in the future.

***

## How to Trade USDT-Margined or ALTCOIN-Margined Perpetual

1. Choose USDT-Margined Contracts or Alt-coin Margined Contracts.

{% hint style="info" %}
For USDT-Margined contracts, USDT is the collateral used for the placed order.

For ALTCOIN-Margined contracts, the specific ALTCOIN is used as collateral for the placed order.
{% endhint %}

2. Choose Order Type

{% hint style="info" %}
An **Open Order** starts a new trade by buying or selling.&#x20;

A **Close Order** ends a trade by closing an existing position.&#x20;
{% endhint %}

3. Choose [Cross or Isolated Margin Mode](#cross-and-isolated-margin-mode) and set the [leverage](#leverage).
4. Choose between Limit Order, Market Order, or Trigger Order.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2F73jtUF8RotYoHSUeYe1Z%2Fimage.png?alt=media&amp;token=52a93cf6-0c20-469e-bd07-64e52e7532db" alt=""><figcaption></figcaption></figure>

**Limit Order** is an order to buy or sell an asset at a specific price or better. It gives you control over the price but may not execute if the market doesn't reach your desired level.

**Market Order** is an order to buy or sell an asset immediately at the best available current price. When you place a market order, you're prioritizing speed of execution over the price, meaning the order will fill as quickly as possible at whatever the current market price is, rather than waiting for a specific price

**Trigger Order** is a type of order that becomes active only when the market reaches a specified price, known as the **trigger price**. Unlike a regular market or limit order, the trigger order remains dormant until the market price hits the set trigger. Once this happens, the trigger order automatically converts into a market or limit order and executes based on the current market conditions.

{% hint style="info" %}
**Advanced Limit Orders**

* **PO (Post Only):** This ensures the order is placed as a Maker order and will not immediately execute against existing orders in the market. If the order matches an existing one, it will be canceled.
* **IOC (Immediate or Cancel):** If an order is set to "Immediate or Cancel," any portion of the order that is not immediately filled will be canceled.
* **FOK (Fill or Kill):** The order must be filled otherwise, it will be canceled immediately.
  {% endhint %}

5. Choose your Trade Action.

{% hint style="info" %}

* **Open Long**: When you *buy* an asset because you expect its price to go up. You’re opening a position to sell it later at a higher price.
* **Open Short**: When you *sell* an asset you don’t own (borrowing it) because you expect its price to go down. You plan to buy it back later at a lower price to profit from the difference.
* **Close Long**: When you *sell* the asset you bought in a long position, effectively exiting the trade and locking in profits or losses.
* **Close Short**: When you *buy back* the asset you sold in a short position, closing the trade and settling your profits or losses.
  {% endhint %}

6. Approve and confirm the trade.
7. Your order will first show up under \[Open Orders]. After it is filled, it will move to the Positions tab. For trigger or stop limit orders, once the trigger condition is met, an order will be placed and appear under Open Orders.

***

## Take Profit / Stop Loss (TP/SL)

TP/SL enables you to set automatic price levels to secure profits (Take Profit) and limit losses (Stop Loss).

{% hint style="info" %}
**Take Profit**: Automatically closes your position to secure profits when the price reaches a specified level.\
\
**Stop Loss**: Automatically closes your position to limit losses when the price hits a specified level.
{% endhint %}

In the basic TP/SL mode, the system automatically places a Market Order according to the Take Profit Trigger price and Stop Loss Trigger price.

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FoAlEhMtdjOEn8i2at7Vy%2Fimage.png?alt=media&amp;token=c397565b-072b-4ef8-8a26-2d5620ad2f3f" alt="" width="288"><figcaption></figcaption></figure></div>

#### Market TP/SL

If the user sets a Market Order to Take Profit and Stop Loss, once the condition is triggered, the system will send the order to the market at the current market price, facilitating quick execution. Market TP/SL can execute immediately but does not guarantee the execution price. This approach is suitable for smaller positions or markets with excellent liquidity.

### Advanced TP/SL

<div align="left"><figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FlCXnZCgKzK3wIWcxFp6d%2Fimage.png?alt=media&amp;token=fa44891d-14c8-4a13-bc79-a0208b5a48c8" alt="" width="389"><figcaption></figcaption></figure></div>

The "Take Profit and Stop Loss" advanced mode includes both Limit take TP/SL and Market TP/SL orders. When the latest market price reaches the trigger price, the system automatically places an order according to the user’s pre-set price.&#x20;

#### **Limit TP/SL**

If the user sets a limit order for Take Profit and Stop Loss, once the TP/SL condition is triggered, the system will send the order to the market as a limit order. Limit TP/SL can secure better prices but do not guarantee execution. This approach is suitable for larger positions or markets with insufficient liquidity.

**For Long positions:**

* The Take Profit trigger price must be set higher than the latest price.
* The Stop Loss trigger price must be greater than the liquidation price and less than the current latest price.

**For Short positions:**

* The Take Profit trigger price must be set lower than the latest price.
* The Stop Loss trigger price must be greater than the current latest price and less than the liquidation price.

### **How to set TP/SL**

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FfCohQz2f3hTFyBWgmK7e%2Fimage.png?alt=media&amp;token=4c438bc4-6c1d-4f4b-8805-fde60127ca59" alt=""><figcaption></figcaption></figure>

1. Check the box to enable TP/SL.
2. Enter the target price for TP and/or SL Trigger. A TP/SL Trigger order will be placed, and when the price reaches the Trigger price, a Market order will be executed.
3. Use \[Advanced] for more complex TP/SL strategies. \
   You can set the Trigger Price to activate and place a limit order.\
   \
   **TP Limit Order Trigger example:**\
   If you hold a long position in Bitcoin at $60,000 and want to take profit if the price reaches $64,000, but you prefer to sell at a limit price of $63,500 to secure some profit. You would set a Trigger Price at $64,000. When Bitcoin hits that price, a limit order to sell at $63,500 will be placed. If the price rises to $64,000 and then dips before reaching $63,500, your order will execute at your limit price, ensuring you don’t sell for less than your desired target.\
   \
   **SL Limit Order Trigger example:**\
   If you have opened a short position in Bitcoin at $64,000 and want to limit your losses if the price rises to $66,000. You can set a Trigger Price at $66,000. When Bitcoin reaches that price, a limit order will be placed to buy back at $66,500. This way, if the price rises to $66,000, your order will trigger, and you’ll buy back at $66,500 to close your position, helping to minimize your losses while ensuring you don’t buy back at a price higher than your target limit.

**Note:**

* A position can only have one TP and one SL order at most. The system will use the most recently submitted parameters to set the TP/SL, and any existing historical orders will be canceled.
* When the TP/SL is triggered, it will default to executing 100% of the user’s current available closing quantity. If there are already other closing orders and no available positions to Take Profit or Stop Loss, the execution will fail.
* Take Profit and Stop Loss orders are essentially conditional orders, with a default validity period of 14 days. If the period exceeds this timeframe, the order will automatically expire and become invalid. The validity period can be adjusted in settings.

***

## Closing Position

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FqoggHxEq0cl8CyHuMy1o%2Fimage.png?alt=media&amp;token=452d9cce-dd68-4847-a5bd-8bee36097bc7" alt=""><figcaption></figcaption></figure>

**1. Market Close:**

* **Market Order (full position)**\
  When using this Market Order to close your positions, it will close your entire position at the best available market price.

**2. Limit Close:**

* **Limit Order**\
  For Limit Order closing, you need to specify the closing price and quantity.\
  ![](https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fd3uB2vP55i6en6Dh4ZOR%2Fimage.png?alt=media\&token=e0a8562f-8d59-4240-9ef8-ac74015525a2)
* **Market Order (specify quantity)**\
  For this Market Order, you need to specify the quantity for closing.\
  ![](https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2Fw9BTlPF8f1AmcykHY2TR%2Fimage.png?alt=media\&token=8d74b69f-2f62-4a4a-8814-2549f960e3ae)<br>

***

## Cancel Orders

To cancel an Open Order or Trigger Order, simply tap the \[Cancel] button in the corresponding tab.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FpDwYjcg2ADlgmC8wF4Ve%2Fimage.png?alt=media&amp;token=ac6ec9e3-e14f-4ee6-967c-b8abb3588df1" alt=""><figcaption></figcaption></figure>

If you need to cancel all orders quickly, tap the \[Cancel All] button.

<figure><img src="https://2743495040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjcbEMWWhgp6yDGtskNwD%2Fuploads%2FThRHTfo2uzDPZFKgQvbr%2Fimage.png?alt=media&amp;token=bcf6c542-53bf-4c72-a5a0-59af8b5d5e32" alt=""><figcaption></figcaption></figure>

***


# Referral (Coming soon)


