Skip to content

Commit 1338c14

Browse files
committed
wip docs
1 parent c9963d9 commit 1338c14

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed
513 KB
Loading
520 KB
Loading
495 KB
Loading
623 KB
Loading

pages/express-relay/contract-addresses.mdx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import {Tabs} from "nextra/components"
12
import AddressTable from "../../components/AddressTable";
23

34
Express Relay is currently deployed on the following networks:
45

5-
## Mainnets
6+
<Tabs items={['Mainnet', 'Testnet']}>
67

7-
You can access the Auction Server via the following endpoint: https://pyth-express-relay-mainnet.asymmetric.re/
8+
<Tabs.Tab>
9+
Auction Server endpoint: https://pyth-express-relay-mainnet.asymmetric.re/
810

911
### Mode
1012

@@ -46,6 +48,7 @@ You can access the Auction Server via the following endpoint: https://pyth-expre
4648

4749
This list contains the addresses of the commonly used assets present in opportunities on the Mode network:
4850

51+
4952
<AddressTable
5053
explorer={"https://explorer.mode.network/address/$ADDRESS"}
5154
entries={[
@@ -62,9 +65,9 @@ This list contains the addresses of the commonly used assets present in opportun
6265
]}
6366
/>
6467

65-
## Testnets
66-
67-
You can access the Auction Server via the following endpoint: https://per-staging.dourolabs.app/
68+
</Tabs.Tab>
69+
<Tabs.Tab>
70+
Auction Server endpoint: https://per-staging.dourolabs.app/
6871

6972
### Optimism Sepolia
7073

@@ -106,6 +109,7 @@ You can access the Auction Server via the following endpoint: https://per-stagin
106109

107110
This list contains the addresses of the commonly used assets present in opportunities on the Optimism Sepolia network:
108111

112+
109113
<AddressTable
110114
explorer={"https://optimism-sepolia.blockscout.com/address/$ADDRESS"}
111115
entries={[
@@ -131,3 +135,6 @@ This list contains the addresses of the commonly used assets present in opportun
131135
},
132136
]}
133137
/>
138+
139+
</Tabs.Tab>
140+
</Tabs>

pages/express-relay/how-express-relay-works.mdx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
# How Express Relay Works
22

3-
Express Relay allows protocols to eliminate maximal extractable value (MEV).
3+
Express Relay allows protocols to eliminate [Maximal Extractable Value](https://www.ledger.com/academy/glossary/maximal-extractable-value-mev) (MEV).
44
Many protocols generate MEV on a regular basis.
55
For example, borrow-lending protocols provide bonuses to searchers for liquidating undercollateralized loans.
66
Searchers compete for these bonuses by tipping the chain's miners or validators.
7-
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.
7+
The validators capture most of the value of the liquidation bonus via these tips, so the liquidation bonus is a transfer of wealth from the protocol's users to the validators in the form of tips.
88

9-
Express Relay solves the problem of MEV by providing protocol developers with an auction primitive that they can use to prioritize access to valuable protocol operations.
9+
Express Relay solves the problem of MEV by providing protocol developers with an [auction](./how-express-relay-works/auction.mdx) primitive that they can use to prioritize access to valuable protocol operations.
1010
Developers specify a set of operations in their protocol that must be accessed through Express Relay.
1111
Searchers then participate in an off-chain auction to access these operations.
12-
Their bids in the auction are used to determine the priority of their transactions, i.e., the order in which their transactions will be executed.
13-
The winners' transactions are forwarded to the blockchain, which both pays their bid and executes the operation.
14-
The profits of the auction are then split between the integrated protocol and other participants in Express Relay.
12+
Their bids in the auction are used to determine the order in which their transactions will be executed.
13+
The winners' transactions are forwarded to the Express Relay smart contract. As part of the transaction, searchers must pay their specified bid.
14+
The auction profits are then split between the integrated protocol and other participants in Express Relay.
1515

16-
![](images/express_relay/express_relay_schematic.svg)
16+
![](images/express_relay/before_express.jpg)
17+
![](images/express_relay/after_express.jpg)
1718

18-
FIXME: update this diagram with the designers' version
1919

2020
The diagram above shows how Express Relay changes the MEV landscape for a liquidation.
21-
In the status quo (left), Searchers tip miners in order to guarantee that their liquidation transaction lands on-chain, and their transaction directly interacts with the protocol exposing the liquidation opportunity.
22-
With Express Relay (right), Searchers submit bids for their transaction to the Express Relay auction.
23-
After the auction, the winning bids are relayed to the blockchain, where the transactions are processed by the Express Relay smart contract before being forwarded on to the integrated protocol.
21+
In the status quo (above), Searchers tip miners to guarantee that their liquidation transaction lands on-chain and that their transaction directly interacts with the protocol, exposing the liquidation opportunity.
22+
With Express Relay (down), Searchers submit bids for their transaction to the Express Relay auction.
23+
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.
2424
The Express Relay contract collects payment from the Searchers and forwards a share of the revenue back to the integrated protocol.
2525

26-
FIXME: I think the diagram is wrong (specifically the liquidation bonus going back to express relay)
27-
2826
## Which protocols can use Express Relay?
2927

3028
Any protocol with valuable operations can use Express Relay.

pages/express-relay/how-express-relay-works/opportunities.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ The `OpportunityAdapter` contract uses the [Permit2](https://github.com/Uniswap/
3737

3838
Once on-chain opportunities arise, searchers can be notified of their existence via the opportunity server. Like the auction server, this is an off-chain piece of the Express Relay stack that is run by an infrastructure partner designated by the DAO. The opportunity server presents opportunities to searchers in a way that abstracts away bespoke integration work for the searcher: instead of worrying about crafting calldata specific to every new liquidation interface, searchers now view liquidation opportunities in terms of tokens they need to sell (debt they repay) in exchange for tokens they buy (collateral they liquidate). This simplified interface unifies different liquidation schemas and allows searchers to easily plug into more protocols.
3939

40-
In addition to learning about present opportunities, searchers can also query the opportunity server for data around historical opportunities.
40+
In addition to learning about present opportunities, searchers can also query the opportunity server for data about historical opportunities.
4141

42-
-(TODO) Diagram of searchers before and after ExpressRelay
43-
-before: searcher connects to every new protocol bespokely. similarly, protocols have to court and incentivize individual searchers. maybe a messy looking bipartite graph with O(NM) edges
44-
-after: searcher connects once to ExpressRelay, then gets access to opportunities of all integrated protocols. similarly, protocol connects once to ExpressRelay, then gets access to DeFi services of all integrated searchers. a cleaner looking graph with ER in the middle as a hub for both protocols and searchers.
42+
![](images/express_relay/before_searcher.jpg)
43+
![](images/express_relay/after_searcher.jpg)
4544

46-
## Opportunity monitor
45+
-Before The searcher connects to every new bespoke protocol. Similarly, protocols have to court and incentivize individual searchers. Maybe a messy-looking bipartite graph with O(NM) edges
46+
-After Searcher connects once to ExpressRelay, then gets access to opportunities of all integrated protocols. Similarly, the protocol connects once to Express Relay and then gets access to DeFi services for all integrated searchers. A cleaner-looking graph with ER in the middle as a hub for both protocols and searchers.
47+
48+
## Opportunity Monitor
4749

4850
Many integrated protocols with Express Relay build out an opportunity monitor script to query executable opportunities on their protocol and expose them to searchers. This allows them to tap into all Express Relay-integrated searchers, who do not need to do any additional integration work beyond having access to the relevant tokens to execute opportunities on the protocol.
4951

50-
In terms of existing infrastructure, the opportunity monitor script is most analogous to a protocol's liquidation scripts/bots. Typically, many lending protocols build liquidation bot libraries that they share publicly in hopes of encouraging adoption by liquidators. With minor modifications, these scripts can serve as the opportunity monitor that enables all Express Relay-integrated searchers to participate in this protocol's liquidations.
52+
In terms of existing infrastructure, the opportunity monitor script is most analogous to a protocol's liquidation scripts/bots. Typically, many lending protocols build liquidation bot libraries that they share publicly in hopes of encouraging adoption by liquidators. With minor modifications, these scripts can serve as the opportunity monitor that enables all Express Relay-integrated searchers to participate in this protocol's liquidations.

0 commit comments

Comments
 (0)