# Beyond Multidimensional Fee Markets by Maryam Bahrani | Devcon SEA

- Speakers: [Maryam Bahrani](https://streameth.org/speakers/maryam-bahrani)
- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2025-10-07
- Duration: 25:37
- Watch: https://streameth.org/watch/yt-qf51v48KhH0
- YouTube: https://www.youtube.com/watch?v=qf51v48KhH0

## Description

We study TFMs in the presence of heterogenous transactions and computational nodes. Our first set of results show that multidim fee markets (such as EIP-4844) fail to achieve good guarantees as heterogeneity increases. We complement this result by introducing the Broker Mechanism, which works in the fully heterogenous setting. This mechanism is suitable as a market for sharding computation, delegating computation to off-chain nodes (prover markets and coprocessors), and allocating preconfs.

Speaker(s): Maryam Bahrani
Skill level: Expert
Track: Cryptoeconomics
Keywords: Mechanism design, Economics, Transaction fees mechanisms, market, fee, multidimensional

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum, https://warpcast.com/devcon
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more.

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon SEA was held in Bangkok, Thailand on Nov 12 - Nov 15, 2024.
Devcon is organized and presented by the Ethereum Foundation. To find out more, please visit https://ethereum.foundation/

## Transcript

Hi. [music] Well, thanks for the intro. Sorry for rugging. I've changed the title and the content isn't that different, but this was more exciting. Um, cool. So, um, I'm Mariam. I work with Ritual. Uh, this is based on joint work with Naveen, uh, also at Ritual and Colombia. So, let's get into it. Okay. So one mental model for uh what blockchains do for us is providing this fundamentally new uh primitive uh which is permissionless verifiable computation on a shared global state and this computation is sold in these indivisible units called blocks. So you can think of that as a supply side of this exciting new market. And on the demand side we have users who want to use this comput computation. Um so this is all the apps all the people whose uh happiness and welfare we care about and we want to on board and naturally we need a fair free market to sit between these two sides supply and demand and ideally uh figure out how to allocate supply to demand and how to price things in an efficient way. and everything would be great uh if the picture was just these two sides. But there's a third set of participants in the system called agents or what I will call agents and these are not users or the computation providers. Uh they are facilitators of the market but the role is pretty complicated. They can be useful. They can be adversarial. And I argue they're necessary. And the reason they're necessary is that to get the permissionless verifiable all these like new properties of blockchains, we need decentralization. And that means we need to distribute power to like geographically and across nodes. And that means every part of the blockchain including its fee market might be run by a selfish party with its own objectives. So we need to design markets with um these agents in mind. So this is a nice diagram by Frontier. It shows just how complex the ecosystem of agents involved in block building is. They have specialized they have uh into like little parts of the market and um yeah like have a mixed influence I would say on the quality of um user experience. And I guess this is kind of at the core of what MEV is. Um, these agents have a different set of objectives than the network or users. All right, cool. So, here's a narrative that I think is pretty prevalent and it's that agents are bad and MV is toxic. So, I will just outline the narrative. Um, I think it will be familiar. Um, so these agents have their own objectives. they have outsized control over block production and as a result I guess first let me show you the outsiz control this is I took this maybe an hour ago um the most recent Ethereum blocks are built by two builders um that's not fully decentralized and because of this potential incentive misalignment between agents and users user welfare can suffer and this is a an old tale that has been told many times I'll mention this paper that um we kind of formalized this the the challenges imposed by this incentive misalignment where we show an impossibility of designing any like no matter how clever you are you can't design a good market so that this incentive misalignment doesn't cause issues like user welfare will always suffer okay so in response to the evil agents and bad me people have um taken some approaches to um reduce or mitigate or democratize me where reduction is at the app layer let's make new applications let's use batch auctions um instead of like the amm we use now just to have less me less value available on chain for these block producers to extract um mitigation is things like encrypted me pools suave this This is where you tie the hands of the agents, limit their power so that they don't have that much leeway to extract value. And democratization is kind of throwing your hands in the air and saying this evil is inevitable. It will be there because there is this degree of freedom these agents have. So at least let's try to reduce this negative side effects. Let's make sure we don't get censorship. uh let's make sure that at least the validators validators are decentralized. So I think this is kind of um a lay of the land and what I hope to do here is give some form of a counterbalancing argument. I'm not going to say agents are amazing and there is no me issue, but I'm hoping to argue that agents can be useful and sometimes crucial to use and me is more nuanced than just toxic and evil. And I guess more concretely I will give a framework. I will define this concept of agenticism. And we can give a framework for how to talk about the degree of agenticism in different block production paradigms. And then follow up with a way of reasoning about for a specific application or chain, how do you choose which block production paradigm to use, more agentic or less agentic? Cool. Let's get into definitions. Um, so automated is something I haven't mentioned. I'm using that as the opposite of agentic. So let me define what it means to be uh an automated block building um function or paradigm. You have users they insert transactions into a mempool called m this mempool. Then there is some function that looks at the mempool and generates a block as simple as that. So there is some let's say even deterministic function that goes from the mempool to what the final block will be. The point is there are no agents in this slide at all. No one has power over what goes into the block. So an allocation rule is automated if it takes this format. It's a function of the memp pool. Okay. So a genic block building we have this second category of agents. They also give an input to this allocation rule and their input is abstractly defined here as a vector of actions. They're sophisticated. their actions can be complex and the point is that this function now depends on the actions of the agents. This is very abstract not very useful but the point is that depending on the structure of this function agents can exercise more or less power over the output that is the block. So let me now define what it means to be agentic. It's defined as a relation. We say an allocation rule F is more agentic than an allocation rule G if um I guess maybe the picture is more useful if the set of blocks that agents can generate just the range of blocks that they can generate is a superset of the range of blocks of the less aentic one. So this is saying G is less agentic because if um the agents collude together and range over all possible action vectors the set of blocks that they can generate is limited. It's a smaller set. Good. So that's um and the definition of agentic and automated and naturally there's a spectrum from aentic to automated. So, let's throw some example projects onto this. I will throw some acronyms. Don't worry if you don't recognize them. The hope is that if you do recognize any of them, hopefully it will help you understand how the spectrum works. But it's not important if you don't recognize them. So, at the very gentic end, I've put in Bitcoin and Salana. And why do I what? Let me actually the way the Bitcoin fee market works in case you don't know it's a first price auction transactions submit bids if they're included they pay that bid there is no restriction on what the minor can include in the block say because it's just not restrictive the set of blocks that the minor is able to create is just all valid blocks similarly doesn't have any like the protocol doesn't impose any restrictions on what blocks are valid and Ethereum I think is very close to to the agentic end. Uh it's almost a subtle point why AFP559 is slightly to the right because currently a valid block is not allowed to include a transaction with a bid lower than the base fee. So that is some form of restriction. Maybe a block producer wants to include a maybe like there is me in a transaction. They want to include a transaction and subsidize its bits. That is not allowed right now. So Mev Boost a lot of the block production pipeline in uh Ethereum is very agentic. Get the ME out then figure out how to democratize and distribute it. All right. So I think the shared sequencing marketplaces also like Espresso take a very agentic approach. Um let's outsource this to a market of complex agents and um yeah hope and sequence that way. All right. On the other end of the spectrum, um, automated block building, there's ordering rules that are enforced by a combination of consensus, cryptography, and trusted hardware. So, for example, chain links fair sequencing service. It's a first come first serve service. It's kind of dictating the ordering of transactions. Most L2 sequencers are at this way. Suave Prof are uh use cryptography to encrypt them and pool and then um enforce a specific ordering. These are fairly automated. There isn't that much room for um block production u markets. There isn't that much freedom. Okay, I've put Fossil and RAID in the middle. I think these are somewhat restrictive of what the block producer can do. So in Fossil there is a committee that enforces a template on some fraction of the block and what it can include. In braid the power of any specific proposer is limited. Um so both of these are they there's still a market agents altogether can uh affect the outcome or like the block that is produced but they can't produce any block they want. Cool. So how do we choose the right place on the spectrum for our specific app? And to do that we need to define benchmarks. Uh so what do we care about? These are some properties that people like in fe markets. None of them is new. Low latency is pretty obvious. You want fast turnaround times. Uh tractability. uh this is maybe less often cited as a property that we need but if we have an automated um rule if it's requires solving very complex MP hard problems we can't run that on chain so it is crucial that um the auction itself is computationally tractable to run simple UX is capturing a bunch of things but roughly speaking we don't want users to have to do very complex strategization to participate in the mechanism. Um, and then there are these two points that are addressing efficiency. One of them is surplus maximization. And if you remember the first slide with supply and demand, um, there is gains from trade, the possibility of generating surplus by matching supply and demand effectively. And ideally we want to create the most surplus possible and simultaneously to be efficient we don't want extraction. So users are the people whose uh utility and welfare we care about. Agents are not. So we don't want all of the surplus to go to agents. And if we're not careful with market design, the surplus will go to agents. And I guess let me highlight the fact that the these two are they interact in a subtle way. They're kind of a dual objective both trying to target welfare. And the tension between them is at the core of when you use agentic versus automated block building. And the reason is that sometimes one end of the spectrum is really good at maximizing surplus, but at the same time it will be extractive. So you have to figure out how to trade these two off based on your application. So I have some time left. I will go through two specific DeFi based examples and use them to highlight the trade-offs between the two ends of the spectrum. The first one is front runninging. If you're not familiar, I'll quickly explain what it means. Um there is a user wanting to buy ETH on UNI. This is the current ETH price is 3200 USD USDC and um the user submitted this transaction to a public meool. An agent sees that transaction and puts a sandwiches it with a buy on the left and the sell on the right. And the effect of that is that the first agent transaction drives up the price of eat on uni. Then the user transaction happens at a worse price and then immediately the agent can turn around sell the same amount of ETH basically make $300 of profit at the cost of $300 lost to the user. This is a perfect example of purely extractive me. It's a zero sum game between the user and the agent. This is the kind of MAV we want to get rid of avoid as much as possible. Okay. So should be pretty clear that agents will extract this me. So agentic block building will be bad at this um whereas automated will be pretty good at this. The design principle of profer swave and these improvement pools were exactly to mitigate this. Maybe if we hide the direction and size of the order we will like leak less information and there's less fronting and sandwiching happening. Okay. So the second example is arbitrage between a centralized exchange and a decentralized exchange. Again I'll kind of define it quickly. Um basically you have um you can have an asset pair again EOR and USDC or USD trading on two different exchanges in this case Binance a centralized exchange and unis swap. And so block times are discrete. Uh centralized exchanges are not. They operate continuously with wall clock time. So here the orange line is the price uh on Binance and the red line is the price on uni. Basically the price was as of the previous block 3200. Nothing has happened since because this is the deadline for the next block and there can be a discrepancy a gap between the prices on the two exchanges. So what an agent can do is for example at this point in the slot observe that oh the price is lower on uni higher on Binance I can inject a transaction on chain to buy ETH and sell on Binance and collect a profit very simple and I guess first of all why is this good I'm arguing there is possibility for generating surplus this arbitrageers are providing a service and I guess the reason is the same reason markets being efficient is good right you want the markets can be viewed as an a and a venue for aggregating information and you want prices to be uh reflecting the true value of um assets and so for the health of the market it's good that the price on uni is reflecting the price on Binance and they're all reflecting the overall market sentiment and everyone's information but um at the same time there is possibility for extraction. So this person is making money. Where does the money come from? You can't print it. Uh there are liquidity providers on unis swap and this is coming kind of at the at a cost to them. Uh I won't be able to like fully define this but this is what lever loss versus rebalancing refers to. And I chose this example because it shows the trade-off between the two welfare objectives. Um you yeah like you can't simultaneously satisfy both of them at once. And yeah, there's a tension between them. Okay. And maybe one other observation here is that to successfully run this trade, it's important that this agent knows that they will be the block producer. So remember in this step the selling on Binance I can do at any time. The buying on ETH in the middle of the slot I'm not sure necessarily that I will be able to do this side of the trade and if I can't do it if I'm uncertain about that um there are a lot of costs I will pay. In fact like my this trade is negative EV it's bad for me. So the more uncertainty arbitrageers have about their ability to do both legs of the trade, the less willing they are to do it. They will require higher margins, larger artbounds. Then the price between Union and Binance will deviate more and more. That is less uh accurate pricing. That's less surplus. That's bad. [snorts] Okay. So this observation um I want to highlight and ask you to remember because it will be relevant to the next slide. Um I am short on time. So let me maybe pick a specific point to make. Um okay so let me focus on this point. Um so the claim here is that automated block building will not be able to get surplus maximization and be computationally tractable. And here let's consider a specific way of automating block building based on priority ordering. There's this nice post about why this is a pretty good idea. Um so the the way this works is every transaction comes with a single bid. you order transactions in decreasing order of bits and that that's all it is and the hope is that this will be efficient but as this post also points out this scheme is vulnerable to reversions that the issue is that if coordination has to happen through the mempool instead of by delegating fully to an agent who has full control and knows for certain that they will be in charge of this block and they can for sure do all legs of the trade there is some risk that these people don't know for sure whether their trades will go through. Uh there is some loss efficiency loss because of that. I think I'm about out of time. So let me skip to the conclusion. I've introduced aenticism outlined the spectrum between agentic and automated block building. Roughly speaking automated block building is good with respect to latency. there isn't there aren't a lot of parties that have to communicate uh and also generally it's there's less extraction but they might not be optimal they might not uh generate the most economic value so what's an application where we should opt for automation for if you want na on chain you want low latency you don't want front running you should be more and more automated agents on the other hand are very good for maximizing surplus especially when the user preferences are complex but they will be selfishly trying to extract as much of the surplus as they can and one example of where a aentism is good is um ritual uh but ritual resonance is a marketplace we designed for AI computation the setting is nodes and AI queries all have very complex preferences and there's a because this allocation problem is very hard uh because it's a large complex matching problem. So there's a lot of potential for generating surplus and there isn't that much toxicity or DeFi activity going on. So perfect example for being very agentic and that's the end of the spectrum that we were on and definitely all right thank you for listening my me [laughter] um thanks a lot for that talk super detailed and um and and gets into like nuances and also like the examples were good you can scan the QR code for your questions and let's quickly get to them talking about surplus maximization and decreasing extraction. How do we draw the line between a user and an agent? What determines whether we think of an extracting entity as a user or agent? That's a very very good question. It's exactly the trade-off I was trying to highlight. Um I think it's an art not a science. Um for example in the sex arbitrage example if we want to think of the liquidity providers as users as welfare we care about uh it's a different story than if we just care about the traders and how accurate the price is for them. So I think what happens is for a specific application you um try to decide just draw a boundary that uh includes the people who whose welfare and utility you care about the most and yeah so you draw the line based on uh the purpose of your application. Right. Um the other question will Jared from Subway be out of a job with automated block building? Um no comments. uh uh can you talk about the resources the ritual is selling and what preferences the users might express over them? Yeah, so uh ritual is selling uh AI inference uh basically but it could be different AI models and there are nodes that are very heterogeneous. So they have different resources CPU, GPU, uh bandwidth. Um it's very high dimensional so much so that it didn't make sense to design a specific multi-dimensional feed market. It's just too many dimensions. Um and users have u inferris queries and ritual is providing this or this marketplace to match queries to nodes. Uh and the preferences can be as complicated as a user might have privacy concerns. So it might want uh an MPC containing a set of nodes to run its inference. U a user might have uh latency concerns where I'm patient. I'm willing to wait a while or not. And all of these preferences should be able to be handled. Um why is it bad for automated strategies to give up on surplus maximization? In the frontr running example, the surplus capture appeared to be bad for user welfare. Yes, I would argue in the frontwriting example there was no surplus generated. It was a zero- sum game. Um, it was basically a transfer from the user to uh the agent. So, in many extractive zero sum examples, um it's just not good to have agents. But uh a good example of I guess surplus is maybe in the case of ritual. I described these very heterogeneous um nodes and users and if you write any piece of code to try to match these together, the problem of optimally matching them is just MP hard hard to approximate as well. So doing that on chain will lose out on the efficiency you could get by having a more sophisticated agent find a better allocation. I hope that answered the question. uh seems a very L1 problem. Do L2 solve this by running a centralized sequence? I think it's um not just an L1 problem. I guess like if an L2 runs a centralized sequencer that is committing to a first come first serve ordering, they are choosing a very automated approach, they are potentially missing out on uh complimentarities between transactions or like so yeah I think it's applies to other layers too. And the last question, what sort of support or major changes do you expect from the chain or the foundation? Um, I don't know that this applies to me. Is it Ethereum chain or foundation? Um, yeah. I don't understand.
