Yield Optimizing

Thesauros does more than just aggregate lending protocols — it utilizes advanced computational mathematics to find the ideal balance between yield, risk, and gas costs. Our mission is to move capital to where it works most efficiently at any given moment.

How It Works (In Simple Terms)

The system constantly monitors the market and solves a classic portfolio optimization problem: how to distribute 100% of funds across various protocols (Aave, Morpho, Compound, Euler etc.) to achieve maximum return without exceeding established risk limits.

The process consists of three stages:

  1. Data Collection. Analysis of current APRs, liquidity, and safety scoring.

  2. Search for a Solution. Using a swarm intelligence algorithm to find the best allocation combination.

  3. Execution. Automatic rebalancing via smart contracts.


Mathematical Approach

At the core of Thesauros is an objective function that the system seeks to maximize during every market state check:

Yield=Sum[AllocationiAPRiScorei]Yield = Sum [ Allocation_i * APR_i * Score_i ]

Where:

  • Allocation_i: The share of capital in protocol ii.

  • APR_i: The current annual percentage rate.

  • Score_i: A dynamic safety rating (calculated by the Risk Sentinel).

The optimizer accounts for several hard constraints:

  • TVL Caps: We cannot occupy more than x%x\% of a protocol's liquidity.

  • Gas Efficiency: Rebalancing only occurs if the projected profit exceeds the gas costs of the transactions.

  • Slippage: Accounting for losses when moving large volumes of funds.


Particle Swarm Optimization (PSO)

To solve the capital distribution problem, we utilize Particle Swarm Optimization (PSO) — a heuristic global optimization algorithm inspired by the social behavior of bird flocks and fish schools.

Why PSO?

Traditional optimization methods often get "stuck" in local maxima (finding a good solution but missing the perfect one). In DeFi, the solution space is extremely complex and multi-dimensional due to constantly changing rates and limits. PSO allows the system to explore this space effectively.

How the Algorithm Works in Thesauros:

  1. Particle Population: The system creates a "swarm" of virtual particles. Each particle represents one possible way to distribute the capital (e.g., "40% Aave, 60% Morpho").

  2. Movement Toward the Target: Each particle "flies" through the multi-dimensional space of all possible allocations. It has a "memory" of its own best position (where yield was highest) and information about the best position found by the entire swarm.

  3. Iterative Search: In each iteration, particles adjust their trajectory, pulling toward the most profitable solution discovered so far.

  4. Global Optimum: After several cycles, the entire swarm converges on a point that represents the mathematically ideal distribution of funds, accounting for all risks and gas expenses.

This approach enables Thesauros to find yield combinations that are impossible to calculate using simple "greedy" algorithms or manual management.


Efficiency and Safety

The system is configured to avoid excessive activity (churn). If PSO finds a solution that is more profitable than the current one by only a fraction of a percent — but gas costs would consume that difference — the system will keep the capital in place.

In this way, Thesauros provides institutional-grade asset management, where the mathematical precision of PSO works for the benefit of every user, regardless of their deposit size.


Last updated