Skip to content

Commit 382f70d

Browse files
committed
how it works
1 parent 466e058 commit 382f70d

File tree

1 file changed

+77
-27
lines changed
  • apps/developer-hub/content/docs/express-relay/how-express-relay-works

1 file changed

+77
-27
lines changed

apps/developer-hub/content/docs/express-relay/how-express-relay-works/index.mdx

Lines changed: 77 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,30 @@ import { Gavel, Lightning, Shield } from "@phosphor-icons/react/dist/ssr";
99

1010
# How Express Relay Works
1111

12-
Express Relay allows protocols to eliminate [Maximal Extractable Value](https://www.ledger.com/academy/glossary/maximal-extractable-value-mev) (MEV).
13-
Many protocols generate MEV on a regular basis.
14-
For example, borrow-lending protocols provide bonuses to searchers for liquidating undercollateralized loans.
15-
Searchers compete for these bonuses by tipping the chain's miners or validators.
16-
The validators capture most of the value of the liquidation bonus via these tips, so the liquidation bonus is in essence a transfer of wealth from the protocol's users to the validators in the form of tips.
17-
18-
Express Relay solves the problem of MEV by providing protocol developers with an [auction](./how-express-relay-works/auction) primitive that they can use to prioritize access to valuable protocol operations.
19-
Developers specify a set of operations in their protocol that must be accessed through Express Relay.
20-
Searchers then participate in an off-chain auction to access these operations.
21-
Their bids in the auction are used to determine the order in which their transactions will be executed.
22-
The winners' transactions are forwarded to the Express Relay smart contract. As part of the transaction, searchers must pay their specified bid.
23-
The auction profits are then split between the integrated protocol and other participants in Express Relay.
12+
Express Relay is a protocol that allows applications to auction off the right to execute on-chain operations. This protocol allows protocols to eliminate MEV by capturing the value that would otherwise go to validators and sharing it with the protocol's users.
13+
14+
Express Relay consists of two components:
15+
16+
1. **An off-chain auction server** that auctions off the right to execute protocol operations
17+
2. **An on-chain smart contract** that validates auction results and executes the winning transactions
18+
19+
## The MEV Problem
20+
21+
Many DeFi protocols generate [Maximal Extractable Value](https://www.ledger.com/academy/glossary/maximal-extractable-value-mev) (MEV) on a regular basis. For example, lending protocols provide bonuses to searchers for liquidating undercollateralized loans. Searchers compete for these bonuses by tipping validators to include their transactions first.
22+
23+
The problem with this approach is that validators capture most of the MEV value through these tips, creating a wealth transfer from protocol users to validators.
24+
25+
## The Express Relay Solution
26+
27+
Express Relay solves this problem by moving the auction off-chain, where protocols can capture the MEV and share it with their users.
28+
29+
Here's how it works:
30+
31+
1. **Protocol Integration**: Protocols integrate with Express Relay by wrapping their valuable operations (like liquidations) with permission checks
32+
2. **Opportunity Detection**: When opportunities arise, they're broadcast to searchers through the Express Relay auction server
33+
3. **Off-chain Auction**: Searchers submit bids for the right to execute these operations
34+
4. **On-chain Execution**: The auction server relays winning bids to the Express Relay smart contract, which validates permissions and executes the operations
35+
5. **Revenue Sharing**: The smart contract collects payments from searchers and distributes them according to predefined splits
2436

2537
### Before Express Relay
2638

@@ -36,15 +48,53 @@ With Express Relay (below), Searchers submit bids for their transaction to the E
3648
After the auction, the winning bids are relayed to the blockchain, where the Express Relay smart contract processes the transactions before being forwarded on to the integrated protocol.
3749
The Express Relay contract collects payment from the Searchers and forwards a share of the revenue back to the integrated protocol.
3850

51+
## Key Components
52+
53+
### Off-chain Auction Server
54+
The auction server receives bids from searchers and determines winners based on bid amounts and other criteria. It then submits winning transactions to the blockchain in the optimal order.
55+
56+
### On-chain Smart Contract
57+
The Express Relay smart contract validates that transactions have won the auction and enforces payment collection. It also handles revenue distribution between protocols and other stakeholders.
58+
59+
### Permission System
60+
Express Relay uses a permission system to ensure only auction winners can execute protected operations. This prevents frontrunning and ensures MEV capture.
61+
62+
## Benefits for Protocols
63+
64+
Express Relay offers several advantages for protocol developers:
65+
66+
- **MEV Recapture**: Convert MEV from validator tips into protocol revenue
67+
- **Reliable Execution**: Access to a dedicated network of professional searchers
68+
- **Reduced Complexity**: No need to build custom liquidation infrastructure
69+
- **Better UX**: Faster execution and lower gas costs for users
70+
71+
## Benefits for Searchers
72+
73+
Express Relay also provides advantages for searchers:
74+
75+
- **Unified Access**: Single integration point for multiple protocols
76+
- **Fair Competition**: Transparent auction mechanism
77+
- **Reduced Costs**: Lower gas costs through batch execution
78+
- **New Opportunities**: Access to exclusive protocol operations
79+
3980
## Which protocols can use Express Relay?
4081

41-
Any protocol with valuable operations can use Express Relay.
42-
These operations generate MEV, as the validators control which searchers have the right to access them.
43-
Express Relay enables protocols to auction access instead of the validators.
44-
Lending, perps, and derivatives protocols with liquidation mechanisms are clear candidates that can benefit from integration with Express Relay.
82+
Express Relay is suitable for any protocol with valuable, time-sensitive operations:
83+
84+
- **Lending Protocols**: Liquidations of undercollateralized positions
85+
- **Perpetual Protocols**: Liquidations and funding rate updates
86+
- **DEX Protocols**: Arbitrage opportunities and order book operations
87+
- **Derivatives Protocols**: Option exercises and settlement operations
88+
- **Cross-chain Protocols**: Bridge operations and relay transactions
89+
90+
## Integration Requirements
4591

46-
Aside from eliminating MEV, protocols that need a stable set of searchers would benefit from using Express Relay.
47-
Express Relay provides access to a robust network of searchers who are already active in the Express Relay ecosystem.
92+
To integrate with Express Relay, protocols need to:
93+
94+
1. **Identify Valuable Operations**: Determine which operations generate MEV
95+
2. **Add Permission Checks**: Wrap operations with Express Relay permission validation
96+
3. **Deploy Integration**: Update smart contracts with Express Relay integration
97+
4. **Configure Revenue Sharing**: Set up distribution of auction proceeds
4898

4999
## Participants in Express Relay
50100

@@ -59,23 +109,23 @@ There are four types of participants in the Express Relay protocol:
59109

60110
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mt-8">
61111
<IntegrationCard
62-
href="./how-express-relay-works/auction"
112+
href="./auction"
63113
colorScheme="blue"
64114
title="Auction"
65115
description="Learn about the auction mechanism"
66116
icon={<Gavel size={16} />}
67117
/>
68118

69-
<IntegrationCard
70-
href="./how-express-relay-works/opportunities"
71-
colorScheme="green"
72-
title="Opportunities"
73-
description="Understand available opportunities"
74-
icon={<Lightning size={16} />}
75-
/>
119+
<IntegrationCard
120+
href="./opportunities"
121+
colorScheme="green"
122+
title="Opportunities"
123+
description="Understand available opportunities"
124+
icon={<Lightning size={16} />}
125+
/>
76126

77127
<IntegrationCard
78-
href="./how-express-relay-works/permissioning"
128+
href="./permissioning"
79129
colorScheme="purple"
80130
title="Permissioning"
81131
description="Learn about access controls"

0 commit comments

Comments
 (0)