Oracle3
Open-source trading engine and MCP server for prediction markets. Fee-aware no-arbitrage trading across related contracts, live on Kalshi, Polymarket and Solana or on paper.
BabyDegen is your very own autonomous trading agent, designed to navigate the fast-paced world of DeFi.
FinancePython · MakefileGitHub @valory-xyzOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
BabyDegen agent
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Optimus is an autonomous agent service that automatically manages liquidity provision across multiple Layer 2 networks. Built on the Open Autonomy framework, Optimus uses sophisticated finite state machines to coordinate actions across multiple agents without human intervention.
The agent runs against one chain at a time, selected via TARGET_INVESTMENT_CHAINS. The currently supported chains are Optimism and Base; Mode is supported as a legacy target.Read the full README ↗Optimus is an autonomous agent service that automatically manages liquidity provision across multiple Layer 2 networks. Built on the Open Autonomy framework, Optimus uses sophisticated finite state machines to coordinate actions across multiple agents without human intervention.
The agent runs against one chain at a time, selected via TARGET_INVESTMENT_CHAINS. The currently supported chains are Optimism and Base; Mode is supported as a legacy target.
The system identifies, evaluates, and executes profitable liquidity provision opportunities by integrating with major decentralized exchanges including Balancer, Uniswap V3, Velodrome (Optimism), and Aerodrome (Base). It automatically tracks performance metrics while providing real-time portfolio management with comprehensive analytics and risk assessment.
Optimus operates as a decentralized autonomous system that can handle complex multi-step operations including token swapping and liquidity provision. It maintains detailed records of all activities and continuously optimizes its strategies based on market conditions and performance data.
Optimus integrates with the following decentralized exchanges and protocols:
A typical successful operation cycle for Optimus follows a predictable pattern that demonstrates how the system identifies and executes profitable trading opportunities:
System Initialization & Registration: All agents register with the network and establish their identities and permissions.
Strategy Fetching: The system scans multiple sources for available trading opportunities using GraphQL endpoints and various data sources. The agent maintains a whitelist (primarily stablecoins, though subject to change) and filters opportunities based on this whitelist. For each strategy, the system calculates three critical metrics:
Portfolio State Retrieval: The system fetches active liquidity positions from all integrated protocols, updates position statuses, and calculates current token balances and USD values for all holdings.
Evaluation Phase: All available opportunities are assessed against profitability and risk criteria. The three metrics are combined into a composite score that provides comprehensive evaluation. The system selects the best strategies based on these composite scores.
Decision-Making: The system determines final execution decisions and action order. It handles complex multi-step operations including swapping and liquidity provision while managing transaction routing and optimization to minimize costs and maximize efficiency.
Transaction Submission: Coordinates with the transaction settlement system to execute the prepared transactions.
Post-Transaction Settlement: Updates position records, processes transaction receipts, extracts relevant event data, and updates portfolio valuations and performance metrics.
Cycle Repeat: The system returns to the beginning of the cycle, continuously seeking to optimize its portfolio and capture the best available yields.
The primary entry point for each trading cycle, responsible for gathering all information needed for informed trading decisions. This round:
Manages the critical function of maintaining eligibility for Olas Staking Rewards through proper checkpoint management. This round:
Verifies whether Key Performance Indicators for staking rewards have been satisfied and helps the agent reach its KPI if not yet achieved. This round:
Retrieves and updates comprehensive information about the system's current portfolio state across all supported networks and protocols. This round:
Performs comprehensive analysis of all available strategies to determine which opportunities merit execution. This round:
Makes final execution decisions and prepares detailed transaction data. This round:
Handles all post-transaction processing and state updates to ensure the system accurately reflects transaction results. This round:
The Optimus service is an agent service (or autonomous service) based on the Open Autonomy framework.
Below are the steps to prepare your environment, configure the agent keys, and run the service.
System requirements:
>=3.10, <3.15Clone this repository:
git clone https://github.com/valory-xyz/optimus.git
Create a development environment:
uv sync --all-groups
source .venv/bin/activate
Configure the Open Autonomy framework:
autonomy init --reset --author valory --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
Pull packages required to run the service:
autonomy packages sync --update-packages
Gnosis Keypair: Prepare the keys.json file with the Gnosis keypair of your agent (replace the uppercase placeholders):
cat > keys.json << EOF
[
{
"address": "YOUR_AGENT_ADDRESS",
"private_key": "YOUR_AGENT_PRIVATE_KEY"
}
]
EOF
Deploy Safes: You need to deploy a Safe on the network you want the agent to operate on:
Fund Accounts:
Note: Transaction simulation via Tenderly has been deprecated. The agent now proceeds with transactions without pre-execution validation.
Set up the following environment variables:
# RPCs — set whichever chains you want the agent to operate on.
export OPTIMISM_LEDGER_RPC=INSERT_YOUR_OPTIMISM_RPC
export BASE_LEDGER_RPC=INSERT_YOUR_BASE_RPC
export ALL_PARTICIPANTS='["YOUR_AGENT_ADDRESS"]'
# Safe addresses, keyed by chain — include only the chains you funded.
export SAFE_CONTRACT_ADDRESSES='{"optimism":"YOUR_SAFE_ADDRESS_ON_OPTIMISM","base":"YOUR_SAFE_ADDRESS_ON_BASE"}'
# Which chain the agent should run against. Single-chain only; the first
# entry is what dispatchers like withdrawal accounting read.
export TARGET_INVESTMENT_CHAINS='["base"]' # or '["optimism"]'
export SLIPPAGE_FOR_SWAP=0.09
Note: The default value for SLIPPAGE_FOR_SWAP is provided, but feel free to experiment with different values. It indicates the allowed slippage when bridging/swapping assets using LiFi.
Once you have configured the environment variables:
Fetch the service:
autonomy fetch --local --service valory/optimus && cd optimus
Run as a local agent (development):
pip install open-aea-helpers
# Create data directory and set environment variables
mkdir -p data
export STORE_PATH=$(pwd)/data
export LOG_DIR=$(pwd)/data
# Run the agent
aea-helpers run-agent \
--name valory/optimus \
--connection-key
To run multiple agents on the same machine, add --free-ports.
Note:
STORE_PATHandLOG_DIRmust be set to an absolute path before running. Set them in your.envfile or as environment variables.
Run as a service (Docker deployment):
aea-helpers run-service --name valory/optimus --env-file .env