Skip to content

Commit 7fc686a

Browse files
fix stale branding and incorrect event name in NatSpec
- "order book interface" → "Raindex interface" in import comment - `AddOrder` → `AddOrderV3` to match actual event name - Add Raindex description and comparisons to README - Remove dangling ZeroExOrderBookFlashBorrower reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d3c0e08 commit 7fc686a

2 files changed

Lines changed: 47 additions & 4 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
## Raindex
2+
3+
Raindex is a programmable, dynamic onchain order book. Orders are not static
4+
limit orders — they are strategies written as Rain interpreter expressions that
5+
evaluate at match time. This means order amounts and ratios can change based on
6+
onchain state, time, oracle prices, or any other logic the expression author
7+
encodes. Two orders clear when their evaluated ratios overlap, with any surplus
8+
going to the clearer as a bounty.
9+
10+
### Raindex vs. traditional order books
11+
12+
Traditional onchain order books (e.g. dYdX, Serum) replicate the familiar
13+
limit-order model: users place fixed-price bids and asks, a matching engine
14+
pairs them, and fills execute at the stated price. This works, but each
15+
repricing requires a new transaction, making active market-making expensive
16+
and slow.
17+
18+
Raindex replaces static prices with executable expressions. An order's ratio
19+
and maximum amount are computed fresh every time someone attempts to match it.
20+
The expression can read any onchain state — block number, oracle feeds, vault
21+
balances, its own persistent storage — so a single order can implement
22+
strategies that would otherwise require off-chain bots continuously cancelling
23+
and reposting.
24+
25+
### Raindex vs. AMMs
26+
27+
AMMs (Uniswap, Curve, Balancer) achieve always-on liquidity by pooling tokens
28+
into a shared reserve governed by a bonding curve. Liquidity providers deposit
29+
tokens and receive pool shares; the curve mechanically sets the price. This
30+
removes the need for active order management but introduces impermanent loss,
31+
pool-level MEV extraction, and limited strategic control for individual LPs.
32+
33+
Raindex keeps individual ownership of tokens in per-user vaults — there is no
34+
shared pool. Each order owner defines their own pricing logic, so there is no
35+
bonding curve imposing a single price on all participants. Because orders
36+
evaluate independently, one user's strategy cannot dilute or override another's.
37+
Clearers (analogous to AMM arbitrageurs) match overlapping orders and keep the
38+
surplus, providing the same "always available" clearing incentive that
39+
arbitrageurs provide to AMMs, but without requiring passive LPs to share a
40+
pool.
41+
42+
This repo defines the Solidity interfaces and types for Raindex. It does not
43+
contain the implementation.
44+
145
## Dev stuff
246

347
### Local environment & CI

src/interface/IRaindexV6.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
IInterpreterStoreV3
1515
} from "../../lib/rain.interpreter.interface/src/interface/IInterpreterCallerV4.sol";
1616

17-
/// Import unmodified structures from older versions of the order book interface.
17+
/// Import unmodified structures from older versions of the Raindex interface.
1818
import {
1919
ClearStateChangeV2,
2020
ClearConfigV2,
@@ -115,8 +115,7 @@ struct TakeOrdersConfigV5 {
115115
/// against Raindex expressions. All deposited tokens across all vaults are
116116
/// available for flashloan, the flashloan MAY BE REPAID BY CALLING TAKE ORDER
117117
/// such that Raindex's liability to its vaults is decreased by an incoming
118-
/// trade from the flashloan borrower. See `ZeroExOrderBookFlashBorrower` for
119-
/// an example of how this works in practise.
118+
/// trade from the flashloan borrower.
120119
///
121120
/// Token amounts and ratios returned by calculate order MUST be rain floating
122121
/// point values. Handle IO will receive these values as floating point values.
@@ -432,7 +431,7 @@ interface IRaindexV6 is IERC3156FlashLender, IInterpreterCallerV4 {
432431
///
433432
/// If the order already exists, the Raindex MUST NOT change state, which
434433
/// includes not emitting an event. Instead it MUST return false. If the
435-
/// Raindex modifies state it MUST emit an `AddOrder` event and return
434+
/// Raindex modifies state it MUST emit an `AddOrderV3` event and return
436435
/// true.
437436
///
438437
/// If vault ID is `0` for any input or output, this indicates a vaultless

0 commit comments

Comments
 (0)