# DeFi Composer

DeFi Composer ermöglicht Yearn-ähnliche Multi-Protokoll-Vaults, geschrieben in Solidity, die über CPI atomar über mehrere Solana-DeFi-Protokolle hinweg zusammengesetzt werden.

## Übersicht

Eine einzelne Solidity-Funktion kann Operationen über Jupiter, Kamino, Drift, Meteora und andere Solana-Protokolle orchestrieren — alles atomar. Wenn ein Schritt fehlschlägt, wird die gesamte Transaktion zurückgesetzt.

```solidity
function executeStrategy(uint256 amount) external {
    // 1. 50 % USDC über Jupiter in SOL tauschen
    IJupiter(JUPITER).swap(USDC, SOL, amount / 2, minSolOut);

    // 2. SOL als Sicherheiten auf Kamino einzahlen
    IKamino(KAMINO).deposit(SOL, solAmount);

    // 3. USDC gegen SOL-Sicherheiten leihen
    IKamino(KAMINO).borrow(USDC, borrowAmount);

    // 4. SOL-PERP-Short auf Drift eröffnen (Delta-Hedge)
    IDrift(DRIFT).placeOrder(SOL_PERP, SHORT, size, leverage);

    // Alles atomar. Eine Solidity-Funktion. Vier CPI-Sprünge.
}
```

## Warum Solidity für DeFi-Composition?

* **Vertraute Werkzeuge** — Solidity-Entwickler müssen Rust/Anchor nicht lernen
* **Ausgereiftes Ökosystem** — nutzt OpenZeppelin, vorhandene Audit-Werkzeuge, Hardhat/Foundry-Workflows
* **Komponierbarkeit** — Soliditys `try/catch`-, Modifikatoren und Vererbung funktionieren natürlich
* **Atomare Ausführung** — das Transaktionsmodell von Solana garantiert Alles-oder-nichts

## Referenzstrategien (geplant)

| Strategie             | Protokolle             | Beschreibung                                                                |
| --------------------- | ---------------------- | --------------------------------------------------------------------------- |
| SOL-Ertragsoptimierer | Kamino, Drift          | SOL bereitstellen, Stablecoins leihen, Delta-Hedging auf Perps              |
| Stablecoin-Ertrag     | Kamino, Orca           | Stablecoins über Pools als LP bereitstellen, automatisch neu ausbalancieren |
| Delta-neutral         | Jupiter, Kamino, Drift | Swap + Bereitstellung + Hedging für Rendite ohne Exposure                   |
| LST-Arbitrage         | Jupiter, Marinade      | LST-Preisunterschiede ausnutzen                                             |

## Status

**Entworfen** — abhängig von Rome SDK Phase 2 (IJupiter-, IDrift-, IKamino-Interfaces). Die Kern-CPI-Infrastruktur ist live; protokollspezifische typisierte Schnittstellen sind in Arbeit.

## Was kommt als Nächstes

* [Rome SDK](/de/produkte/rome-sdk.md) — typisierte Solidity-Interfaces für Solana-Programme
* [Solana von EVM aus aufrufen](/de/entwicklerhandbucher/call-solana-from-evm.md) — CPI-Anleitung
* [Einschränkungen](/de/grundlegende-konzepte/constraints.md) — CPI-Tiefenlimits und Compute-Budget


---

# 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.rome.builders/de/produkte/defi-composer.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.
