# API Introduction

The Dexodus Trading API is a RESTful API that enables developers to programmatically interact with the Dexodus decentralized perpetual exchange. Build trading bots, integrate Dexodus into your application, or create custom trading interfaces with full access to market data, position management, and order execution.

* **Base URL:** `https://api.dexodus.finance`
* **API Version:** `1.0.0`

### Key Features <a href="#key-features" id="key-features"></a>

* **Account Management:** Access smart account balances and create session keys for gasless trading using our DApp.
* **Market Data:** Real-time perpetual market prices, funding rates, and market information.
* **Position Management:** Open, close, and monitor leveraged positions up to 160x.
* **Order Management:** Create and manage limit orders, take-profit, and stop-loss orders.
* **Gasless Trading:** Execute trades without worrying about gas fees.
* **Session-Based Authentication:** Secure, limited API access using a private API Key.

***

### Core API Concepts <a href="#core-api-concepts" id="core-api-concepts"></a>

#### Session Keys <a href="#session-keys" id="session-keys"></a>

When you create an API key, a session key with session details is generated on-chain with specific permissions. This allows gasless trading while maintaining security.

#### Gasless Trading <a href="#gasless-trading" id="gasless-trading"></a>

All trades executed through the API are gasless—you don't need to hold ETH. Transaction fees are sponsored by Dexodus 😉.

#### Order Types <a href="#order-types" id="order-types"></a>

**Market Orders**

Execute immediately at the current market price. Ideal for entering or exiting positions quickly.

**Limit Orders**

Execute only when the market reaches your specified price. Perfect for entry strategies and automation.

{% hint style="info" %}
IMPORTANT: Limit orders return both a `positionId` (future position) and an `orderId` (to manage/cancel the order).
{% endhint %}

You can also use limit orders to create Take-Profit (TP) and Stop-Loss (SL) orders to manage risk. There are two primary methods: creating them when you open a position, or adding them to an existing position later.

***

### Vocabulary <a href="#vocabulary" id="vocabulary"></a>

* **Collateral:** The amount of USDC you deposit for the position.
* **Leverage:** Multiplier applied to your collateral (1x to 100x).
* **Position Size:** `collateral` × `leverage`
  * *Example: $100 collateral with 10x leverage = $1,000 position size.*
* **Slippage:** The maximum percentage of price change you are willing to tolerate for a trade to be executed.
  * *Example: If you want to buy an asset at an expected price of $100 and set a 0.5% slippage tolerance, your order will only go through if the final execution price is $100.50 or less.*

[<br>](http://localhost:3000/technology/core-api)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dexodus.finance/trading-api/api-introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
