An autonomous vault manager designed to strategically manage assets within liquidity pools. The AVM's primary goal is to optimize for risk adjusted returns by automating data collection, analysis, portfolio construction, and transaction execution.
- Dynamic Pool Scoring: Evaluates liquidity pools based on a multiple factor model including weighted APR, impermanent loss risk, volatility, TVL, and trading volume.
- Automated Rebalancing: Generates and executes transaction plans to align the vault's portfolio with target allocations.
- Advanced Risk Management:
- Calculates and penalizes for Impermanent Loss (IL) risk and asset volatility.
- Leverages on-chain simulations to predict slippage and transaction outcomes before execution.
- Enforces strict slippage tolerance on all trades.
- Applies configurable constraints for minimum/maximum allocation per pool.
- Cost-Efficient Execution: Simulates transactions to estimate the precise gas required, minimizing waste while preventing "out of gas" errors.
- Comprehensive Observability: Features a built-in web dashboard for real-time monitoring of vault performance, recent cycles, and all executed actions.
- Persistent State & Analytics: Records a detailed snapshot of every operational cycle to a PostgreSQL database, enabling historical performance analysis.
The AVM operates in a continuous, cyclical loop. Each cycle consists of distinct phases, managed by specialized components:
- Data Fetching: Gathers on-chain data (pool states, APRs) and off-chain data (historical prices, volume).
- Analysis & Scoring: Processes the raw data to score each pool's attractiveness.
- Portfolio Planning: Selects the top pools and determines the ideal target allocations based on their scores and risk constraints.
- Action Planning: Creates a concrete, multi-step transaction plan to shift the current portfolio towards the target.
- Execution: Safely signs and broadcasts the transactions to the Elys Network.
- State Recording: Saves a comprehensive snapshot of the entire cycle to the database.
For a more detailed breakdown, please see the ARCHITECTURE.md file.
Follow these instructions to get the LP Rebalancing service up and running on your local machine for development and testing.
-
Clone the repository:
git clone https://github.com/elys-network/lp-rebalancing-vault.git cd avm
-
Install Go dependencies:
go mod tidy
The LP Yield Optimizer Vault is configured using environment variables. Create a .env
file in the root of the project by copying the example file.
cp .env.example .env
Now, edit the .env
file with your specific configuration:
Compile the main application binary:
go build -o avm-service ./cmd/avm
Once built and configured, you can start the service:
./avm-service
The LP Yield Optimizer Vault will start its main operational loop. You can monitor its activity through the console logs and the web dashboard.
Copyright (c) 2025 Elys Network PTE LTD and Elys Network Inc.
This project is licensed under the Elys Network Business Source License 1.1.
This is a source-available license. You are free to copy, modify, and use this software for non-production purposes (e.g., development, testing, research).
Production use of this software is strictly prohibited without an explicit "Additional Use Grant" from Elys Network.
On the Change Date, the license will automatically convert to the GNU General Public License v3.0 (GPL-3.0).
For a detailed explanation of your rights and obligations, please see the LICENSE.md.