From 0c14649a543b503b5a1f0ef83c6871ca0293accf Mon Sep 17 00:00:00 2001 From: sketsdever Date: Fri, 4 Oct 2024 11:24:20 -0400 Subject: [PATCH 1/3] Add MEV refund aggregate APIs --- .../advanced/rpc-endpoint.mdx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/docs/flashbots-auction/advanced/rpc-endpoint.mdx b/docs/flashbots-auction/advanced/rpc-endpoint.mdx index 414bcd9a..cd5226af 100644 --- a/docs/flashbots-auction/advanced/rpc-endpoint.mdx +++ b/docs/flashbots-auction/advanced/rpc-endpoint.mdx @@ -948,6 +948,66 @@ 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. +### flashbots_getMevRefundTotalByRecipient + +Returns the total amount of [MEV refunds](/flashbots-protect/mev-refunds) that have been paid to a specific recipient address. This API not require authentication. + +#### 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 + +Returns the total amount of [MEV refunds](/flashbots-protect/mev-refunds) that have been generated on transactions or bundles from a specific sender address. The sender is either the `tx.origin` or the Flashbots signer (for bundles), and may be different from the recipient if the recipient has been delegated to another address. + +This API does not require authentication. + +#### 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). From 2d6f2250e9b97b1cdc8d33b117274d14238e8f06 Mon Sep 17 00:00:00 2001 From: sketsdever Date: Fri, 4 Oct 2024 11:31:16 -0400 Subject: [PATCH 2/3] Add docs for getMevRefundsByHash --- .../advanced/rpc-endpoint.mdx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/flashbots-auction/advanced/rpc-endpoint.mdx b/docs/flashbots-auction/advanced/rpc-endpoint.mdx index cd5226af..8d818cc0 100644 --- a/docs/flashbots-auction/advanced/rpc-endpoint.mdx +++ b/docs/flashbots-auction/advanced/rpc-endpoint.mdx @@ -979,7 +979,7 @@ Note: The total is returned as a hexadecimal string representing the amount in w ### flashbots_getMevRefundTotalBySender -Returns the total amount of [MEV refunds](/flashbots-protect/mev-refunds) that have been generated on transactions or bundles from a specific sender address. The sender is either the `tx.origin` or the Flashbots signer (for bundles), and may be different from the recipient if the recipient has been delegated to another address. +Returns the total amount of [MEV refunds](/flashbots-protect/mev-refunds) that have been generated on transactions or bundles from a specific sender address. The sender is the `tx.origin` for individual transactions or bundles of size 1, or the Flashbots signer for bundles of size > 1. It may be different from the recipient if the recipient has been delegated to another address. This API does not require authentication. @@ -1006,6 +1006,39 @@ This API does not require authentication. } ``` +### flashbots_getMevRefundsByHash + +Returns detailed information about the [MEV refunds](/flashbots-protect/mev-refunds) generated by a specific transaction or bundle hash. This API does not require authentication. + +#### 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" + } + ] + } +} +``` + Note: The total is returned as a hexadecimal string representing the amount in wei. ### API Response From 2cfc18845e996e7338d34c019795cdc759ff8b3e Mon Sep 17 00:00:00 2001 From: sketsdever Date: Fri, 4 Oct 2024 14:12:29 -0400 Subject: [PATCH 3/3] Explain sbundle hash --- docs/flashbots-auction/advanced/rpc-endpoint.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/flashbots-auction/advanced/rpc-endpoint.mdx b/docs/flashbots-auction/advanced/rpc-endpoint.mdx index 8d818cc0..ad220ac8 100644 --- a/docs/flashbots-auction/advanced/rpc-endpoint.mdx +++ b/docs/flashbots-auction/advanced/rpc-endpoint.mdx @@ -1008,7 +1008,7 @@ This API does not require authentication. ### flashbots_getMevRefundsByHash -Returns detailed information about the [MEV refunds](/flashbots-protect/mev-refunds) generated by a specific transaction or bundle hash. This API does not require authentication. +Returns detailed information about the [MEV refunds](/flashbots-protect/mev-refunds) generated by a specific transaction or sbundle hash. An sbundle hash is a bundle hash for a bundle that was submitted to MEV-Share via `mev_sendBundle`. This API does not require authentication. #### Request