DeFi Protocols
Integration patterns for EVM DeFi on Rome — lending with Solana oracles, composing Jupiter and Kamino from Solidity, and shared-liquidity pools.
Rome enables EVM DeFi protocols to compose with Solana's native DeFi ecosystem atomically. This page covers common integration patterns. Several are already live on Rome — Aave v3, Compound v3 (Aerarium), Uniswap V2/V3/V4, and Rome DEX — see Apps on Rome.
The code below is illustrative; interface names for third-party Solana programs are examples, not shipped SDK interfaces.
Why DeFi on Rome?
Access Solana liquidity — Jupiter, Kamino, Drift, Meteora, Raydium, Orca
Atomic composability — multi-step DeFi operations in a single transaction
Solidity tooling — familiar development and audit ecosystem
Shared state — EVM and Solana users share the same pools
Pattern 1: Lending Protocol with Solana Oracles
The import below comes from rome-solidity, which is installed from GitHub, not from npm: npm install github:rome-protocol/rome-solidity, or forge install rome-protocol/rome-solidity with the remapping @rome-protocol/rome-solidity/=lib/rome-solidity/ (details in Deploy Solidity Contracts). Pass the feed address in from the registry rather than hardcoding it.
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 price via Oracle Gateway
// Same interface as Chainlink on Ethereum
return (amount * uint256(price)) / 1e8;
}
}Pattern 2: DEX Aggregator via CPI
Pattern 3: Yield Vault
Pattern 4: Cross-Protocol Arbitrage
Using RemusTx (several EVM transactions on different Rome chains, atomic in one Solana transaction):
Buy on DEX A on one Rome chain
Sell on DEX B on another Rome chain
Both execute atomically; if either fails, both revert.
Reference implementations
Fork a working Rome app instead of starting from a blank page:
rome-dex — dual-lane AMM; bring a new idea and deploy it for both Solana and EVM users over one pool.
aerarium — dual-lane Compound v3 lending UI.
cardo — CPI app-distribution portal (swap / lend / perps / compose).
rome-aave-v3-demo — Aave v3 lending UI.
compound-on-rome-comet — the Comet money-market contracts.
rome-oracle-gateway — a greenfield cross-VM app: reads Solana price accounts (Pyth, Switchboard), posts them on EVM, and serves them to Solidity through the standard Chainlink
AggregatorV3Interface.
Related
Oracle Gateway — Chainlink-compatible price feeds
Rome SDK — typed interfaces for DeFi protocols
Last updated
Was this helpful?