# FRP-23: Constant Function Market Making, Social Welfare and Maximal Extractable Value

**URL:** https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752
**Category:** FRPs - Flashbots Research Proposals
**Created:** [November 21, 2022, 11:30am UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752 "2022-11-21T11:30:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nikete](https://collective.flashbots.net/user_avatar/collective.flashbots.net/nikete/32/305_2.png) [@nikete](https://collective.flashbots.net/u/nikete)
#### Post date: [November 21, 2022, 11:30am UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752/1 "2022-11-21T11:30:03Z")

</div>

Bruno and me wrote up some initial results looking at welfare and MEV from CFMMs and would be super happy for feedback [https://arxiv.org/pdf/2211.07220.pdf](https://arxiv.org/pdf/2211.07220.pdf) this is a result partly of [mev-research/ FRP-23.md at main · flashbots/mev-research · GitHub](https://github.com/flashbots/mev-research/blob/main/FRPs/active/%20FRP-23.md)

Would be delighted for feedback and directions from the comunity.

---

<div class="post-metadata">

### Author: ![Quintus](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@Quintus](https://collective.flashbots.net/u/Quintus)
#### Post date: [February 25, 2023, 2:10am UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752/3 "2023-02-25T02:10:42Z")

</div>

Nice!

questions/clarification:

- My understanding of Walrassian Equilibria was that envy-freeness is implied. Does your definition of WE price imply envy freeness?
- What were the parameters of the simulations you ran? How many agents and by what rule did they act/observe price updates?
- To be clear, you are assuming the mechanism in section 4 always finds the Walrassian Allocation and that the only actions available to the validator are censorship and insertion?
- In the setting where there is an external market price vector, is the assumption that users can trade at these prices at other venues?
- How do you think LP fees factor into all of this?
- I didn’t understand your very last example very well. You are showing that in some cases MEV is not minimised at WE in the presence of Walrassian Demands. Could you elaborate a bit more on that?

---

<div class="post-metadata">

### Author: ![nikete](https://collective.flashbots.net/user_avatar/collective.flashbots.net/nikete/32/305_2.png) [@nikete](https://collective.flashbots.net/u/nikete)
#### Post date: [February 26, 2023, 1:56pm UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752/4 "2023-02-26T13:56:33Z")

</div>

> [@Quintus](#):
>
> - My understanding of Walrassian Equilibria was that envy-freeness is implied. Does your definition of WE price imply envy freeness?

Yes.

> [@Quintus](#):
>
> - What were the parameters of the simulations you ran? How many agents and by what rule did they act/observe price updates?

The agents have their utility and their endowments drawn from a uniform over the unit interval, they max their utility to determine their demand and observe the price when it is their turn to trade. The CFMM has initial reserves (900,1111.11), they show steady state behaviour after 25,000 trades.

> [@Quintus](#):
>
> - To be clear, you are assuming the mechanism in section 4 always finds the Walrassian Allocation and that the only actions available to the validator are censorship and insertion?

yes

> [@Quintus](#):
>
> - In the setting where there is an external market price vector, is the assumption that users can trade at these prices at other venues?

Yes, it is stronger assumption than that: that the amount they can trade in the other venues at that price is much bigger than the CFMM amounts.

> [@Quintus](#):
>
> - How do you think LP fees factor into all of this?

They would break the WE prices, so don’t fit quite well in the welfare analysis. They are a hard problem and out of scope for this work I would say.

> [@Quintus](#):
>
> - I didn’t understand your very last example very well. You are showing that in some cases MEV is not minimised at WE in the presence of Walrassian Demands. Could you elaborate a bit more on that?

When there is congestion (more transactions than blockspace to fit them all in) there is some MEV in this formal definition, from the fact that something will get excluded and picking what is valuable.

---

<div class="post-metadata">

### Author: ![Quintus](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@Quintus](https://collective.flashbots.net/u/Quintus)
#### Post date: [February 27, 2023, 3:41pm UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752/5 "2023-02-27T15:41:50Z")

</div>

Great thanks! Would be nice if the paper clarified some of these points 🙂

---

<div class="post-metadata">

### Author: ![BrunoMr](https://collective.flashbots.net/user_avatar/collective.flashbots.net/brunomr/32/122_2.png) [@BrunoMr](https://collective.flashbots.net/u/BrunoMr)
#### Post date: [February 28, 2023, 4:22pm UTC](https://collective.flashbots.net/t/frp-23-constant-function-market-making-social-welfare-and-maximal-extractable-value/752/6 "2023-02-28T16:22:50Z")

</div>

We’re currently in the process of drafting the second version of the paper.
