Skip to content

Commit

Permalink
Merge branch 'main' into corrected-docs-mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
intls authored Oct 1, 2024
2 parents e018e96 + 0dfc20f commit 3422ed7
Show file tree
Hide file tree
Showing 19 changed files with 355 additions and 167 deletions.
46 changes: 31 additions & 15 deletions docs/flashbots-auction/advanced/gas-fee-refunds.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,50 @@ Bundles sent by the same signer will be treated as non-competitive.

### The Flat Tax Rule

<div className="med caption-img">

![Flat tax rule](/img/flat-tax-rule.png)

Definition of the flat tax rule

</div>
- **$B(T)$** is the most profitable block produced from bundles in $T$.
- **$v(T)$** is the value of $B(T)$.
- **$b_i(T)$** is the payment of all bundles sent by identity $i$ if block $B(T)$ is realized.
- **$\mu_i(T) = \min\{b_i(T), v(T) - v(T \setminus \{i\})\}$** is the marginal contribution of all bundles sent by identity $i$ if $B(T)$ is realized. We bound the marginal contribution so that the net payment can't be negative.
- **$c$** is the amount the builder pays to the proposer to win the block.

$$
\phi_i(T, c) = \frac{\mu_i(T)}{\sum_j \mu_j(T)} \min\{v(B(T)) - c, \sum_j \mu_j(T)\}
$$

So the net payment per identity (assuming it's included) is $p_i(T) = b_i(B(T)) - \phi_i(T, c)$.

Notice that if the block generates enough value after paying the proposer, everyone should be refunded their contribution, meaning everyone pays the minimum they need to pay to beat competition.

### Identity constraint

To avoid the rule being gamed by submitting bundles from multiple identities, we impose an additional constraint that no set of identities can receive in total more refunds than they contribute to the block.

<div className="med caption-img">
For each set of identities $I$ we define

$$
\mu_I(T) = \min\{\sum_{i\in I} b_i(T), v(T) - v(T \setminus I)\},
$$

to be the joint marginal contribution of the identities in $I$ to the block. Then we choose rebates that are minimally different from the flat-tax rule subject to the constraint that they don't rebate a set of bundles more in total than its joint marginal contribution. This means the vector of rebates $\psi(T, c)$ solves

$$
\min_{r\in\mathbb{R}^n_+} \sum_i (r_i - \phi_i(T, c))^2
$$

![Identity constraint](/img/identity-constraint.png)
$$
\text{subject to} \sum_{i\in I} r_i \leq \mu_I(T) \text{ for each } I \subseteq B(T),
$$

Definition of the identity constraint
$$
\sum_i r_i \leq v(T) - c
$$

</div>
where $\phi(T, c)$ are the orginal flat-tax rebates as defined above.

## Who receives refunds

The refund recipient is the signer used on the `eth_sendBundle`, `mev_sendBundle`, or `eth_sendPrivateTransaction` request.
By default, the refund recipient is the signer used on the `eth_sendBundle`, `mev_sendBundle`, or `eth_sendPrivateTransaction` request. You can delegate your recipient to a different address using the `flashbots_setFeeRefundRecipient` API.

## How to track refunds

Refunds are tracked from a start date of July 8, 2024. Via an upcoming API, users will be able to:
* View unclaimed refund amounts
* Delegate refunds to an Ethereum account other than their signing key address.
Refunds are tracked from a start date of July 8, 2024. Users will be able to view refund amounts via an upcoming API.
2 changes: 1 addition & 1 deletion docs/flashbots-auction/advanced/rpc-endpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ example response:

#### `privacy`

By default, transactions are sent to the Flashbots MEV-Share Node with the default [Stable](/flashbots-protect/mev-share#stable-configuration) configuration. The `privacy` parameter allows you to specify your own privacy parameters.
By default, transactions are sent to the Flashbots MEV-Share Node with the default [Stable](/flashbots-protect/mev-refunds#stable-configuration) configuration. The `privacy` parameter allows you to specify your own privacy parameters.

| Param | Type Info | Description |
| --- | --- | --- |
Expand Down
16 changes: 16 additions & 0 deletions docs/flashbots-mev-boost/block-builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,28 @@ The various `builder_pubkeys` used to identify Flashbots builders to relays are
| 0xa02b009596e741d5f61d18b900cbd03bbcdb9c0f16b1981928d13b57fcb48d4ddce21a96c523bf84425b3a4e6e6b3f14 |
| 0xa03a000b0e3d1dc008f6075a1b1af24e6890bd674c26235ce95ac06e86f2bd3ccf4391df461b9e5d3ca654ef6b9e1ceb |
| 0xa03b00ddb78b2c111450a5417a8c368c40f1f140cdf97d95b7fa9565467e0bbbe27877d08e01c69b4e5b02b144e6a265 |
| 0xa04a00ea847205dc7d684de0424544faf2dbc7e85d4ea72e5cde59c26e179f4caca52645169ee9c3685ae7d0ebaf26ed |
| 0xa04b0070ffa9e233d9c183fbb8cff4a6b3130fb90b765932295eafbc76c6e02b5b0c4ecb579a769a72c6d0e6c7f0e844 |
| 0xa08a00b8d1521ddc7e51717f9e1ed77266108008acec8cb58aa492ed0a17cc4c55330cfb1871d4471a7451d3f7c89192 |
| 0xa08b00cedceeb18c97d723f9338ead7d660fffc9050e487a5219e334e08e3d15faf4d8b51b0daf0e792f5f27a8c54da0 |
| 0x800a002dd9e1afc77af8ae909cf7f8169b413a92cfd43caa56ac749024774d9817a806dae49f4bd5af0661b054595ea4 |
| 0x800b00c6e03a92b910cfe928fe6d5bff63eb326af308a6224c512a82c6fdeae92e4d3a39e7b8dbfc572af5d2411cb26c |
| 0x801a00923e9949a7c510f565d92d282bcc79d79da6d57c98972891553443877ba5905b8bdf8145e23a06dac45b9a4d69 |
| 0x801b00e0e3a828ef58174652bc74cc6695fee2c7035a935b739c59cdd958c69564668ca5334dc51a85421eba77f9acc2 |
| 0x802a0012e4878385fbb8fb1f4b7d2ddaf332d2c409d340e2328a75e2387edafd16d543ca07ec2cc8d6134415e5a5b0ad |
| 0x802b00ecf62b2968050b7f557f8edbcbc080c9ee0cecc0982736d85997d3a1fb586587de7fb360fa31bade77254ce2e4 |
| 0x803a00a9dd54076d272a332f9e9d6815e4f9f449cc1ea2dbdc48ad90756206941c1f050ee97d66e314d7f773b5c71365 |
| 0x803b0018bd6776c5be2012e7ea053352fdf17df87921af9a9321e89d1f5da254de4e51e1e011fd25cf66e76eef551d5d |
| 0x804a0032e48f725bb41305041439578a89f4da71bd7662096d5bb55e2d14ac7135eb01d29fe0914f8efc57c85eb6e0f2 |
| 0x804b0038e40af99372530e57f351694643a667b0f3a197e1116d0496b1fefcd04df23c64037af1c807e30ac2746aba3f |
| 0x805a003c2b3c51302132864ac6897cf2623ce4ad0b35f5afe43f70e4e4d9c87f9e9fe5252836faedae57c0f922cb14a0 |
| 0x805b008679ccda28ae22ded00a91a24c15951a078032ceee051d72d60240b6e199873c8a9f2042b982be6588e67aba70 |
| 0x806a008bd4beb89f79d3df63b64c94dfab54857465fd0a5d1041b02c498bb5aa47ddb18e3829eebd0ca6b46db4969b2d |
| 0x806b00a40b92e88bcd83e31f15d75106bccb0dd6dff5d69daa644fbb71e736cc6fde918db241b8e5649e8abe3461fad0 |
| 0x807a00919db875280147cc98ef29d49a4ff3ab533b4c33df21d6c189ce4df0fd9446114835d7d2d44fbe4e7aa0a1df4c |
| 0x807b00cc542a2f24202638bef5ec2e0e729ed1759d3f87158350e75ce010d9ccb746bcde4205c505bff6b3deeda59982 |
| 0x808a0004c6802692bee5217ae930d29ccd9f6c9983acde9acf873d93f16b7d2d6064cb72cae1c89c0a59eb83c0bed40d |
| 0x808b0035e892b3e47eb8b4b3e6f7116313c6d1378abfde48c6311f687f93f6fe241f270f2acf32e3927adc21c46b3a1e |

## Additional Links & References

Expand Down
1 change: 1 addition & 0 deletions docs/flashbots-mev-share/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ At the moment, MEV-Share Nodes only accept backruns.
## How do I use MEV-Share?
The simplest way to use MEV-Share is by sending transactions to [Flashbots Protect](/flashbots-protect/quick-start), which leverages the [Flashbots MEV-Share Node](/flashbots-protect/mev-share). Wallet and application developers should check out the [Flashbots Protect MEV-Share section](/flashbots-protect/mev-share) for information about integrating and configuring the Flashbots MEV-Share Node.


## How do I search on MEV-Share?
Searchers should see the [Getting Started](/flashbots-mev-share/searchers/getting-started) guide for a walkthrough of MEV-Share and how it differs from traditional searching.
2 changes: 1 addition & 1 deletion docs/flashbots-mev-share/orderflow-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: For Orderflow Providers
---

Flashbots runs a MEV-Share Node that can be used by sending transactions to [Flashbots Protect](/flashbots-protect/quick-start). Wallets and application developers should see the [Protect MEV-Share Node guide](/flashbots-protect/mev-share) to configure your integration.
Flashbots runs a MEV-Share Node that can be used by sending transactions to [Flashbots Protect](/flashbots-protect/quick-start). Wallets and application developers should see the [Protect MEV-Share Node guide](/flashbots-protect/mev-refunds) to configure your integration.
4 changes: 2 additions & 2 deletions docs/flashbots-mev-share/release-notes/2023-07.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## customized refunds

Configure the percent(s) and recipient(s) for MEV-Share refunds by adding the [`refund`](/flashbots-protect/mev-share#refunds) query parameter to Protect RPC requests
Configure the percent(s) and recipient(s) for MEV-Share refunds by adding the [`refund`](/flashbots-protect/settings-guide#refunds) query parameter to Protect RPC requests
or by adding `preferences.validity.refund` argument to the `eth_sendPrivateTransaction` JSON-RPC [method](/flashbots-auction/advanced/rpc-endpoint#eth_sendprivatetransaction).

## builder sharing
Share transactions and bundles with additional builders for faster inclusion.

- Users: [Opt in to share with registered builders](/flashbots-protect/mev-share#builders)
- Users: [Opt in to share with registered builders](/flashbots-protect/settings-guide#builders)
- Builders: [Register to receive bundles](https://github.com/flashbots/dowg#builders)

## debugging guide
Expand Down
2 changes: 1 addition & 1 deletion docs/flashbots-mev-share/release-notes/2023-09.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## default logs hint

A new hint which shares a subset of logs, as described in the [stable configuration](/flashbots-protect/mev-share#stable-configuration).
A new hint which shares a subset of logs, as described in the [hints] settings(/flashbots-protect/settings-guide#hints).

Previously these logs were shared by default. Now, users of the private transaction API, Protect RPC, and bundle relay can also request to share these logs when customizing their settings.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Client libraries have been developed for the following programming languages (mo

To reiterate our goal, we need to find pending transactions from other Ethereum users and backrun them (send our transaction immediately after the user's transaction). If the user's trade moves the price enough, we'll arbitrage the trading pair between two exchanges for a profit.

As MEV-Share receives new transactions, it broadcasts them to searchers via the [Event Stream](/flashbots-mev-share/searchers/event-stream). Each transaction shares varying amounts of data via [hints](/flashbots-protect/mev-share#hints), but by default, transactions that trade on Uniswap, Balancer, or Curve will expose the trading pair's contract address in the log topics.
As MEV-Share receives new transactions, it broadcasts them to searchers via the [Event Stream](/flashbots-mev-share/searchers/event-stream). Each transaction shares varying amounts of data via [hints](/flashbots-protect/mev-refunds#hints), but by default, transactions that trade on Uniswap, Balancer, or Curve will expose the trading pair's contract address in the log topics.

Here's an example of an event generated by a user who's (most likely) using MEV-Share's default privacy settings:

Expand Down Expand Up @@ -141,7 +141,7 @@ _To read more about how the SSE stream works, see the [Event Stream docs](/flash

## Filtering Relevant Transactions

MEV-Share uses [**hints**](/flashbots-protect/mev-share#hints) to selectively share information about a transaction. Based on the hint preferences specifies by the user when connecting, the transactions (or bundles) they send will trigger events containing information about their transaction which is filtered according to their hint preferences.
MEV-Share uses [**hints**](/flashbots-protect/mev-refunds#hints) to selectively share information about a transaction. Based on the hint preferences specifies by the user when connecting, the transactions (or bundles) they send will trigger events containing information about their transaction which is filtered according to their hint preferences.

In this guide, we're only concerned with the fields in `logs`: `address` and `topics`. Other fields not covered in this guide are detailed in the [Event Scheme docs](/flashbots-mev-share/searchers/event-stream#event-scheme).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Once all the transactions you want to include in your bundle are added to the qu

If you're being helped with a whitehat recovery, we may provide a web interface for you to do this.

If you want to send a bundle directly, check out the [Flashbots Auction Docs](/flashbots-auction/quick-start#how-to-send-your-first-flashbots-bundle) for instructions on how to do this.
If you want to send a bundle directly, check out the [Flashbots Builder Docs](/flashbots-auction/quick-start#how-to-send-your-first-flashbots-bundle) for instructions on how to do this.

## Fake Funds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ example response:

#### Privacy options

By default, transactions are sent to the Flashbots MEV-Share Node with the default [Stable](/flashbots-protect/mev-share#stable-configuration) configuration. The `privacy` parameter allows you to customize privacy settings:
By default, transactions are sent to the Flashbots MEV-Share Node with the default [Stable](/flashbots-protect/mev-refunds#stable-configuration) configuration. The `privacy` parameter allows you to customize privacy settings:

| Parameter | Type | Description |
| ---------- | ------------ | -------------------------------------------------------------------- |
Expand Down
8 changes: 4 additions & 4 deletions docs/flashbots-protect/gas-fee-refunds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Gas Fee Refunds

Flashbots Protect users are automatically eligible to receive gas fee refunds. If Flashbots can include your transaction on chain for a lower price, you are eligible to receive a refund. This applies to both the RPC and the private transaction API.

Gas fee refunds do not change how transactions are executed and users do not need to make any changes to be eligible for them. Gas fee refunds are calculated separately, and applied in addition to, refunds from [MEV-Share](/flashbots-protect/mev-share).
Gas fee refunds do not change how transactions are executed and users do not need to make any changes to be eligible for them. Gas fee refunds are calculated separately, and applied in addition to, MEV refunds from [MEV-Share](/flashbots-protect/mev-refunds).

## Where do refunds come from

Expand Down Expand Up @@ -34,14 +34,14 @@ The Flashbots block builder does not land 100% of blocks. In order to improve in

There are two ways to share with other builders:
* Use [fast mode](/flashbots-protect/quick-start#faster-transactions) to share with all registered builders
* Choose [specific builders](/flashbots-protect/mev-share#builders) to share transactions with
* Choose [specific builders](/flashbots-protect/settings-guide#builders) to share transactions with

## Who receives refunds

For the RPC: The refund recipient is the address specified in the first [refund parameter](/flashbots-protect/mev-share#refunds) on an RPC request, if one is provided. Otherwise, refunds are sent to the transaction originator (`tx.origin`) by default.
For the RPC: The refund recipient is the address specified in the first [refund parameter](/flashbots-protect/settings-guide#refunds) on an RPC request, if one is provided. Otherwise, refunds are sent to the transaction originator (`tx.origin`) by default.

For the private transaction API: The refund recipient is the signer used on the `eth_sendPrivateTransaction` request.

## 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. Users wil be able to view refund amounts via an upcoming API.
2 changes: 1 addition & 1 deletion docs/flashbots-protect/large-transactions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Large transaction allowlist
title: Large Transaction Allowlist
---

Some projects may need to post larger transactions (measured in bytes) than the transaction pool allows. Flashbots bundles are not subject to the transaction pool size constraints. However, at the RPC level only transactions to certain contracts are allowed to be over 128kb.
Expand Down
50 changes: 50 additions & 0 deletions docs/flashbots-protect/mev-refunds.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: MEV Refunds
---

import ProtectButton from '@site/src/components/ProtectButton';

## Introduction

Flashbots Protect users are automatically eligible to receive MEV refunds from [MEV-Share](/flashbots-mev-share/introduction). If your transaction (eg. a large DEX swap) generates MEV, MEV-Share can help you reclaim a significant portion of this value. The remainder is split with searchers and validators to facilitate transaction inclusion.

By default, all Protect transactions use the [default](/flashbots-protect/settings-guide#default) privacy setting which is continuously optimized by Flashbots to balance efficient execution and protection against harmful MEV. Advanced users can customize their settings when configuring their RPC or by manually editing the query parameters their Protect RPC request.

<ProtectButton />

## Common privacy settings

You can customize how much information is shared about your transactions in MEV-Share. Each piece of information is called a "hint". Sharing more hints can increase refunds, while sharing fewer hints can increase privacy. Below are some common hint choices for different levels of privacy. See the complete [settings page](/flashbots-protect/settings-guide) for a full list of all settings you can apply to your RPC request.

### Default

To use the default privacy settings, you don't need to specify any query parameters.

```url
https://rpc.flashbots.net
```

Currently, this configuration shares the following information:

- The `hash` of all transactions
- `default_logs` Partial logs (the pool id and the fact that a swap was made) for curve, balancer, and uniswapV2/V3-style trades

### Max Privacy

To use Protect with full privacy, set _only_ the `hash` hint in your Protect RPC URL:

```url
https://rpc.flashbots.net?hint=hash
```

This configuration ensures that all identifiable transaction data sent to the MEV-Share Node is concealed from searchers. However, it's important to note that this could make it more challenging for searchers to spot MEV opportunities, leading to a very likely decrease in your MEV refund.

### Max Refund

To use Protect with the maximum refund, set _all_ hints in your Protect RPC URL:

```url
https://rpc.flashbots.net?hint=calldata&hint=contract_address&hint=function_selector&hint=logs
```

This configuration provides searchers with comprehensive details about your transaction, giving them a better chance to identify more MEV opportunities and return MEV refunds.
Loading

0 comments on commit 3422ed7

Please sign in to comment.