Skip to main content

hak-saucerswap-plugin (Python)

A Hedera Agent Kit plugin that integrates the SaucerSwap DEX, letting AI agents quote swaps, execute trades, manage liquidity, and explore farming opportunities on Hedera.

Python port of the TypeScript plugin hak-saucerswap-plugin.

Tools

Method Description On-chain
saucerswap_get_swap_quote Price quote with min output, price impact, and route No
saucerswap_swap_tokens Execute a swap via the router (swapExactTokensForTokens) Yes
saucerswap_get_pools List/filter liquidity pools and reserves No
saucerswap_add_liquidity Add liquidity to a pool (addLiquidity) Yes
saucerswap_remove_liquidity Burn LP tokens for the underlying pair (removeLiquidity) Yes
saucerswap_get_farms List active yield farms No

Installation

pip install hak-saucerswap-plugin

Usage

from hedera_agent_kit.shared.configuration import AgentMode, Configuration, Context
from hak_saucerswap_plugin import saucerswap_plugin

context = Context(account_id="0.0.xxxx", mode=AgentMode.AUTONOMOUS)
# Attach plugin configuration to the context (optional; env vars also work):
context.saucerswap = {"network": "mainnet"}

configuration = Configuration(plugins=[saucerswap_plugin], context=context)

Configuration

Settings resolve with this precedence: context config → environment variables → network defaults → built-in defaults.

Context key Env var Description Default
base_url SAUCERSWAP_BASE_URL SaucerSwap REST API base URL https://api.saucerswap.finance
api_key SAUCERSWAP_API_KEY API key sent as x-api-key (request at support@saucerswap.finance) —
network SAUCERSWAP_NETWORK mainnet or testnet; fills router/WHBAR/alias defaults —
timeout_seconds SAUCERSWAP_TIMEOUT_SECONDS HTTP timeout in seconds 10
retries SAUCERSWAP_RETRIES Retries for 429/5xx/transport errors 2
router_contract_id SAUCERSWAP_ROUTER_CONTRACT_ID V1 router contract ID from network
router_v2_contract_id SAUCERSWAP_ROUTER_V2_CONTRACT_ID V2 router contract ID from network
wrapped_hbar_token_id SAUCERSWAP_WRAPPED_HBAR_TOKEN_ID WHBAR token ID (used for the HBAR alias) from network
token_aliases SAUCERSWAP_TOKEN_ALIASES Symbol → token ID map (env var takes JSON) from network
default_pool_version SAUCERSWAP_DEFAULT_POOL_VERSION v1 or v2 v2
gas_limit SAUCERSWAP_GAS_LIMIT Gas limit for router calls 2000000
deadline_minutes SAUCERSWAP_DEADLINE_MINUTES Default transaction deadline 20

Network defaults (contract addresses from the official SaucerSwap deployments) are exported as SAUCERSWAP_MAINNET and SAUCERSWAP_TESTNET.

A pre-configured httpx.AsyncClient can also be injected by attaching it to the context as context.saucerswap_client (e.g. to share auth headers or transports).

Development

uv sync
uv run pytest
uv run ruff check .

License

MIT

Metadata

Release files for hak-saucerswap-plugin 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hak-saucerswap-plugin 0.1.0
File Size Uploaded
hak_saucerswap_plugin-0.1.0.tar.gz 257.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hak-saucerswap-plugin 0.1.0
File Interpreter ABI Platform
hak_saucerswap_plugin-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 278.4 kB

Release files / hak_saucerswap_plugin-0.1.0.tar.gz

Download URL hak_saucerswap_plugin-0.1.0.tar.gz
Size 257.5 kB
Tags Source
SHA-256 checksum
How to use checksums
92b4b8d93807ecfad0020bcc6b0b2fe3c939e1f4b64b3e8f9e443e849d970b6c
BLAKE2b-256 checksum
How to use checksums
e2f1cb1d8dd1f418e172be33740d09f078a4ce722989628ec0b1b596baebdacc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / hak_saucerswap_plugin-0.1.0-py3-none-any.whl

Download URL hak_saucerswap_plugin-0.1.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
362e7612a25007b5b7853fd7dba906b84483b3f8dfda2e0f5db41498eeb4ff82
BLAKE2b-256 checksum
How to use checksums
0e8da5e70aefa774057fbd09bb497837269b31f9ccba8b89c46249822f762e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page