Skip to main content

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 errorsSlippageError (with requote()), 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aquarius_sdk-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aquarius_sdk-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

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

Hashes for aquarius_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4397c6545f8564a115338f5c9e0e8c1bf089e99ad30f6ffc8dccd9374543f845
MD5 498df95b4a5d6591731a745bd4698f12
BLAKE2b-256 a7daaf24deb7fc33eac812c759bc8249839673f37ed5df1e9cc06c419ff79fde

See more details on using hashes here.

Provenance

The following attestation bundles were made for aquarius_sdk-0.1.0.tar.gz:

Publisher: release-python.yml on AquariusDeFi/aquarius-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for aquarius_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 811e81a07829432c6c48bc42387eaf97ea85e753344f95904dd1139ebf235e4c
MD5 22d60c55a0fd23df85c757f828b5535c
BLAKE2b-256 b67396b2f198f5ff31057e417ca59a95c4537288bc8a94814720369471f6381d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page