Skip to main content

Hedera Agent Kit (Python) plugin for SaucerSwap DEX: quotes, swaps, liquidity, pools, and farms

Project description

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

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

hak_saucerswap_plugin-0.1.0.tar.gz (257.5 kB view details)

Uploaded Source

Built Distribution

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

hak_saucerswap_plugin-0.1.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file hak_saucerswap_plugin-0.1.0.tar.gz.

File metadata

  • Download URL: hak_saucerswap_plugin-0.1.0.tar.gz
  • Upload date:
  • Size: 257.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hak_saucerswap_plugin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92b4b8d93807ecfad0020bcc6b0b2fe3c939e1f4b64b3e8f9e443e849d970b6c
MD5 d2dff76476a896d5ed58cd962d2185b2
BLAKE2b-256 e2f1cb1d8dd1f418e172be33740d09f078a4ce722989628ec0b1b596baebdacc

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on jmgomezl/hak-saucerswap-plugin-py

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

File details

Details for the file hak_saucerswap_plugin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hak_saucerswap_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 362e7612a25007b5b7853fd7dba906b84483b3f8dfda2e0f5db41498eeb4ff82
MD5 0226cddb1e5699b33fff6f1a4a28ede4
BLAKE2b-256 0e8da5e70aefa774057fbd09bb497837269b31f9ccba8b89c46249822f762e03

See more details on using hashes here.

Provenance

The following attestation bundles were made for hak_saucerswap_plugin-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jmgomezl/hak-saucerswap-plugin-py

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