Python SDK for the Aquarius protocol on Stellar
Project description
aquarius-sdk
The Python SDK for Aquarius — swaps, liquidity, and rewards on Stellar.
Status: 0.1.x — the swap surface is complete and verified with real testnet swaps. Pools, liquidity, and rewards arrive in 0.2. The API may still change before 1.0.
pip install aquarius-sdk
from stellar_sdk import Keypair
from aquarius import AquariusClient, Asset, XLM, SlippageError
AQUA = Asset.classic("AQUA", "GBNZ...AQUA")
aqua = AquariusClient(network="mainnet", signer=Keypair.from_secret(secret))
# exact input: quote, inspect, execute
quote = aqua.quote(XLM, AQUA, amount_in=100_0000000, slippage=0.01)
receipt = quote.execute()
# exact output: pass amount_out instead — strict-receive throughout
quote = aqua.quote(XLM, AQUA, amount_out=500_0000000)
What the SDK handles for you
- Routing — quotes come from the find-path API; the swap chain XDR is passed through untouched.
- Transaction lifecycle — simulation, assembly, submission with congestion retries (same-hash resubmission with backoff), and confirmation polling.
- Archived state — if simulation reports expired ledger entries, the SDK restores them (one extra signed transaction) and retries automatically.
- Typed errors —
SlippageError(withrequote()),PausedError(kill switches — not your bug),NoRouteError,UserRejectedError,TxTimeoutError.
Signers
A stellar-sdk Keypair works as-is. Custom signers provide public_key plus sign(tx_xdr) -> str returning the signed envelope XDR. Reads — quote() — need no signer at all.
Escape hatches
quote.build_transaction() returns the simulated, unsigned envelope XDR for external signing flows. client.contract_call(fn, *scvals) invokes the router raw. client.api is the typed REST client.
Amounts
All amounts are integers in token base units (stroops for classic assets: 1 token = 10^7).
Questions and integration help: Discord.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aquarius_sdk-0.1.0.tar.gz.
File metadata
- Download URL: aquarius_sdk-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4397c6545f8564a115338f5c9e0e8c1bf089e99ad30f6ffc8dccd9374543f845
|
|
| MD5 |
498df95b4a5d6591731a745bd4698f12
|
|
| BLAKE2b-256 |
a7daaf24deb7fc33eac812c759bc8249839673f37ed5df1e9cc06c419ff79fde
|
Provenance
The following attestation bundles were made for aquarius_sdk-0.1.0.tar.gz:
Publisher:
release-python.yml on AquariusDeFi/aquarius-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aquarius_sdk-0.1.0.tar.gz -
Subject digest:
4397c6545f8564a115338f5c9e0e8c1bf089e99ad30f6ffc8dccd9374543f845 - Sigstore transparency entry: 2161137383
- Sigstore integration time:
-
Permalink:
AquariusDeFi/aquarius-sdk@9b7ddd3921eba92b97eaacdc75a57d430727c6ec -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/AquariusDeFi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@9b7ddd3921eba92b97eaacdc75a57d430727c6ec -
Trigger Event:
push
-
Statement type:
File details
Details for the file aquarius_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aquarius_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
811e81a07829432c6c48bc42387eaf97ea85e753344f95904dd1139ebf235e4c
|
|
| MD5 |
22d60c55a0fd23df85c757f828b5535c
|
|
| BLAKE2b-256 |
b67396b2f198f5ff31057e417ca59a95c4537288bc8a94814720369471f6381d
|
Provenance
The following attestation bundles were made for aquarius_sdk-0.1.0-py3-none-any.whl:
Publisher:
release-python.yml on AquariusDeFi/aquarius-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aquarius_sdk-0.1.0-py3-none-any.whl -
Subject digest:
811e81a07829432c6c48bc42387eaf97ea85e753344f95904dd1139ebf235e4c - Sigstore transparency entry: 2161137529
- Sigstore integration time:
-
Permalink:
AquariusDeFi/aquarius-sdk@9b7ddd3921eba92b97eaacdc75a57d430727c6ec -
Branch / Tag:
refs/tags/py-v0.1.0 - Owner: https://github.com/AquariusDeFi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@9b7ddd3921eba92b97eaacdc75a57d430727c6ec -
Trigger Event:
push
-
Statement type: