Cover photo

Product Spotlight : Theseus

Bull slayer? Bear tamer? This automated liquidity strategy vault from Mozaic does it all.

Since the earliest days of inception of Archimedes AI, we have considered and explored a wide range of digital asset primitives for digital asset portfolio construction, from established, centralised and decentralised primitives such as USDC, USDT, DAI, FRAX to exotic stables (LUSD, RAI, USDe..) and liquid staking derivatives for our strategies.

Our exploration has also included various liquidity strategies such as delta-neutral, basis trade and directional leverage. However, the key initial goals we set for the protocol were establishing a solid foundation with a minimised risk approach first, ensuring that foundational layers only had strong dependencies (if any) with protocols having a strong track record of security and ample liquidity, in addition to minimal human intervention – before opting to develop more sophisticated strategies with more, complex assets.  (But we’ll get there; it’s on the roadmap).

Risk Diagram

With this objective in mind, we chose GMX as our base layer protocol for deploying on-chain liquidity strategies with our vaults, thanks to deep liquidity and a wide range of digital assets available on the platform. We named the first iteration of our automated AI yield farming vault as Theseus, one of the greatest heroes in Greek mythology, best known for his legendary feat of slaying the half-bull, half-man "Minotaur" in the labyrinth of Crete and uniting the Attic communities into a single state.

This legendary King of Athens has inspired our efforts in developing our next generation of AI-powered automated yield farming vaults, which bring different sources of yield together under one umbrella without the hassle of active liquidity management by the user.

Theseus Vault

The Theseus Vault operates by maintaining a healthy exposure to GMX’s Market GM asset pools:  

BTC, ETH, BNB, SOL, ARB, LINK, UNI, DOGE, XRP, LTC, GMX, XRP, NEAR, AVAX, AAVE, ATOM, OP, USDC, DAI, USDT.

GMX Market pool consists of:

  • Index Price Feed: Long and short tokens will be opened / closed based on this price feed

  • Long Token: This is the token that will back long positions

  • Short Token: This is the token that will back short positions

For example, a market could be ETH/USD[ETH-USDC], in this case:

  • Index Price Feed: ETH/USD

  • Long Token: ETH tokens back long positions

  • Short Token: USDC tokens back short positions

How are these GM tokens priced & where does the yield come from?

The price of the GM token depends on the price of the long and short tokens, respectively, and the net pending PnL of traders' open positions. This price increases as fees accrue from trading and swaps and forms the basis of protocol APY, excluding any external protocol incentives such as ARB tokens.

GM pools aim to maintain an equal worth of long and short tokens, so e.g. when the price of a long token increases, there may be a positive price impact to incentivise selling of long tokens for short tokens to rebalance the pool.

The AI behind the Ai-Fi

I. AI in Action

To navigate the complexities of volatile crypto assets, Mozaic has leveraged its AI Archimedes to model and train a rule-based, yet dynamic strategy .

Nested inside the Theseus Vault lies Archimedes. Archimedes is an active participant in the volatile crypto market. 'He' processes datasets to formulate a strategy that objectively interprets and responds to changes in price and yield. Archimedes prioritises dynamic allocation of assets based on prevailing market trends (Risk On & Risk Off) and adapts to trend changes, accordingly.

  • 'Risk On' Phase: Focuses on buying tokens for yield farming

  • 'Risk Off' Phase: Prioritizes de-risking by moving into stablecoins.

 Archimedes pulls 'parts' of information and data from a number of different proprietary trading strategies to formulate his response to the volatility of crypto asset prices. Archimedes chooses the best 'piece' from each strategy, continuously learning and responding to changes in both price and yield.

Schematic Flow Diagram for Theseus Vault

The Mozaic Theseus vault consists of the following components:

  • Archimedes AI: The brains behind our AI model Archimedes collaboratively interfaces with Conon, adopting a blend of analytical and machine learning methodologies. Its primary function is to utilise the insights from Conon to make informed decisions, particularly for optimising the staking portfolio. Conon serves as an “assistant” to the Archimedes AI model. It ingests all real-time accumulated data from different on-chain sources, preprocesses the data and utilises it for Long-Short Term Memory (LSTM) model training, a type of recurrent neural network (RNN) widely known as one of the best models for time series forecasting.

    The model is saved in a Google Cloud Server (GCS) and deployed, which effectively communicates with Archimedes to provide prediction API for a number of APY metrics.

    Archimedes intelligently and holistically considers current and predictive APY metrics, token prices, fees, slippage, time, TVL, volume, pool reward share and error rates in all its decisions. This processing is computed off-chain to ensure it is cost effective, efficient and reliable - only the results are published and implemented on chain to ensure the decisions of Archimedes cannot be imitated.

  • Controller: The Controller acts as a communication layer between all immutable smart contracts for vault operations and security interfaces/modules. It ensures that the investment manager executes all the necessary automated AI trading instructions, fed by the Archimedes AI in a smart contract readable format, appropriately.

  • Investment Manager: The investment manager is akin to the on-chain brain of protocol operations. It interacts with Archimedes AI and executes automated AI trading instructions including rebalancing between strategies (GMX) and fee collection activities.

  • Intermediary Contract: The intermediary contracts interface with a Zap API to ensure that users can deposit any asset into Theseus vault from any supported chain. The Zap API swaps any user asset from source into assets supported by the Theseus vault and the user receives MOZ-Theseus LP token, representing the user’s share of assets allocated to the vault strategies.

II. Model Design

For any AI model, each set of input data needs to be first defined and ultimately determined to train the algorithm. Mozaic's machine learning team currently extracts data block by block and coin price data through one-minute feeds when modelling to optimise for staked yield and rebalancing behaviours.

Machine Learning Automation Lifecycle for Archimedes V1

The automation lifecycle for Archimedes consists of following steps:

  1. Data Acquisition: An external web server is deployed on the Google Cloud Run and scheduled to fetch relevant data from Iron Hand repeatedly, every hour. It uploads the apy and additional on-chain data in a readable format.

  2. Data Ingestion and Preprocessing: In order to start the process of model training, the readable file in GCS gets loaded and preprocessed to prepare high quality data for training. The preprocessing phase involves cleaning the data, commit feature engineering to generate new features to enhance the model’s predictive power, normalising the data, splitting the data into training, validation and test sets etc.

  3. Hyperparameter Tuning: This phase involves tuning hyperparameters like number of neurons, activation function, learning rate, batch size, loss function, epochs etc to boost the performance of the model.

  4. Model Training: This phase involves defining the LTSM model, training, obtaining prediction data and further evaluating the model.

  5. Model Evaluation: A test set is utilised to evaluate the performance of the model & ensure the model’s performance surpasses the certain threshold, the results are saved into GCS.

  6. Model Deployment: The saved model is deployed for serving prediction data.

  7. Continuous Monitoring: The protocol team monitors the health and performance of the deployed model and sets up alerts for any anomalies or drift in the model performance.

  8. Feedback & Retraining: If the monitoring phase detects drift or decreased performance, the model is re-trained from scratch. In usual circumstances, Mozaic's incremental learning approach ensures that the AI model gets updated with real-time data without having to retrain it again from scratch. This is particularly useful for datasets that are constantly changing or for situations where it's not feasible to store and process all the data at once. It also ensures that AI model self-adapts its understanding of dynamic, real-time data accordingly.

    What's Next?

    An updated roadmap for Archimedes V2 includes incorporating a mix of onchain and offchain AI agents respectively, for reinforcement learning, anomaly detection for black swan scenarios and "human-in-the-loop" (HTL) mechanisms to ensure that any unusual behavior from AI agent is flagged for human review.

Fee structure

Mozaic collects revenue through a simple standardised mechanism (listed in links below):

  • Platform Fee: Fees related to deposits, withdrawals & any services associated with third party intermediary service providers.

  • Performance Fee: Fees taken by the protocol & strategy provider for operations & maintenance of automated vaults.

Disclosure: This article does not represent investment advice. The content & materials featured on this page are for educational purposes only. Please do your own due diligence when using third party front-ends & software services.

Loading...
highlight
Collect this post to permanently own it.
Mozaic logo
Subscribe to Mozaic and never miss a post.
#defi#yield farming#yield#cryptocurrency#mozaic#blockchain#ai#finance