-
Notifications
You must be signed in to change notification settings - Fork 150
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
initial draft for MEV refund read endpoints #577
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -869,6 +869,167 @@ If the first address matches the authentication signature, then a response with | |
|
||
If the signature is invalid or does not match the first address, an appropriate error will be returned instead. | ||
|
||
### MEV Refund JSON-RPC API Documentation | ||
|
||
Below we will document set of endpoints to track MEV Refunds generated by MEV-Share. All of these endpoints do not require signature | ||
|
||
### flashbots_getMevRefundsByRecipient | ||
|
||
Retrieves all refunds sent to a specific recipient address. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In each of these individual API entries we should:
(This same comment applies to each new API section below). |
||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "flashbots_getMevRefundsByRecipient", | ||
"params": ["0x7642259CD28C04F75EB4C00785F95461434101C0"] | ||
} | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"refunds": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this list should be paginated? |
||
{ | ||
"txHash": "0x0eee857653a726179a8dd0a9f2f58351ba1e25acae6844e45faee2250275fa8d", | ||
"amount": "0x9f458e97b818c", | ||
"recipient": "0x7642259cd28c04f75eb4c00785f95461434101c0" | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
### flashbots_getMevRefundsByHash | ||
|
||
Retrieves refunds associated with a specific transaction or `sbundle` hash. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add a quick explanation of what an "sbundle" is? |
||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "flashbots_getMevRefundsByHash", | ||
"params": ["0x8A29C254B498E0757FF93B3E8424225DC441C24AC5C6A2F8CC9925D36E0CDB86"] | ||
} | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"refunds": [ | ||
{ | ||
"txHash": "0xeb81e87b450f83a5e1a08033ea51bbb6a4b5b706eb629fbb1ed8e81d173207fe", | ||
"amount": "0x95dc82ca0cb6b", | ||
"recipient": "0xa34c84ed07fdf0c92858e364cfcdfa1e47fe5369" | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
### flashbots_getMevRefundsBySender | ||
|
||
Retrieves all refunds sent by a specific sender address (for transactions) or signer address (for `sbundles`) | ||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "flashbots_getMevRefundsBySender", | ||
"params": ["0x7642259CD28C04F75EB4C00785F95461434101C0"] | ||
} | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"refunds": [ | ||
{ | ||
"txHash": "0x0eee857653a726179a8dd0a9f2f58351ba1e25acae6844e45faee2250275fa8d", | ||
"amount": "0x9f458e97b818c", | ||
"recipient": "0x7642259cd28c04f75eb4c00785f95461434101c0" | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
### flashbots_getMevRefundTotalByRecipient | ||
|
||
Retrieves the total amount of MEV refunds received by a specific recipient address. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "MEV refunds" -> "MEV-Share refunds" |
||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "flashbots_getMevRefundTotalByRecipient", | ||
"params": ["0xDCDDAE87EDF1D9F62AE2F3A66EB2018ACD0B2508"] | ||
} | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"total": "0xeff5f44e097dcfac" | ||
} | ||
} | ||
``` | ||
|
||
Note: The total is returned as a hexadecimal string representing the amount in wei. | ||
|
||
### flashbots_GetMevRefundTotalBySender | ||
|
||
Retrieves the total amount of MEV refunds sent by a specific sender address. | ||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"method": "flashbots_getMevRefundTotalBySender", | ||
"params": ["0xDCDDAE87EDF1D9F62AE2F3A66EB2018ACD0B2508"] | ||
} | ||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"total": "0x4a817c800" | ||
} | ||
} | ||
``` | ||
|
||
Note: The total is returned as a hexadecimal string representing the amount in wei. | ||
|
||
### API Response | ||
|
||
- All method supports JSON-RPC standards for success response and not supported for error response(V2 methods are exceptions). | ||
|
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.
I would delete this section (lines 872-874) and instead repeat the context on line 874 (APIs are for MEV-Share, not authenticated) in each individual API entry below. The reason is: