> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/de/anwendungsfalle/defi-protocols.md).

# DeFi-Protokolle

Integrationsmuster für EVM-DeFi auf Rome — Kreditvergabe mit Solana-Oracles, Zusammenspiel von Jupiter und Kamino aus Solidity heraus und gemeinsam genutzte Liquiditätspools.

Rome ermöglicht es EVM-DeFi-Protokollen, atomar mit Solanas nativem DeFi-Ökosystem zu komponieren. Diese Seite behandelt gängige Integrationsmuster. Mehrere sind bereits live auf Rome — Aave v3, Compound v3 (Aerarium), Uniswap V2/V3/V4 und Rome DEX — siehe [Apps auf Rome](https://docs.rome.builders/de/apps-auf-rome/apps.md).

Der folgende Code ist illustrativ; Schnittstellennamen für Solana-Programme von Drittanbietern sind Beispiele und keine ausgelieferten SDK-Schnittstellen.

## Warum DeFi auf Rome?

* **Zugriff auf Solana-Liquidität** — Jupiter, Kamino, Drift, Meteora, Raydium, Orca
* **Atomare Komposierbarkeit** — mehrstufige DeFi-Operationen in einer einzigen Transaktion
* **Solidity-Tooling** — vertrautes Entwicklungs- und Audit-Ökosystem
* **Geteilter Zustand** — EVM- und Solana-Nutzer teilen sich dieselben Pools

## Muster 1: Kreditprotokoll mit Solana-Orakeln

Der folgende Import stammt aus [`rome-solidity`](https://github.com/rome-protocol/rome-solidity), das von GitHub installiert wird, nicht von npm: `npm install github:rome-protocol/rome-solidity`, oder `forge install rome-protocol/rome-solidity` mit dem Remapping `@rome-protocol/rome-solidity/=lib/rome-solidity/` (Details in [Solidity-Verträge bereitstellen](https://docs.rome.builders/de/entwicklerleitfaden/deploy-solidity.md#using-the-rome-solidity-sdk)). Übergib die Feed-Adresse von [Registry](https://docs.rome.builders/de/produkte/oracle-gateway.md#consume-a-feed-in-three-steps) anstatt sie fest zu kodieren.

```solidity
import {IAggregatorV3Interface} from "@rome-protocol/rome-solidity/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
        // dieselbe Schnittstelle wie Chainlink auf Ethereum
        return (amount * uint256(price)) / 1e8;
    }
}
```

## Muster 2: DEX-Aggregator per CPI

```solidity
contract RomeSwap {
    function swap(
        bytes32 fromMint,
        bytes32 toMint,
        uint256 amount,
        uint256 minOut
    ) external {
        // CPI zu Jupiter/Raydium/Meteora
        // Auf die gesamte 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 akzeptieren
        // CPI → Jupiter: in optimale Token tauschen
        // CPI → Kamino: als Sicherheit bereitstellen
        // CPI → Drift: Delta-neutralen Hedge eröffnen
        // Alles atomar — eine Tx, alles oder nichts
    }
}
```

## Muster 4: Cross-Protocol-Arbitrage

Mit `RemusTx` (mehrere EVM-Transaktionen auf verschiedenen Rome-Chains, atomar in einer Solana-Transaktion):

1. Kaufe auf DEX A auf einer Rome-Chain
2. Verkaufe auf DEX B auf einer anderen Rome-Chain
3. Beide werden atomar ausgeführt; wenn einer fehlschlägt, werden beide zurückgerollt.

## Referenzimplementierungen

Forke eine funktionierende Rome-App, statt bei einer leeren Seite anzufangen:

* [**rome-dex**](https://github.com/rome-protocol/rome-dex) — AMM mit zwei Ebenen; bring eine neue Idee ein und deploye sie für Solana- und EVM-Nutzer über einen einzigen Pool.
* [**aerarium**](https://github.com/rome-protocol/aerarium) — Compound-v3-Lending-UI mit zwei Ebenen.
* [**cardo**](https://github.com/rome-protocol/cardo) — CPI-App-Verteilungsportal (Swap / Lending / Perps / Compose).
* [**rome-aave-v3-demo**](https://github.com/rome-protocol/rome-aave-v3-demo) — Aave-v3-Lending-UI.
* [**compound-on-rome-comet**](https://github.com/rome-protocol/compound-on-rome-comet) — die Comet-Money-Market-Verträge.
* [**rome-oracle-gateway**](https://github.com/rome-protocol/rome-oracle-gateway) — eine Cross-VM-App auf grünem Feld: liest Solana-Preiskonten (Pyth, Switchboard), veröffentlicht sie auf EVM und stellt sie Solidity über den Standard-Chainlink `AggregatorV3Interface`.

## Verwandt

* [Oracle-Gateway](https://docs.rome.builders/de/produkte/oracle-gateway.md) — Chainlink-kompatible Preis-Feeds
* [Rome SDK](https://docs.rome.builders/de/produkte/rome-sdk.md) — typisierte Schnittstellen für DeFi-Protokolle


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/de/anwendungsfalle/defi-protocols.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
