What is AutoHedge?
AutoHedge is an open-source Python project from The Swarm Corporation that runs a group of AI agents for market analysis, risk assessment and trade order generation. The README describes it as an autonomous agent hedge fund that trades on the user's behalf, lists Solana as the supported venue with full autonomous trading, Coinbase as coming soon and other centralised exchanges as planned. The code is released under the MIT license.
The agents are built on Swarms, the multi-agent framework from the same company, which the README credits as its agent framework. The package depends on swarms and swarm-models and uses the Swarms Agent and Conversation classes: a Trading Director agent receives the task and can hand work off to Quant, Risk Manager, Execution and Sentiment agents. The tickers to analyse are taken from the task text by the director rather than from a predefined list.
AutoHedge is distributed on PyPI as autohedge, installed with pip install -U autohedge. The latest PyPI version is 0.1.6 of February 18, 2026, and the package requires Python 3.10 or later. The repository has no GitHub releases; the version described here is the default branch at commit c549c79 of March 5, 2026, a dependency update. The February 2026 changes added Jupiter, Polygon and Massive data tools, removed a separate ticker agent, moved the prompts into one module and introduced the command-line interface.
The package contains tool functions for several external services: Jupiter APIs on Solana for token prices, token search, wallet holdings and swap execution, the Massive stocks API for ticker overviews, balance sheets and daily OHLC data, yfinance for quotes and price history, and Exa for web search. Language model calls go to OpenAI models (gpt-4.1 and gpt-4o-mini in the agent definitions). An experimental folder holds separate scripts for a Bitcoin transaction analysis agent, a market-making strategy and a crypto agent wrapper.
In the source at the commit above, the agents defined in workers.py produce analysis and order parameters as text; only the sentiment agent is given a tool (Exa search), and the Jupiter trading functions are collected separately in a tools registry. The README does not describe a paper-trading or simulation mode and contains no separate risk statement. Support runs through GitHub Issues and the Swarms Discord server.
Key capabilities
- Trading Director agent The director agent (model
gpt-4.1) receives the task, such as the CLI exampleAnalyze NVDA for 50k allocation, and is prompted to produce a market thesis, key technical and fundamental factors, a risk assessment and trade parameters. It can hand work off to the four specialist agents defined in workers.py. - Quant Analyst agent The quant agent is prompted to evaluate technical indicators such as moving averages, RSI and Bollinger Bands, statistical patterns and risk metrics. Its requested output fields are ticker, technical score, volume score, trend strength, volatility, probability score and key levels for support, resistance and pivot.
- Risk Manager agent The risk agent receives the stock, the director's thesis and the quant analysis. It is asked to return a recommended position size, the maximum drawdown risk, the market risk exposure and an overall risk score.
- Execution agent The execution agent turns the thesis and risk assessment into order parameters: order type (market or limit), quantity, entry price, stop loss, take profit and time in force. In the agent definitions at this commit the output is text; the agent has no trading tool attached.
- Sentiment agent Not listed in the README feature list but defined in the code, the sentiment agent (model
gpt-4o-mini) scores news and social sentiment on a 0 to 1 scale. It uses an Exa search tool that requires anEXA_API_KEYenvironment variable. - Jupiter token data The
get_token_pricefunction queries the Jupiter Price API V3 for USD prices of Solana token mint addresses, andsearch_tokensqueries the Jupiter Tokens v2 search endpoint. Both send the key fromJUPITER_API_KEY, which is issued at the Jupiter portal. - Jupiter Ultra swap functions ultra_tools.py requests a swap order from the Jupiter Ultra API (
get_order), signs the returned transaction with a Solana keypair and submits it for execution (execute_trade), and reads wallet balances (get_holdings). The signing key is read from theSOLANA_PRIVATE_KEYenvironment variable as a base58 string. - Stock market data A stocks client reads ticker overviews, balance sheets and daily OHLC summaries from the Massive API using
MASSIVE_API_KEY, with an optionalPOLYGON_BASE_URLoverride. A second module wraps yfinance for stock quotes, historical prices and quote summaries without an API key. - Interactive CLI The
autohedgecommand (orpython -m autohedge) opens a terminal welcome screen and a prompt loop. Each line is run as a task and the result is shown in a panel, truncated to 2000 characters;helplists the commands andquitexits. The last five tasks are stored in~/.autohedge/recent_tasks.txt. - Python API
AutoHedge(name, description, output_dir, output_type)creates the system andrun(task)executes one cycle. The conversation history is returned as a list, a dictionary or a string depending onoutput_type; example.py runs an oil market sentiment task this way. - Environment configuration The README and .env.example list
JUPITER_API_KEY,OPENAI_API_KEY,ANTHROPIC_API_KEY,WORKSPACE_DIRandWALLET_PRIVATE_KEY. The.envfile is found by walking up from the current directory, and the CLI prints a warning whenOPENAI_API_KEYis missing. The Jupiter Ultra module itself readsSOLANA_PRIVATE_KEY, a name that differs from the README variable. - Logging The package logs with loguru, for example when the trading system initialises, when a cycle starts and when an API request fails. The README lists detailed, configurable logging for audit and debugging among the features, and the repository contains two trade log CSV files from March 2025.
- Supported venues The README venue table lists Solana as supported with full autonomous trading, Coinbase as coming soon and in development, and other centralised exchanges as on the roadmap. The code contains no Coinbase client at this commit.
- Experimental scripts The experimental folder contains a Bitcoin agent that analyses new transactions from a websocket feed, a market-making strategy with a configurable trading pair, spread and inventory limits, and a wrapper around a separate crypto agent package. These scripts are not part of the CLI.
- Installation The README installs the package with
pip install -U autohedgefrom PyPI; the package metadata requires Python 3.10 to below 4.0. Dependencies include swarms, swarm-models, pydantic, loguru, httpx, solders, yfinance, rich and python-dotenv. - License and maintainer AutoHedge is MIT-licensed and maintained by The Swarm Corporation on GitHub. Contributions follow the usual fork and pull request flow described in the README, and questions go to the issue tracker or the Discord server.
Where AutoHedge fits
Asking for an analysis of a stock or market
After setting OPENAI_API_KEY, the autohedge command accepts a task in plain language, such as the CLI's own example Analyze NVDA for 50k allocation. The director agent builds a thesis and can pass it to the quant, risk and execution agents, and the combined conversation is printed as the result.
Running AutoHedge from Python
example.py creates AutoHedge(name="swarms-fund", ...) and calls run() with a task about oil market sentiment. The return value is the message history, which can be requested as a list, dictionary or string for further processing; an outputs directory is created on start.
Sentiment research with web search
With EXA_API_KEY set, the sentiment agent can query Exa and return a 0 to 1 sentiment score with news, social and institutional breakdowns, key themes, critical events and a sentiment trend, as specified in its prompt in prompts.py.
Solana token prices and swaps through Jupiter
The functions in autohedge.tools query Jupiter for token prices and search, request a swap order between two token mints and sign and submit it with the wallet key from SOLANA_PRIVATE_KEY. They call the live Jupiter API with the configured wallet; the README lists Solana as the venue where AutoHedge trades.
Pulling equity fundamentals and prices
The stocks client returns ticker overviews, balance sheets and daily summaries from the Massive API, and the yfinance module returns quotes, historical prices and summary data. Both return JSON strings that can be passed to agents as tools.
Extending the agent pipeline
The README describes a modular design for custom strategies and new venues. Agents are standard Swarms Agent objects with their prompts kept in one file, so the Swarms documentation at docs.swarms.world covers the underlying agent options. Related projects in the directory include TradingAgents, Vibe-Trading and OctoBot.
Install
pip install -U autohedgeReviews of AutoHedge
Be the first to share your experience with AutoHedge.
Write a review
Loading review form…

