Skip to content
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

feat(refunds): More details on gas refunds. #574

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/flashbots-auction/advanced/rpc-endpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,59 @@ where
- `consideredByBuildersAt`: indicates time at which each builder selected the bundle to be included in the target block
- `sealedByBuildersAt`: indicates time at which each builder sealed a block containing the bundle

### flashbots_getFeeRefundTotalsBySender

The `flashbots_getFeeRefundTotalsBySender` JSON-RPC method allows a user to query the total amount of fee refunds they have received from Flashbots.
The method requires the user to provide the address of the sender whose refunds they are querying.

```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "flashbots_getFeeRefundTotalsBySender",
"params": [
"0xd2824d2d7d6399a4b9a47f258b870d2afb213948"
]
}
```

The response will include the total amount of fee refunds pending and received by the sender:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"pending": "0x2bb2c8eabcc000",
"received": "0x1b667a56d488000",
"maxBlockNumber": "0x13b1f2f",
}
}
```

Refunds which are `pending` have yet to be sent to the user, while refunds which are `received` have already been sent. The `maxBlockNumber` field indicates the highest block number for which refunds have been processed.

#### Authenticated Response

If the user includes a valid `X-Flashbots-Signature` header with the request, the response will also include the `recipient` field, which is the address to which refunds will be sent:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"pending": "0x2bb2c8eabcc000",
"received": "0x1b667a56d488000",
"maxBlockNumber": "0x13b1f2f",
"recipient":"0x92ca1b2473e3c25418a821c2b4c99253a19d2137"
}
}
```

See [flashbots_setFeeRefundRecipient](#flashbots_setfeerefundrecipient) below for more information on setting the refund address.

If the signature is invalid or does not match the queried address, an appropriate error will be returned instead.

### flashbots_setFeeRefundRecipient

The `flashbots_setFeeRefundRecipient` JSON-RPC method allows a user to "delegate" their [fee refunds](/flashbots-auction/advanced/gas-fee-refunds) to a specific wallet address. Two addresses must be provided, the first is the address associated with the signing key used to authenticate your request, while the second is the address to send refunds to.
Expand Down
2 changes: 1 addition & 1 deletion docs/flashbots-protect/gas-fee-refunds.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ For the private transaction API: The refund recipient is the signer used on the

## How to track refunds

Refunds are tracked from a start date of July 8, 2024. Users wil be able to view unclaimed refund amounts via an upcoming API.
Refunds are tracked from a start date of July 8, 2024. Refunds are sent to recipients in batches, and originate from our builder address `0xdf99A0839818B3f120EBAC9B73f82B617Dc6A555`. The recipient can track the status of their refunds using the [`flashbots_getFeeRefundTotalsBySender`](/flashbots-auction/advanced/rpc-endpoint#flashbots_getfeerefundtotalsbysender) RPC method.
Loading