# DeFi-Protokolle

Rome ermöglicht es EVM-DeFi-Protokollen, atomar mit Solanas nativem DeFi-Ökosystem zu komponieren. Diese Seite behandelt gängige Integrationsmuster.

## Warum DeFi auf Rome?

* **Zugang zu Solana-Liquidität** — Jupiter, Kamino, Drift, Meteora, Raydium, Orca
* **Atomare Komponierbarkeit** — mehrstufige DeFi-Operationen in einer einzigen Transaktion
* **Solidity-Tooling** — vertrautes Entwicklungs- und Audit-Ökosystem
* **Einheitlicher State** — EVM- und Solana-Nutzer teilen sich dieselben Pools

## Muster 1: Lending-Protokoll mit Solana-Orakeln

```solidity
import {IAggregatorV3Interface} from "@rome-protocol/solidity-sdk/contracts/oracle/IAggregatorV3Interface.sol";

contract RomeLending {
    IAggregatorV3Interface public priceFeed;

    constructor(address _priceFeed) {
        priceFeed = IAggregatorV3Interface(_priceFeed);
    }

    function getCollateralValue(uint256 amount) public view returns (uint256) {
        (, int256 price,,,) = priceFeed.latestRoundData();
        // Pyth/Switchboard-Preis über Oracle Gateway
        // Gleiche Schnittstelle wie Chainlink auf Ethereum
        return (amount * uint256(price)) / 1e8;
    }
}
```

## Muster 2: DEX-Aggregator via CPI

```solidity
contract RomeSwap {
    function swap(
        bytes32 fromMint,
        bytes32 toMint,
        uint256 amount,
        uint256 minOut
    ) external {
        // CPI zu Jupiter/Raydium/Meteora
        // Auf alle Solana-DEX-Liquidität aus Solidity zugreifen
        CpiProgram.invoke(JUPITER_PROGRAM, accounts, swapData);
    }
}
```

## Muster 3: Yield Vault

```solidity
contract YieldVault {
    function deposit(uint256 amount) external {
        // USDC-Einzahlung annehmen
        // CPI → Jupiter: in optimale Tokens tauschen
        // CPI → Kamino: als Sicherheiten bereitstellen
        // CPI → Drift: delta-neutrale Absicherung eröffnen
        // Alles atomar — eine Tx, alles-oder-nichts
    }
}
```

## Muster 4: Cross-Protocol-Arbitrage

Verwendung von `RemusTx` (atomare Cross-Rollup-Transaktionen):

1. Auf DEX A in Rollup 1 kaufen
2. Auf DEX B in Rollup 2 verkaufen
3. Beides atomar — kein Ausführungsrisiko

## Verwandt

* [DeFi Composer](/de/produkte/defi-composer.md) — Multi-Protocol-Vault-Infrastruktur
* [Oracle Gateway](/de/produkte/oracle-gateway.md) — Chainlink-kompatible Preisdatenfeeds
* [Rome SDK](/de/produkte/rome-sdk.md) — typisierte Schnittstellen für DeFi-Protokolle


---

# 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/anwendungsfalle/defi-protocols.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.
