-
Notifications
You must be signed in to change notification settings - Fork 35
Express Relay Docs #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Express Relay Docs #339
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
ba754df
Initial commit
aditya520 bf983a1
added some framework to docs
aditya520 e758759
protocol guide wip
aditya520 52c3346
add intro express relay docs
anihamde 8d46c78
Merge branch '(feat)-add-express-relay' of github.com:pyth-network/do…
anihamde 8cb8c04
up - up - update
aditya520 0e4d456
updated guide
aditya520 f45490f
additional resources
aditya520 0a56469
tiny changes
aditya520 d524fd3
uhh
aditya520 73aca99
(WIP) Express relay docs
aditya520 27fbecc
(WIP) API refernce
aditya520 9cf9fec
(WIP) Express relay docs
aditya520 e1c5734
details around auction, opportunities, and permissioning
anihamde a1ebb8d
Merge branch '(feat)-add-express-relay' of github.com:pyth-network/do…
anihamde ce9082d
(WIP) Express relay docs
aditya520 d16b669
(WIP) Express relay docs
aditya520 ecb7ca6
add some moar content
anihamde a9d32cd
(WIP) Express relay docs
aditya520 f044075
content dump
anihamde b0df6fb
Merge branch '(feat)-add-express-relay' of github.com:pyth-network/do…
anihamde 59b1992
Suggested edits (#360)
jayantk 1780065
(WIP) Express relay docs- Yaser comments
aditya520 0ee5829
Update tables
m30m 6ad0182
Change MEV definition from the old one
m30m 703c905
added searcher guide to auction-server
anihamde 31eb98f
finalize opportunity adapter docs dump
anihamde 59227c3
Use cards for the main CTAs
m30m cf27a2e
Separate websocket api reference
m30m bc60b80
WIP-Searcher-guide
aditya520 9979e89
WIP-searcher-guide-refactor
aditya520 2bda439
wip
aditya520 c35641d
WIP-searcher-guide-refactor
aditya520 6901e48
Reorg searcher docs
m30m 56d8802
WIP-protocol-guide-refactor
aditya520 4f2f9e4
WIP-searcher-guide-refactor
aditya520 d172628
WIP-ER
aditya520 e24d4b6
Update docs
m30m fb63c4e
some minor changes
anihamde 47ea3f0
WIP-searcher-guide-refactor
aditya520 84d8831
WIP-searcher-guide-refactor
aditya520 078f9f0
WIP-searcher-guide-refactor
aditya520 d3263cc
WIP-comments-resolved
aditya520 d816fed
address change
aditya520 d028c8d
WIP-comments-resolved
aditya520 2448bc8
WIP-comments-resolved
aditya520 a842125
few small fixes pt 1
anihamde 04826af
WIP-intro page
aditya520 5d3e43e
few small fixes pt 2
anihamde c9963d9
Merge branch '(feat)-add-express-relay' of github.com:pyth-network/do…
anihamde 1338c14
wip docs
aditya520 c97754c
Express Relay docs v1
aditya520 78cb484
index change
aditya520 59459ce
Changed example reference to example repo
aditya520 dee1c14
Express Relay v1.xx
aditya520 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The auction in Express Relay is held off-chain at the auction server. Bids arrive at the auction server and compete against other bids vying for the same permission key. A relayer selected by governance serves as the auctioneer and is expected to determine the auction in line with the criterion of maximizing the revenue shared back to the protocol that generated this opportunity. That means the auctioneer is expected to forward the subset of bids that maximizes the revenue back to the protocol. | ||
|
||
Thus, the Express Relay auction is analogous to a sealed-bid auction, in that participants in the auction will not have the contents of their bid disclosed publicly unless they are forwarded on-chain. Generally, bids are forwarded on-chain if they are expected to execute successfully on-chain, though additional "fallback" bids may be forwarded as well in case of execution failures for the expected winners. The `ExpressRelay` contract extracts the payment of the specified bid amount only if the searcher's bid executes successfully on-chain. Hence, the Express Relay auction can be seen as a generalization of a [first-price sealed-bid auction](https://en.wikipedia.org/wiki/First-price_sealed-bid_auction), in that multiple bids can win and pay their first price. | ||
|
||
The revenue from the auction is shared amongst relevant stakeholders in the Express Relay system. This includes: | ||
- the protocol, which generated the relevant opportunity | ||
- the relayer, which handled running the off-chain components of the system | ||
|
||
The exact revenue splits can be found in the Express Relay read contract and are subject to ... |
Empty file.
11 changes: 11 additions & 0 deletions
11
pages/express-relay/how-express-relay-works/opportunities.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
In the context of Express Relay, an opportunity refers to a potential transaction that a searcher can execute on a protocol. Typically, the term "opportunity" is used for such transactions that are lucrative and therefore hotly contested by many searchers. | ||
|
||
In the pre-Express Relay world, opportunities therefore correspond to MEV: a protocol generates MEV when an opportunity appears on that protocol and searchers bid up the right to execute the opportunity at the validator level. | ||
|
||
In the context of Express Relay, the value deriving from an opportunity no longer flows to the validator but instead is recaptured by the system and shared back with the protocol. In Express Relay, protocols expose opportunities to the network of integrated searchers, and the searchers then bid on priority to execute those opportunities. Critically, the auction has moved from being determined by validators to a lower level at the protocol level. | ||
|
||
Explain Opportunity Adapter contract | ||
|
||
Brief explanation of and Links to permit2/create2/factory | ||
|
||
Explanation of how to write the monitor at a high level |
17 changes: 17 additions & 0 deletions
17
pages/express-relay/how-express-relay-works/permissioning.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
`permissionId` is a `bytes` object that represents the unique identifying information of a position within the protocol. `permissionId` allows the system to distinguish between bids competing on different opportunities and thereby run more scoped and efficient auctions. | ||
|
||
For some protocols, each borrower has a unique position, so the borrower address uniquely identifies a position. For other protocols, each borrower might have multiple positions, distinguished by the address of the collateral asset or by a uint256 id number. In those cases, the set of information that uniquely identifies a position would include multiple fields. | ||
|
||
`permissionId` is the concatenation of all these fields in bytes format. To concatenate these fields together, you can call `abi.encode()`. For example, if a protocol featured a unique position per borrower, then it could form `permissionId` as | ||
|
||
``` | ||
bytes memory permissionId = abi.encode(borrowerAddress); | ||
``` | ||
|
||
On the other hand, if a protocol allowed a borrower to open as many new positions as they wanted, denoted by an identifier `uint256 positionId`, then it could form permissionId as | ||
|
||
``` | ||
bytes memory permissionId = abi.encode(borrowerAddress, positionId); | ||
``` | ||
|
||
The `permissionId` is used in the `ExpressRelay` contract to toggle permissions for interacting with the protocol. This toggling is checked within the protocol's code to ensure that the current transaction is within the context of Express Relay, so that recaptured value can be returned to the protocol. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a page of Example Application. We can use that to explain if needed.