# Machine Learning

### Model Design

For any AI model, each set of input data needs to be first defined and ultimately determined to train the algorithm.&#x20;

Mozaic's machine learning team currently extracts data block by block and coin price data through one minute feeds when modeling.

#### **This has specific reasoning:**&#x20;

* Each chain has different update frequencies
* Block-by-block APY data is quantifiable and encapsulates numerous other metrics&#x20;
* One minute token price data is key for selling native protocol tokens (when farming) in a volatile market

{% hint style="info" %}
*Training Archimedes to become the most efficient yield farmer.*
{% endhint %}

### Initial Test Case

An initial 14 day simulation (April 7th - 14th, 2022) was conducted theoretically with Archimedes and Mozaic's stablecoin vault, farming on [<mark style="color:yellow;">cBridge</mark>](https://cbridge.celer.network/liquidity).&#x20;

Archimedes rebalanced funds on the Avalanche chain for approximately five days out of the fourteen, the Ethereum chain for four, and an alternating combination of the Optimism, Polygon, Fantom, and Ethereum again for the other five days. Spikes in yield on AAVE were also captured (27%) for a large portion of one of the days.

Harnessing Mozaic’s omnichain stablecoin vault over the 14 days produced a geometric daily expected return of approximately 19.02%.&#x20;

Leaving 100% of your assets in the best performing vault over the same 14 day period only yielded 13.98%.&#x20;

### Staking Optimizer

A live test was conducted for Archimedes, farming on [<mark style="color:yellow;">Stargate</mark>](https://stargate.finance/farm) single-sided staking pools.

During this process, an APY data extraction tool was developed to capture necessary modeling data to train Archimedes. This extraction tool extracts any APY data block by block.

<figure><img src="https://1308221572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiihhDZYtNvGU8rJ3vI%2Fuploads%2FuRUHO4jFSdacXfJWkEUB%2FArchimedes%20Test.png?alt=media&#x26;token=57b4402d-4b01-4106-9bcd-c8818c981539" alt=""><figcaption><p>Archimedes Live Test Results</p></figcaption></figure>

### Trading Optimizer

Protocols use their native token as rewards to increase their APYs.

Another live test was conducted on Stargate to show a competitive edge gained as Archimedes sells native token rewards.

<figure><img src="https://1308221572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiihhDZYtNvGU8rJ3vI%2Fuploads%2FKSU8Jiz4nJTuht8kSTtE%2Fcompetitive%20edge.png?alt=media&#x26;token=7d602dca-22d4-49d2-b17b-e6e567e4eb0c" alt=""><figcaption><p>STG Rewards Competitive Edge</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mozaic.finance/archimedes/machine-learning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
