1.5 KiB
1.5 KiB
Agents and Keys
This project supports running multiple agent identities (private keys) to place orders on Hyperliquid. Agents are lightweight keys authorized on-chain by your main wallet.
Agent storage and environment
- For security, agent private keys should be stored as environment variables and not checked into source control.
- Supported patterns:
AGENT_PRIVATE_KEY(single default agent)<NAME>_AGENT_PKor<NAME>_AGENT_PRIVATE_KEY(per-agent keys)
Discovering agents
trade_executor.pyscans environment variables for agent keys and loads them intoExchangeobjects so each agent can sign orders independently.
Creating and authorizing agents
- Use
create_agent.pywith yourMAIN_WALLET_PRIVATE_KEYto authorize a new agent name. The script will attempt to callexchange.approve_agent(agent_name)and print the returned agent private key.
Security notes
- Never commit private keys to Git. Keep them in a secure secrets store or local
.envfile excluded from version control. - Rotate keys if they are ever exposed and re-authorize agents using your main wallet.
Example .env snippet
MAIN_WALLET_PRIVATE_KEY= MAIN_WALLET_ADDRESS= AGENT_PRIVATE_KEY= EXECUTOR_SCALPER_AGENT_PK=
File agents
- This repository may contain a local
agentsfile used as a quick snapshot; treat it as insecure and remove it from the repo or add it to.gitignoreif it contains secrets.