Python SDK for ZeroQuant agentic DeFi vaults
Project description
ZeroQuant Python SDK
Python SDK for ZeroQuant agentic DeFi vaults with built-in LangChain support.
Installation
pip install zeroquant
With LangChain support
pip install zeroquant[langchain]
Quick Start
import asyncio
from zeroquant import ZeroQuantClient
from zeroquant.models import VaultConfig
async def main():
client = ZeroQuantClient(
provider="https://sepolia.infura.io/v3/YOUR_KEY",
config=VaultConfig(
owner="0x...",
permission_manager="0x...",
factory_address="0x..."
),
private_key="0x..."
)
# Create vault
vault_address = await client.create_vault(salt=12345)
print(f"Vault created: {vault_address}")
# Check balance
balance = await client.get_balance()
print(f"Balance: {balance / 10**18} ETH")
asyncio.run(main())
LangChain Integration
from langchain.agents import initialize_agent, AgentType
from langchain.chat_models import ChatOpenAI
from zeroquant.langchain import CreateVaultTool, ExecuteSwapTool, GetVaultBalanceTool
tools = [
CreateVaultTool(client=client),
ExecuteSwapTool(client=client, swap_intent=swap_intent),
GetVaultBalanceTool(client=client)
]
agent = initialize_agent(
tools,
ChatOpenAI(model="gpt-4"),
agent=AgentType.OPENAI_FUNCTIONS
)
result = agent.run("Create a vault and swap 1 ETH for USDC")
Authentication Modes
1. Agent Wallet
client = ZeroQuantClient(
provider="https://...",
config=config,
private_key="0x..." # Agent's private key
)
2. Delegated Signing
client = ZeroQuantClient(
provider="https://...",
config=config,
session_key="0x...",
delegation_proof="0x..."
)
3. API Key
client = ZeroQuantClient(
provider="https://...",
config=config,
api_key="zq_live_...",
api_url="https://api.zeroquant.io"
)
Features
- Async-first - Built with asyncio for efficient I/O
- Type-safe - Full Pydantic models with validation
- LangChain tools - Built-in tools for AI agents
- Multi-modal auth - Wallet, delegated, or API key
- Comprehensive - Feature parity with TypeScript SDK
Examples
See examples/ directory for complete examples:
basic_swap.py- Create vault and execute swaplangchain_agent.py- LangChain agent with ZeroQuant tools
Documentation
Full documentation: https://docs.zeroquant.io
License
MIT
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 zeroquant_sdk-0.3.3.tar.gz.
File metadata
- Download URL: zeroquant_sdk-0.3.3.tar.gz
- Upload date:
- Size: 62.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0a3150cb0bf459e3a28776fca4b026736d12789c0d6335b27d3da25f2550313
|
|
| MD5 |
04d8e803233c448cfaa53e7ed3ffb49f
|
|
| BLAKE2b-256 |
12e76060979ea3c748b65b9f4eff8c6b19a5f5c4a8a9f905d2528c4cf6300000
|
Provenance
The following attestation bundles were made for zeroquant_sdk-0.3.3.tar.gz:
Publisher:
publishsdk.yaml on MemeDDLabs/zeroquant-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeroquant_sdk-0.3.3.tar.gz -
Subject digest:
d0a3150cb0bf459e3a28776fca4b026736d12789c0d6335b27d3da25f2550313 - Sigstore transparency entry: 753344257
- Sigstore integration time:
-
Permalink:
MemeDDLabs/zeroquant-sdk@3747415c07bcc810cafbde3a485d8df042c46d0e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MemeDDLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publishsdk.yaml@3747415c07bcc810cafbde3a485d8df042c46d0e -
Trigger Event:
push
-
Statement type:
File details
Details for the file zeroquant_sdk-0.3.3-py3-none-any.whl.
File metadata
- Download URL: zeroquant_sdk-0.3.3-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82b47e447105117e24b12ddcdbda9f1571b6db4130ff565be16be60aa6c465c7
|
|
| MD5 |
41e3e882af7594ed1a3192471ad74054
|
|
| BLAKE2b-256 |
3df4d100cab7723c4f0bdd681336a596f11008007d338e843484557195d335bb
|
Provenance
The following attestation bundles were made for zeroquant_sdk-0.3.3-py3-none-any.whl:
Publisher:
publishsdk.yaml on MemeDDLabs/zeroquant-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeroquant_sdk-0.3.3-py3-none-any.whl -
Subject digest:
82b47e447105117e24b12ddcdbda9f1571b6db4130ff565be16be60aa6c465c7 - Sigstore transparency entry: 753344284
- Sigstore integration time:
-
Permalink:
MemeDDLabs/zeroquant-sdk@3747415c07bcc810cafbde3a485d8df042c46d0e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MemeDDLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publishsdk.yaml@3747415c07bcc810cafbde3a485d8df042c46d0e -
Trigger Event:
push
-
Statement type: