ergo-agent 🤖⛓️
Open-source Python SDK for AI agents on the Ergo blockchain.
Give any LLM agent (Claude, GPT-4, LangChain, CrewAI...) the ability to read wallet balances, fetch live prices, swap tokens on Spectrum DEX — all autonomously, with built-in safety guardrails.
Why?
Existing Ergo SDKs (ergpy, fleet-sdk, AppKit) are built for human developers. This SDK is built for AI agents — it speaks the language of function calling, returns structured JSON, and has a safety layer so the agent can't accidentally drain a wallet.
Quickstart
pip install ergo-agent
Read-only (no wallet needed)
from ergo_agent import ErgoNode, Wallet
from ergo_agent.tools import ErgoToolkit, SafetyConfig
node = ErgoNode()
wallet = Wallet.read_only("9f...") # any address to monitor
toolkit = ErgoToolkit(node=node, wallet=wallet)
# Check address balance
result = toolkit.get_wallet_balance()
# Get live ERG/USD price from Oracle Pool v2
price = toolkit.get_erg_price()
# Get a swap quote from Spectrum DEX
quote = toolkit.get_swap_quote(token_in="ERG", token_out="SigUSD", amount_erg=1.0)
With a wallet (transactions enabled)
from ergo_agent import ErgoNode, Wallet
from ergo_agent.tools import ErgoToolkit, SafetyConfig
node = ErgoNode(node_url="http://your-node:9053", api_key="your-key")
wallet = Wallet.from_node_wallet("9f...")
toolkit = ErgoToolkit(
node=node,
wallet=wallet,
safety=SafetyConfig(
max_erg_per_tx=5.0,
max_erg_per_day=50.0,
allowed_contracts=["spectrum"],
rate_limit_per_hour=20,
)
)
# Send ERG
toolkit.send_erg(to="9f...", amount_erg=1.5)
# Swap ERG for a token on Spectrum DEX
toolkit.swap_erg_for_token(token_out="SigUSD", amount_erg=1.0)
Use with LLM frameworks
# OpenAI function calling
tools = toolkit.to_openai_tools()
# Anthropic tool use
tools = toolkit.to_anthropic_tools()
# LangChain
lc_tools = toolkit.to_langchain_tools()
Available Tools
| Tool | Description | Requires Wallet |
|---|---|---|
get_wallet_balance |
ERG + token balances | No |
get_erg_price |
Live ERG/USD from Oracle Pool v2 | No |
get_swap_quote |
Spectrum DEX swap quote | No |
get_mempool_status |
Pending transactions | No |
get_safety_status |
Current spending limits & usage | No |
send_funds |
Send ERG and/or native tokens to an address | Yes |
swap_erg_for_token |
Execute a swap on Spectrum DEX | Yes |
mint_sigusd |
Mint SigmaUSD stablecoins via AgeUSD Bank | Yes |
redeem_sigusd |
Redeem SigmaUSD to ERG | Yes |
mint_sigmrsv |
Mint ReserveCoins (Long ERG) | Yes |
redeem_sigmrsv |
Redeem ReserveCoins | Yes |
bridge_assets |
Bridge assets to other chains via Rosen Bridge | Yes |
Architecture
ergo_agent/
├── core/ # ErgoNode client, Wallet, TransactionBuilder, Address utilities, Cryptography & Privacy primitives
├── defi/ # Oracle Pool v2, Spectrum DEX adapters
└── tools/ # LLM tool schemas (OpenAI / Anthropic / LangChain) + safety layer
Safety Layer
Every state-changing action passes through SafetyConfig before execution:
SafetyConfig(
max_erg_per_tx=10.0, # hard cap per transaction
max_erg_per_day=50.0, # daily rolling limit
allowed_contracts=["spectrum"], # contract whitelist
rate_limit_per_hour=20, # max 20 actions/hour
dry_run=False, # set True for dry-run mode
)
Network
By default the SDK connects to the Ergo public API (https://api.ergoplatform.com). For production use or transaction signing, point it at your own node:
node = ErgoNode(node_url="http://your-node:9053", api_key="your-key")
Contributing
This is an open-source project for the Ergo ecosystem. PRs welcome.
Roadmap:
- v0.1.0 — Core + Oracle + Spectrum + Tool schemas
- v0.2.x — Advanced Transaction Builder + Privacy primitives (Ring Signatures)
- v0.3.x — SigmaUSD + Rosen Bridge adapters + Treasury contracts (current)
License
MIT
Metadata
Release files for ergo-agent-sdk 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ergo_agent_sdk-0.3.0.tar.gz | 4.6 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ergo_agent_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.7 MB
Release files / ergo_agent_sdk-0.3.0.tar.gz
| Download URL | ergo_agent_sdk-0.3.0.tar.gz |
|---|---|
| Size | 4.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41725b814c9e0d3f997f76af276b84452387df71801e327686b271c959c04169
|
|
BLAKE2b-256 checksum How to use checksums |
833f15f561ab026cb773da1dc0b9364931d644415246984b4043147e9e2c645f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / ergo_agent_sdk-0.3.0-py3-none-any.whl
| Download URL | ergo_agent_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 48.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0185372d6e61cfcc640ac83b06bc5e8aa4e854a3507ec568ec7e7f345006db4
|
|
BLAKE2b-256 checksum How to use checksums |
6a3b2138c9cb4aba9196ab5c96642ba3fa7fcf4393ec0f57591b7ddcf0c1be14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for ergo-agent-sdk 0.3.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.