> For the complete documentation index, see [llms.txt](https://docs.nectarliquid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nectarliquid.com/trading/direct-urls.md).

# Direct URLs

The Nectar Liquid frontend supports direct URLs that pre-fill trade parameters. This feature allows you to share specific trading configurations, build programmatic redirect links, or deep-link users into a particular platform state.

#### Trade Parameters

Use the `/trade/:tradeType` path to open the primary trade page with pre-selected settings. The trade type is a native URL path segment and not a query parameter. All query parameters are automatically cleaned and removed from the browser address bar two seconds after the page fully initializes to maintain a clean user interface.

| **Parameter**    | **Location**    | **Description**                                                | **Accepted Values**                                                     |
| ---------------- | --------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `tradeType`      | Path segment    | The directional execution type of the trade                    | `long`, `short`, `swap` (case-insensitive)                              |
| `mode`           | Query parameter | The specific order execution mode                              | `market`, `limit`, `stopmarket`, `trigger`, `twap` (case-insensitive)   |
| `from`           | Query parameter | The asset token code used for out-of-pocket payment            | Token symbols such as `weth`, `wbtc`, `usdc` (case-insensitive)         |
| `to` or `market` | Query parameter | The target asset you intend to long, short, or swap into       | Token symbols such as `weth`, `wbtc`, `cngn` (case-insensitive)         |
| `collateral`     | Query parameter | The specific asset token backing your position margin          | Token symbols such as `weth`, `usdc` (case-insensitive)                 |
| `pool`           | Query parameter | The dedicated liquidity pool routing the transaction           | Pool configurations such as `weth-usdc`, `cngn-usdc` (case-insensitive) |
| `chainId`        | Query parameter | Enforces an automated network switch within the wallet on load | Numeric network IDs such as `42421` for the Asset Chain Testnet         |

> Operational Note
>
> Not all order modes are functionally compatible with every trade type. Stop Market configuration is strictly reserved for long and short leverage positions. TWAP execution routing is available across long, short, and swap frameworks. Asset swaps do not support Stop Market instructions.

#### Target Network Routing

To prevent confusion and eliminate cross-network validation errors, ensure your deep links specify the correct application base URL alongside the matching network `chainId` parameter.

* Nectar Liquid Mainnet Routing: Utilizes the production application interface hooked natively to the Asset Chain Mainnet.
* Nectar Liquid Beta Testnet Routing: Utilizes the sandbox web testing interface linked directly to the Asset Chain Testnet nodes.

#### Trade Link Examples

**Nectar Liquid Mainnet Environment (Chain ID: 42420)**

*(Utilizing the production base layout: `https://app.nectarliquid.com`)*

* Long Position Limit Order: `https://app.nectarliquid.com/#/trade/long?mode=limit&from=weth&market=cngn&chainId=42420`
* Short Position Market Order: `https://app.nectarliquid.com/#/trade/short?mode=market&from=weth&to=wbtc&collateral=usdc&chainId=42420`

**Nectar Liquid Beta Testnet Environment (Chain ID: 42421)**

*(Utilizing the testnet app architecture: `https://testnet.nectarliquid.com` or `https://nectar-liquid.netlify.app`)*

* Long Position Limit Order: `https://testnet.nectarliquid.com/#/trade/long?mode=limit&from=weth&market=cngn&chainId=42421`
* Short Position Limit Order: `https://testnet.nectarliquid.com/#/trade/short?mode=limit&from=weth&to=wbtc&chainId=42421`
* Short Position Market Order: `https://testnet.nectarliquid.com/#/trade/short?mode=market&from=weth&to=wbtc&collateral=usdc&chainId=42421`
* Imbalanced Pool Short Market Order: `https://testnet.nectarliquid.com/#/trade/short?mode=market&from=weth&to=cngn&collateral=usdc&pool=cngn-usdc&chainId=42421`

#### Pools Parameters

Use the `/pools/details` path to open a specific Nectarliquid pool interface with a pre-selected management operation and token mode. The required `market` parameter must target the exact smart contract address of the pool deployment token and will not accept generic asset symbols.

Because smart contract deployment addresses differ entirely between our production mainnet and sandbox testnet environments, verify your contract address parameters match your targeted application network.

| **Parameter** | **Description**                                | **Accepted Values**                                    |
| ------------- | ---------------------------------------------- | ------------------------------------------------------ |
| `market`      | The exact target pool contract address to open | Valid hexadecimal contract address of the market token |
| `operation`   | The primary liquidity management direction     | `Deposit`, `Withdrawal`, `Shift` (case-sensitive)      |
| `mode`        | The asset structural allocation mode           | `Single`, `Pair` (case-sensitive)                      |

> Warning Notice
>
> The structural `operation` and `mode` query values are strictly case-sensitive. The settings for Deposit, Withdrawal, Shift, Single, and Pair must be capitalized exactly as specified. Lowercase or alternative formatting variants are automatically ignored by the router, causing the webpage to open within its generic fallback default state.

#### Pool Link Examples

**Nectar Liquid Mainnet Environment (Chain ID: 42420)**

*(Utilizing production smart contract addresses)*

* Single Asset Deposit link: `https://app.nectarliquid.com/#/pools/details?market=0x4f59597eA9287B5C13fE1cD00c0ba080C324859a&operation=Deposit&mode=Single`
* Dual Asset Balanced Withdrawal link: `https://app.nectarliquid.com/#/pools/details?market=0x4f59597eA9287B5C13fE1cD00c0ba080C324859a&operation=Withdrawal&mode=Pair`

**Nectar Liquid Beta Testnet Environment (Chain ID: 42421)**

*(Utilizing specific testnet contract tokens)*

* Single Asset Deposit link: `https://testnet.nectarliquid.com/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Deposit&mode=Single`
* Dual Asset Balanced Withdrawal link: `https://testnet.nectarliquid.com/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Withdrawal&mode=Pair`
* Dual Asset Liquidity Shift link: `https://testnet.nectarliquid.com/#/pools/details?market=0x450bb6774Dd8a756274E0ab4107953259d2ac541&operation=Shift&mode=Pair`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nectarliquid.com/trading/direct-urls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
