HookMind Protocol SDK — AI-powered dynamic fees and IL insurance for Uniswap v4 on Unichain
Project description
hookmind (Python)
Python SDK for the HookMind Protocol — AI-powered dynamic fees and impermanent loss insurance for Uniswap v4 on Unichain.
Install
pip install hookmind
Requires Python ≥ 3.10.
Quick start
import asyncio
from hookmind import Agent
async def main():
async with Agent(api_key="hm_your_key") as agent:
# Health check
pong = await agent.ping()
print(pong.version, pong.chain_id)
# Live pool state
pools = await agent.get_pools()
fee = await agent.get_fee(pools[0].pool_id)
print(f"Current fee: {fee.current_fee} bps → recommended: {fee.recommended_fee} bps")
# IL Insurance vault
stats = await agent.get_vault_stats()
quote = await agent.get_quote("0xYourLPAddress")
print(f"Premium: {quote.premium} USDC Max payout: {quote.max_payout} USDC")
asyncio.run(main())
Class reference
Agent
from hookmind import Agent
agent = Agent(
api_key="hm_your_key",
api_url="https://hookmind-api.fly.dev", # optional
timeout=30.0, # optional, seconds
)
# Use as async context manager (recommended) or call await agent.close() manually
Signals
signals = await agent.get_signals(limit=20)
signal = await agent.submit_signal(
signal={
"poolId": "0xb60e6d...",
"fee": 500,
"volatilityScore": 4500,
"nonce": 1,
"chainId": 1301,
},
private_key_hex="0x_your_key",
)
Pools & fees
pools = await agent.get_pools()
pool = await agent.get_pool("0xb60e6d...")
fee = await agent.get_fee("0xb60e6d...")
sim = await agent.simulate_fee(SimulateParams(base_fee=300, sigma2=5000, sigma2_max=10000))
IL Insurance vault
stats = await agent.get_vault_stats()
quote = await agent.get_quote("0xLP...", tick_lower=-887272, tick_upper=887272)
Operators
operators = await agent.get_operators()
operator = await agent.get_operator("0xAddress")
await agent.register_operator("0x_ecdsa_public_key")
Real-time WebSocket stream
async for event in agent.listen():
print(event["type"], event["data"])
Types
from hookmind import (
Signal, PoolData, FeeRecommendation,
SimulateParams, SimulationResult,
VaultStats, ILQuote,
Operator, ApiKey, PingResult,
HookMindError,
)
Error handling
from hookmind import HookMindError
try:
pool = await agent.get_pool("0xbad...")
except HookMindError as e:
print(e.code, e.status, str(e))
Links
License
MIT © 2026 HookMind Protocol Contributors
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
hookmind-0.1.2.tar.gz
(9.1 kB
view details)
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
hookmind-0.1.2-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file hookmind-0.1.2.tar.gz.
File metadata
- Download URL: hookmind-0.1.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfa51ef7502686b0e15c40edb19e94484cd98685360b23e1bcf9e64b1008a9fc
|
|
| MD5 |
e007b34b75fdfbe8543cb71dd71a9079
|
|
| BLAKE2b-256 |
bc8b0579bba26a1886c498cbff5ceae88c776505c271594bdbfcf2af2047bc36
|
File details
Details for the file hookmind-0.1.2-py3-none-any.whl.
File metadata
- Download URL: hookmind-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a255b861e12a6f06e9690a6d8f5b6d51539442818824a3b6b0940b170f15da1
|
|
| MD5 |
f57d2d6db640c477f072bbb72ed25148
|
|
| BLAKE2b-256 |
64e633cf9480c7acbd528198f1b90746f3c20d9211b83230f9efe7f2452ffd35
|