> For the complete documentation index, see [llms.txt](https://exliquid.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://exliquid.gitbook.io/docs/developers/integration-quickstart.md).

# Integration quickstart

This guide describes the shortest supported integration path for a trading client or bot.

{% hint style="warning" %}
If [Networks and versions](/docs/reference/networks-and-versions.md) does not list a public API/WebSocket URL, the external testnet integration surface is not open yet. Use the route and message contracts below as interface documentation, not as permission to infer an endpoint.
{% endhint %}

## 1. Read the network contract

Before signing anything, load the current:

* network/chain identity;
* signing domain;
* API version;
* supported SDK version;
* public REST and WebSocket base URLs.

See [Networks and versions](/docs/reference/networks-and-versions.md) and [Protocol identifiers](/docs/reference/protocol-identifiers.md).

## 2. Choose an SDK or direct API integration

Preferred paths:

* TypeScript: `@exliquid/sdk` when a supported release is listed;
* Python: the supported Exliquid Python SDK release;
* direct REST/WebSocket integration when you implement the signing contract yourself.

See [SDKs](/docs/developers/sdk.md).

## 3. Discover network and market state

Typical initial REST calls include:

```
GET /api/v1/status
GET /api/v1/markets
GET /api/v1/markets/{market}
GET /api/v1/markets/{market}/book
GET /api/v1/markets/{market}/prices
```

Use these responses rather than hard-coding market metadata.

## 4. Read the account state

For an account integration, query the current state before building a trading action:

```
GET /api/v1/accounts/{address}/balances
GET /api/v1/accounts/{address}/orders
GET /api/v1/accounts/{address}/positions
GET /api/v1/accounts/{address}/risk
GET /api/v1/accounts/{address}/nonce
```

The nonce query requires the signer, subaccount and action domain defined by the current protocol.

## 5. Build and sign the action

Construct an explicit action and sign the canonical typed transaction.

Do not sign an unexplained digest in the user interface. The signer should be able to understand the market action being authorized.

See [Transactions and signing](/docs/developers/transactions-and-signing.md).

## 6. Submit with idempotency

Submit the signed transaction to:

```
POST /api/v1/transactions
Idempotency-Key: <stable-key-for-this-logical-submission>
```

Keep the idempotency key, signed transaction and transaction ID until the final outcome is known.

Do not create a new nonce simply because an HTTP timeout made the submission outcome ambiguous.

## 7. Wait for confirmation

Use:

```
GET /api/v1/transactions/{tx_id}/confirmation
```

Submission acknowledgement and committed trading success are different states.

After confirmation, reconcile the affected order, balance and position queries.

## 8. Add real-time streams

Connect to `/ws/v1`, subscribe to the public market channels you need, and authenticate before subscribing to account-specific channels.

A robust client must support:

* initial snapshots;
* ordered deltas;
* sequence-gap detection;
* resume where available;
* full resynchronization when resume is unavailable.

See [WebSocket](/docs/developers/websocket.md).

## 9. Handle failures explicitly

Read [Errors, retries and idempotency](/docs/developers/errors-retries-idempotency.md) before implementing automatic retry logic.

The most important rule is:

```
ambiguous submission → resolve status first; do not blindly resubmit a new action
```


---

# 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 dynamically by asking a question.

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

```
GET https://exliquid.gitbook.io/docs/developers/integration-quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
