# Yield Optimiser

<figure><img src="https://113901746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FARjWU7zlvQKoJ01uqhvs%2Fuploads%2FjK6PSfjMTAV9MneTkJd7%2FAnimationonboarding-step2-ezgif.com-crop.gif?alt=media&#x26;token=5c423385-e43f-49fe-9546-8c54094b816d" alt=""><figcaption></figcaption></figure>

### Yield Optimiser Documentation

#### 1. Why Lending Needs Fixing

Lending protocols are one of the cornerstones of DeFi. As of March 2025, they account for **42 % of total DeFi TVL** (DefiLlama: total DeFi TVL $101 B). Yet most users never fully capture their potential because they:

* Don’t know that rates can spike dramatically between protocols
* Lack tools to chase those spikes in real time
* Aren’t watching protocol health closely enough to avoid losses

<figure><img src="https://113901746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FARjWU7zlvQKoJ01uqhvs%2Fuploads%2FU1iRUNBlkoNOC7ACfcJh%2FCapture%20d%E2%80%99e%CC%81cran%202025-03-26%20a%CC%80%2014.21.16.png?alt=media&#x26;token=50761264-fbdc-471c-a610-9da380434205" alt=""><figcaption></figcaption></figure>

<figure><img src="https://113901746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FARjWU7zlvQKoJ01uqhvs%2Fuploads%2FYQXR9uWNStfpdtKkRB14%2FCapture%20d%E2%80%99e%CC%81cran%202025-03-26%20a%CC%80%2014.51.57.png?alt=media&#x26;token=42032c69-84d9-4716-9639-1a42d6126833" alt=""><figcaption></figcaption></figure>

#### 2. Introducing Otomato’s Lending Aggregator

<figure><img src="https://113901746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FARjWU7zlvQKoJ01uqhvs%2Fuploads%2FwTVJxYvAYFij6ZApjyOU%2Fimage.png?alt=media&#x26;token=ef6fe433-2ff7-46b7-8dd1-af43f9cea1ac" alt=""><figcaption></figcaption></figure>

An optimized yield engine—built on top of Otomato OS—that does the heavy lifting for you. With a single deposit, you get:

* **Yield Optimization**\
  Your assets move automatically across AAVE, Compound and Morpho to lock in the highest rates.
* **Bad Debt Protection** (coming soon)\
  Our Off-Chain Guardians watch for protocol risks—suspicious txs, governance upgrades, oracle quirks or bad debt—and pull your funds out before trouble hits.

> **What is Bad Debt?**\
> When a lending pool suffers a depeg, oracle exploit, hack or market crash, its collateral can become insufficient to cover all deposits. If the protocol’s reserve can’t fill the gap, withdrawals leave later users underwater.

Otomato’s Off-Chain Guardians detect early warning signs—like oracle price divergence or unusual tx patterns—and trigger an emergency withdrawal **before** a bank-run scenario unfolds.

***

#### 3. How It Works

1. **Deposit**\
   User sends asset (for example USDC) to the Lending Aggregator smart account.
2. **Monitor Rates**\
   Trigger Layer polls on-chain rate oracles and off-chain APIs for Aave, Compound, Morpho, etc.
3. **Decision Engine**\
   Logic Engine evaluates where APY is highest, factoring in gas costs and slippage limits.
4. **Rebalance**\
   Action Executor bundles and sends ERC-4337 UserOperations to move funds to the optimal protocol.
5. **Protect (coming soon)**\
   Off-Chain Guardians continuously scan for risk signals; on detection, they override the normal flow and issue emergency exits.
6. **Notify**\
   Smart Notification app pushes real-time alerts when rebalances or emergency exits occur.

***

#### 4. Key Features

* **Multi-Protocol Yield**\
  Automate deposits/withdrawals across AAVE V3, Compound V3 and Morpho without manual intervention.
* **Custom Risk Controls**\
  Set slippage limits, gas-price caps and minimum-APY thresholds.
* **Fee & Cost Efficiency**\
  Batch transactions and leverage paymasters to reduce on-chain fees.
* **Transparency & Analytics**
* **Extensible Architecture**\
  Add new protocols or custom strategies via JavaScript modules—no contract redeploys needed.

***
