An open API service indexing awesome lists of open source software.

https://github.com/logarithm-labs/curator-agent

A sophisticated agent system designed to optimize asset allocation across multiple Logarithm vaults within a meta vault framework, with the primary objective of maximizing returns.
https://github.com/logarithm-labs/curator-agent

agent agent-based-simulation defi python

Last synced: 6 months ago
JSON representation

A sophisticated agent system designed to optimize asset allocation across multiple Logarithm vaults within a meta vault framework, with the primary objective of maximizing returns.

Awesome Lists containing this project

README

          

# Curator Agent

A sophisticated agent system designed to optimize asset allocation across multiple Logarithm vaults within a meta vault framework, with the primary objective of maximizing returns.

## Overview

The Curator Agent employs advanced strategies to dynamically manage and rebalance assets across various Logarithm vaults, ensuring optimal performance and risk-adjusted returns.

## System Architecture

![Workflow Diagram](images/workflow.png)

## Prerequisites

- Python 3.12
- `uv` package manager
- OpenAI API key
- Sufficient disk space for backtest data

## Installation

### For Development/Contributing

1. **Install `uv` Package Manager**
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

2. **Install Project Dependencies**
```bash
uv sync --locked
```

### For Using as a Package in Other Projects

You can install curator-agent as a package in your own projects using `uv`:

```bash
# Install from GitHub repository
uv add git+ssh://git@github.com/Logarithm-Labs/curator-agent.git#egg=curator

# Or install from a specific branch/tag
uv add git+ssh://git@github.com/Logarithm-Labs/curator-agent.git@main#egg=curator
```

#### Usage Example

After installation, you can use the curator modules in your project:

```python
from curator import (
AllocationAction,
ReallocationAction,
WithdrawAction,
AnalysisSummary,
validate_allocation,
ValidationFeedback,
create_allocation_agent,
create_reallocation_agent,
create_withdraw_agent,
create_analysis_agent
)

# Use validation utilities
result = validate_allocation(1000.0, ["btc", "eth"], [600.0, 400.0], [800.0, 500.0])
print(f"Validation result: {result.result}")

# Import action classes and agent creation functions
# See examples/basic_usage.py for more details
```

See `examples/basic_usage.py` for a complete usage example.

## Running Backtests

### 1. Build Observations

The system uses historical data from `back_test/data/hyperliquid` to generate observations. This data includes:
- Logarithm vaults performance metrics

Within the loader functions in `back_test/loader`, the following information is simulated during building:
- Pending Withdrawals and Idle Assets of Logarithm vaults based on standard distribution sampling
- Deposits to and Withdraws from the Agent are simulated based on uniform distribution sampling

To build observations:
```bash
uv run -m back_test.build_observations
```

### 2. Execute Backtests

Before running the backtests, ensure your OpenAI API key is configured in your environment:
```bash
export OPENAI_API_KEY='your-api-key'
```

Run the following commands to execute different strategies:
```bash
# Run the curator strategy
uv run -m back_test.curator_strategy

# Run the baseline strategy for comparison
uv run -m back_test.baseline_strategy
```

### 3. Visualize Results

Generate performance visualizations:
```bash
uv run -m back_test.dashboard
```

**Important:** Before running the dashboard, ensure the correct log path is configured in `dashboard.py`.

## Project Structure

```
.
├── back_test/
│ ├── data/
│ │ └── hyperliquid/ # Historical performance data
│ ├── build_observations.py
│ ├── curator_strategy.py
│ ├── baseline_strategy.py
│ └── dashboard.py
└── images/
└── workflow.png
```

## Contributing

Please read our contributing guidelines before submitting pull requests.

## License

MIT License

Copyright (c) 2025 Curator Agent

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Support

For support and questions, please join our Discord community: [Discord Server](https://discord.gg/WUywV5Qh)