|
| 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 | + |
1 | 45 | ## Dev stuff |
2 | 46 |
|
3 | 47 | ### Local environment & CI |
|
0 commit comments