Skip to content

Commit 7446715

Browse files
committed
docs: redesign How It Works with route visualization diagrams
1 parent db63338 commit 7446715

1 file changed

Lines changed: 79 additions & 14 deletions

File tree

README.md

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,95 @@ Revy: SOL → Arbitrum → Scroll $3.40 (route discovered)
4141

4242
## How It Works
4343

44-
Revy uses **Levy Flight** -- a power-law distributed random walk that models how apex predators search for prey. Published in *Nature* (1999), cited 3200+ times. Not a whitepaper buzzword. Peer-reviewed math.
44+
Revy uses **Levy Flight** -- a power-law distributed random walk that models how apex predators search for prey. Published in *Nature* (1999), cited 3200+ times.
45+
46+
### Other bridges see this:
4547

4648
```mermaid
4749
graph LR
48-
A[Route Request] --> B[Chain Graph<br/>20 chains, 61 bridges]
49-
B --> C[Levy Flight Search<br/>300 iterations, mu=2.0]
50-
C --> D[Cost Simulation<br/>gas + fees + slippage]
51-
D --> E[Risk Scoring<br/>hop-count penalty]
52-
E --> F[Best Route]
50+
SOL(("SOL")) -. "no route" .-> SCR(("Scroll"))
51+
52+
style SOL fill:#9945FF,stroke:#9945FF,color:#fff
53+
style SCR fill:#FFEEDA,stroke:#FF684B,color:#000
54+
linkStyle 0 stroke:#ff0000,stroke-dasharray:5
55+
```
56+
57+
### Revy sees this:
58+
59+
```mermaid
60+
graph LR
61+
SOL(("SOL")) -->|"Wormhole<br/>$1.20"| ARB(("Arbitrum"))
62+
ARB -->|"Stargate<br/>$2.20"| SCR(("Scroll"))
63+
64+
ETH(("ETH")) -.->|"$3.50"| ARB
65+
SOL -.->|"$4.10"| BSC(("BSC"))
66+
BSC -.->|"$2.80"| ETH
67+
ETH -.->|"$3.20"| SCR
68+
ARB -.->|"$1.50"| OP(("Optimism"))
69+
OP -.->|"$2.10"| SCR
70+
71+
style SOL fill:#9945FF,stroke:#9945FF,color:#fff
72+
style ARB fill:#28A0F0,stroke:#28A0F0,color:#fff
73+
style SCR fill:#FFEEDA,stroke:#FF684B,color:#000
74+
style ETH fill:#627EEA,stroke:#627EEA,color:#fff
75+
style BSC fill:#F0B90B,stroke:#F0B90B,color:#000
76+
style OP fill:#FF0420,stroke:#FF0420,color:#fff
77+
78+
linkStyle 0 stroke:#00ff41,stroke-width:3px
79+
linkStyle 1 stroke:#00ff41,stroke-width:3px
80+
linkStyle 2 stroke:#555,stroke-dasharray:5
81+
linkStyle 3 stroke:#555,stroke-dasharray:5
82+
linkStyle 4 stroke:#555,stroke-dasharray:5
83+
linkStyle 5 stroke:#555,stroke-dasharray:5
84+
linkStyle 6 stroke:#555,stroke-dasharray:5
85+
linkStyle 7 stroke:#555,stroke-dasharray:5
86+
```
87+
88+
> **Green path**: optimal route found by Levy Flight ($3.40, 2 hops)
89+
> **Dashed lines**: all candidate paths explored in < 2 seconds
90+
91+
### Engine Pipeline
92+
93+
```mermaid
94+
graph TB
95+
subgraph INPUT
96+
A["Route Request<br/><code>SOL → Scroll, $5k</code>"]
97+
end
98+
99+
subgraph SEARCH ["LEVY FLIGHT SEARCH"]
100+
direction TB
101+
B["Chain Graph<br/>20 chains | 61 bridges"]
102+
C["300 iterations<br/>mu = 2.0"]
103+
D["Short steps → nearby chains<br/>Long leaps → cross ecosystem"]
104+
B --> C --> D
105+
end
106+
107+
subgraph EVAL ["ROUTE EVALUATION"]
108+
direction TB
109+
E["Cost Simulation<br/>gas + bridge fee + slippage"]
110+
F["Risk Scoring<br/>hop penalty × acceleration"]
111+
G["Dedup + Rank<br/>top 50 candidates"]
112+
E --> F --> G
113+
end
114+
115+
subgraph OUTPUT
116+
H["Best Route<br/><code>SOL → ARB → Scroll $3.40</code>"]
117+
end
118+
119+
A --> B
120+
D --> E
121+
G --> H
53122
54123
style A fill:#0a0a0a,stroke:#ff6600,color:#fff
55124
style B fill:#0a0a0a,stroke:#ff6600,color:#fff
56125
style C fill:#0a0a0a,stroke:#00ff41,color:#fff
57-
style D fill:#0a0a0a,stroke:#ff6600,color:#fff
126+
style D fill:#0a0a0a,stroke:#00ff41,color:#fff
58127
style E fill:#0a0a0a,stroke:#ff6600,color:#fff
59-
style F fill:#0a0a0a,stroke:#00ff41,color:#fff
128+
style F fill:#0a0a0a,stroke:#ff6600,color:#fff
129+
style G fill:#0a0a0a,stroke:#ff6600,color:#fff
130+
style H fill:#0a0a0a,stroke:#00ff41,color:#fff
60131
```
61132

62-
**Short steps** scan nearby chains (L2s, same ecosystem).
63-
**Long leaps** jump across ecosystem boundaries (EVM to Solana).
64-
**Cost simulation** scores every candidate route.
65-
**Risk scoring** penalizes excessive hops.
66-
When direct is cheapest, we pick direct.
67-
68133
---
69134

70135
## Benchmarks

0 commit comments

Comments
 (0)