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

# Quickstart

This page gets you from zero to a completed on-chain swap with the official Aquarius SDK. It runs on **testnet**, creates and funds its own throwaway account, and has no placeholders to fill in — install, run, and watch a swap execute.

{% hint style="success" %}
Both scripts below are complete and runnable as-is — each was executed against testnet with the published packages before publishing, and the Python flow re-runs weekly in CI against the live testnet deployment.
{% endhint %}

{% hint style="warning" %}
Stellar testnet is wiped 2–4 times per year. Contract addresses persist across resets, but pools and balances are recreated — if the script fails right after a reset, the testnet stack may still be rebuilding. See [Testing on testnet](/developers/testing-on-testnet.md).
{% endhint %}

### 1. Install the SDK

{% tabs %}
{% tab title="Python" %}

```bash
pip install aquarius-sdk
```

{% endtab %}

{% tab title="JavaScript" %}

```bash
npm install @aquariusdefi/sdk @stellar/stellar-sdk
```

{% endtab %}
{% endtabs %}

### 2. Run your first swap

The script funds a fresh testnet account with friendbot, adds an AQUA trustline, quotes the best route from 10 XLM to AQUA, and executes the swap on-chain. Save it as `swap.py` or `swap.mjs` and run it:

{% tabs %}
{% tab title="Python" %}

```python
from stellar_sdk import Keypair
from aquarius import AquariusClient, Asset, XLM

AQUA = Asset.classic("AQUA", "GAHPYWLK6YRN7CVYZOO4H3VDRZ7PVF5UJGLZCSPAEIKJE2XSWF5LAGER")

aqua = AquariusClient(network="testnet", signer=Keypair.random())
aqua.fund_with_friendbot()
aqua.ensure_trustline(AQUA)

quote = aqua.quote(XLM, AQUA, amount_in=100_000_000)  # 10 XLM in stroops (1 XLM = 10^7 stroops)
print(f"Route found: expected output {quote.amount_out / 10**7} AQUA")

receipt = quote.execute()
print(f"Swap executed: received {receipt.amount_out / 10**7} AQUA")
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import { Keypair } from "@stellar/stellar-sdk";
import { AquariusClient, Asset, XLM } from "@aquariusdefi/sdk";

const AQUA = Asset.classic("AQUA", "GAHPYWLK6YRN7CVYZOO4H3VDRZ7PVF5UJGLZCSPAEIKJE2XSWF5LAGER");

const aqua = new AquariusClient({ network: "testnet", signer: Keypair.random() });
await aqua.fundWithFriendbot();
await aqua.ensureTrustline(AQUA);

const quote = await aqua.quote({ from: XLM, to: AQUA, amountIn: 100_000_000n }); // 10 XLM in stroops
console.log(`Route found: expected output ${Number(quote.amountOut) / 1e7} AQUA`);

const receipt = await quote.execute();
console.log(`Swap executed: received ${Number(receipt.amountOut) / 1e7} AQUA`);
```

{% endtab %}
{% endtabs %}

Expected output:

```
Route found: expected output 2247.836633 AQUA
Swap executed: received 2247.836633 AQUA
```

### 3. What the script did

1. **Friendbot** created and funded a fresh testnet account — nothing to configure or protect.
2. `ensure_trustline` let the account hold AQUA (required for any classic Stellar asset you want to receive).
3. `quote` asked the **Find Path API** for the best route across the pools — the same call returns exact-output quotes when you pass `amount_out` instead.
4. `execute` simulated, signed, and submitted the swap through the **AMM router**, guarded by the quote's slippage limit (default 1%), and read the exact amount received from the result.

That one flow — *route off-chain, execute on-chain* — is the core of every Aquarius integration.

### Next steps

* **Understand the pieces** — [Integrating with Aquarius](/developers/integrating-with-aquarius.md) explains the router, pools, and API architecture, and lists the [official SDKs](/developers/integrating-with-aquarius.md#official-sdks).
* **Go to mainnet** — construct the client with `network="mainnet"` and a funded account's secret key.
* **See the raw flow** — [Executing swaps through optimal path](/developers/code-examples/executing-swaps-through-optimal-path.md) documents what the SDK wraps: the Find Path API call and the router invocation, step by step, for any language.
* **Go deeper** — [Code examples](/developers/code-examples.md) covers liquidity provision, reading pool data, and charging integrator fees.
* If the script fails and the [testnet page](/developers/testing-on-testnet.md) doesn't explain it, ask in [Discord](https://discord.gg/sgzFscHp4C).
