<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stanley He on Medium]]></title>
        <description><![CDATA[Stories by Stanley He on Medium]]></description>
        <link>https://medium.com/@stanley_he_17?source=rss-e774bd37a457------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2-dh5ZX03TCs2WRybbuWSw.png</url>
            <title>Stories by Stanley He on Medium</title>
            <link>https://medium.com/@stanley_he_17?source=rss-e774bd37a457------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 11:22:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stanley_he_17/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[IL, LVR and Optionality: Do AMMs Have a Future?]]></title>
            <link>https://medium.com/metaweb-vc/il-lvr-and-optionality-do-amms-have-a-future-1c58f4945925?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c58f4945925</guid>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 15:39:53 GMT</pubDate>
            <atom:updated>2023-11-26T15:43:14.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*nO7lIJ6T0wBQhIea.jpg" /></figure><p>Automated Market Maker (AMM) is the very bedrock of all DeFi. Ever since Bancor and Uniswap v2 popularized the x<em>y=k bonding curve, Constant Function MM (CFMM) has become almost everyone’s first experience with DeFi and crypto. Many other CFMM bonding curves have been invented after, but at the core they still share the same properties of the good old x</em>y=k: path-independence, always-on liquidity, selling and buying tokens automatically and <strong>passively</strong>, etc. And those who provide liquidity to those AMMs share a glorious name: Liquidity Provider (LP).</p><p>LPs know from day one that they have an enemy: <a href="https://pintail.medium.com/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2">Impermanent Loss</a> (IL). The art of LPing is to earn more (farming rewards &amp; trading fees) than what you lose to IL. And degens have been fine with it. However, things started to change when bear market kicked in, bringing yield down, and new AMMs like Uniswap v3 paved the way for professional market makers and high-frequency-traders (HFT) to enter DeFi. Retail LPs are increasingly likely to lose money. And finally, the gigabrain works by <a href="https://x.com/thiccythot_/status/1589022227437039616?s=46&amp;t=bHElRrUhBCqfMOrITtv_EA">thiccy</a>, the <a href="https://crocswap.medium.com/usage-of-markout-to-calculate-lp-profitability-in-uniswap-v3-e32773b1a88e">Crocswap team</a>, and <a href="https://arxiv.org/pdf/2208.06046.pdf">Anthony Lee Zhang</a> show us that LPs are losing money not because they are bad traders, but because there’s something fundamentally BROKEN in the current AMM design. Meanwhile, orderbooks are thriving on-and-off-chain. Hence we have to ask: <strong>Do AMMs still have a future?</strong></p><h3>1. IL is the past. LVR is the new inevitability</h3><p>IL compares the performance of a CFMM LP position to a portfolio which holds the LP’s initial bundle of assets (ignoring fees). For example, an LP provided 1 ETH and 1000 USDC to ETH-USDC Uni v2 pool when ETH price was $1000. If later ETH price increases to $2000, the LP will be holding ~0.7 ETH and ~1414 USDC, worth a total of $2828. If the LP simply held 1 ETH and 1000 USDC in his wallet, he would still have the same assets which would be worth $3000. The $172 difference here is IL.</p><p>IL is caused by the fact that the CFMM <strong>sells asset when price goes up, and buys asset when price goes down</strong>. In our example, ETH price goes up, and the CFMM sells ETH along the way, resulting in a loss compared to holding the initial assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qD-fFwcnHO7wgRdopWkW8g.png" /><figcaption>Impermanent Loss visualized in <a href="https://pintail.medium.com/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2">Pintail’s original post</a></figcaption></figure><p>Some may ask, ‘why does the CFMM work like this? Why doesn’t it buy asset when price goes up’? The answer is <strong>passiveness:</strong> liquidity on the CFMM isn’t actively managed like on an orderbook, instead it only passively reacts to trades. When market price changes, the AMM needs to give traders a reason to trade on it and bring the AMM price in line with the market price. This reason is IL — LPs suffer from it, but traders who arbitrage the CFMM price and the market price benefit from it.</p><p>LPs do have another hope: price reversion. A nice property of CFMM is that no matter how price has changed during a period of time, as long as it goes back to the same point when the LP entered, the LP will be holding the same bundle of assets. In other words, IL equals zero.</p><p>However, new studies show that even when price reverts, LPs are still losing money. Moreover, IL isn’t the sole truth. A new benchmark is created to reveal the inherent value leakage in CFMM.</p><h3>1.1 Loss-Versus-Rebalancing, the true passiveness cost</h3><p>The benchmark used when calculating IL is HODL strategy: you simply hold the original assets. The problem, or feature, of this benchmark is that it mostly consists of <strong>price risk</strong>. In our example, the LP incurs a loss because he now has less ETH than HODL strategy when ETH price goes up. What if we isolate the price risk away, i.e., benchmarking LP profitability to a strategy that always has the same amount of risky asset as the LP? By doing so, we get Loss-Versus-Rebalancing (LVR).</p><p>LVR uses “rebalancing strategy” as benchmark. The rebalancing strategy replicates the CFMM’s trades by dynamically trading the underlying asset at market prices. In reality it looks like this: Whenever a trade is done on the CFMM, i.e. a trader swaps 1000 USDC for 1 ETH, a trade with same amount of the risky asset (ETH) happens on Binance (assuming Binance price is the market price, zero fee and infinite liquidity), i.e., selling 1 ETH for USDC. In this way, the rebalancing strategy will always have the same amount of risky asset as the CFMM LP, thus eliminating the price risk that’s present in the HODL strategy.</p><p>So are LPs losing money compared to rebalancing strategy? Yes they are. LVR is non-negative. The loss comes from price slippage: when price on Binance changes, the price on the CFMM stays stale, therefore making it profitable for arbitragers to trade against. Let’s say at t0, price of ETH on both Binance and the CFMM is $900; at t1, price on Binance increases to $1000, while on the CFMM it stays at $900. Now a trader can buy ETH at the CFMM at a price lower than $1000 and sell ETH at Binance for profit. From LPs’ perspective, they are selling a tiny amount of ETH at every price between $900 and $1000, until price on the CFMM reaches $1000. Compared to the rebalancing strategy, which simply sells ETH at $1000, CFMM LPs take a loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pY-MFnsI6Z4bwPrmSQ47eg.png" /><figcaption>Loss-Versus-Rebalancing visualized in the <a href="https://arxiv.org/pdf/2208.06046.pdf">original paper</a></figcaption></figure><p>Compared to IL, LVR is the true “passiveness cost” (or is it? We will get back to it later): even with the impact from price variation eliminated, LPs still lose money because their liquidity passively sits in the pool, without being adjusted according to market price movement. Therefore, <strong>LPs are always executing trades at worse-than-market price</strong>. In market makers’ terms, CFMM LPs are constantly “sniped” or “picked-off”.</p><p>Note that even price reversion cannot solve LVR. In the case of price reversion, CFMM LP breaks even, but the rebalancing strategy makes a profit.</p><p>Multiple empirical analyses have been done and shown that LVR is real. This <a href="https://crocswap.medium.com/usage-of-markout-to-calculate-lp-profitability-in-uniswap-v3-e32773b1a88e">conclusive piece</a> of markout analysis of Uni LPs demonstrated LVR in real life by marking out every trade on Uniswap v2 ETH-USDC pairs using Binance price, and the result is as pessimistic as the theory predicts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBFmm6ImQQRq7xtU0saP8Q.png" /><figcaption><em>Shout out to 0xfbifemboy. A name that will be missed</em></figcaption></figure><p>We can see that Uni v2 LPs of the ETH-USDC pairs, in aggregate, have been strictly losing money compared to the rebalancing strategy. And those who LP for the lowest fee tier (0.05%) are down BAD.</p><h3>1.2 Orderflow toxicity: Understand LVR from a different (an easier) perspective</h3><p>In general, there are two types of orderflows faced by market makers/liquidity providers. Uninformed flow refers to orders initiated by traders who <strong>don’t have</strong> better information on price than MMs. Those orders drive the organic price movement of assets, and are welcomed by MMs because they are usually profitable to make. Informed flow, or toxic flow, refers to orders initiated by traders who have better information on price than MMs. Arbitrage is one example, where traders have better information on price than MMs (price on market A is higher than price on market B), and make profit by buying low on market B, selling high on market A. In this case, MMs on both market A and market B take a loss. In tradfi, MMs try very hard to differentiate between informed and uninformed flow, and discriminate them by offering different spreads.</p><p>CFMM LPs are faced with both uninformed and toxic flows too. Arbitragers who bring the price on the CFMM in line with Binance are toxic flow, and incurring loss to LPs, as shown above. At the same time, on-chain naive users contribute uninformed flow — when I swapped ETH for PEPE, I obviously wasn’t arbitraging (Jaredfromsubway was), but simply just looking for a 100x. Uninformed flow doesn’t know the true price, thus could contribute gains to the MMs/LPs.</p><p>When we look at the rebalancing strategy, the benchmark for LVR, from orderflow toxicity angle, then what it is doing is very clear:</p><p><strong>The rebalancing strategy filters out both gains from uninformed flow and losses from toxic flow</strong>.</p><p>Since all trades are executed at the true market price, orderflow toxicity, both positive and negative, is completely eliminated. With the rebalancing strategy, MMs earn/lose zero from “making markets”, instead their PnL is solely from delta (the price change of the risky asset in the portfolio).</p><p>Based on this understanding, a questions emerges: Why is LVR strictly positive? Or why are LPs always losing (before fees) against rebalancing? The rebalancing strategy eliminates losses from toxic flow, but also gives up gains from uninformed flow! Wouldn’t there be a case where the <strong>gains outweigh the losses</strong>, and LPs make higher return (before fees) than rebalancing?</p><p>Short answer is NO.</p><p>The reality is, CFMM LPs <strong>never get to bag the profit made from uninformed flow</strong>, instead, almost all of it is leaked to validators and searchers in the form of MEV. For example, suppose the current price on the CFMM was the same with the price on Binance, say 1 ETH = 1000 USDC. An uninformed DeFi user decided to hold more ETH on-chain, thus swapped 120,000 USDC for 100 ETH from the CFMM, or bought 100 ETH at a price of 1 ETH = 1200 USDC, significantly higher than the true market price on Binance. Right after this swap, the CFMM LPs recorded a 20,000 USDC unrealized profit, which could be realized if all liquidity was immediately withdrawn from the pool. However, this unrealized profit is ephemeral. In most cases, a “backrun” transaction by a searcher will follow right after this naive transaction from the poor DeFi user, selling 100 ETH for ~120,000 USDC, fully stripping the unrealized profit away from LPs, leaving them with only a small transaction fee. MEV, here we go again.</p><p>So from orderflow perspective, what’s happening is clear:</p><p><strong>LPs LOSE most of the gains from uninformed flow to MEV, but FULLY BEAR the losses from informed flow.</strong></p><p>It’s not a fair play.</p><h3>2. Optionality: It’s a thing, but not everything</h3><p>Thanks to <a href="https://lambert-guillaume.medium.com/uniswap-v3-lp-tokens-as-perpetual-put-and-call-options-5b66219db827">Professor Lambert’s</a> relentless effort, it’s already common knowledge that providing single-tick liquidity at Uni v3 has a payoff identical to selling a put option. LP = Short put.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*mEJTqZy2T5GTpL9D8LAo7A.png" /><figcaption><em>Visualization of the parity between a single-tick LP position on Uni v3 and a covered call or short cash-secured put. Source: </em><a href="https://paper.panoptic.xyz/"><em>Panoptic whitepaper</em></a></figcaption></figure><p>Since LPs are now option sellers, they are short volatility, meaning they want to sell volatility for a high price without actually losing money to option buyers, which is a bet on volatility ends up low. With option terminologies, the ideal scenario for option sellers is to sell option when implied volatility (IV) is high and the realized volatility (RV) ends up lowers than IV when the option expires. IV &gt; RV, option sellers win. Translated into AMM LPing language, it basically says LPs want to start to LP when a pool has low liquidity and high volume (which means high IV), and exit the position before volume/liquidity ratio becomes too low or the price deviates too much from the entry point (which means IV is now much more likely to be smaller than RV)</p><p>What’s magical is that, when looking at LPing from option perspective, everything we’ve discussed so far (IL, LVR, toxic flow…) seems to become irrelevant! IL isn’t “loss” anymore — you just unfortunately betted on the wrong side, and RV ended up bigger than IV. LVR isn’t loss either — it is the <strong>sole value</strong> that LPs provide to traders (the commitment to buy/sell assets at a pre-determined price), and traders buy it with fees. So LPs just need to make sure LVR &lt; fees, again just like option sellers. Toxic flow becomes orthogonal to the question — as long as it contributes trading fees, why should I care about whether a trade is “toxic” or not?</p><p>Panoptic Finance is founded on those insights, enabling borrowing and lending of Uni v3 positions to help more sophisticated option traders to write options via AMM more efficiently. And normies can just deposit their money into a lending pool to provide liquidity for the professionals, earning a more stable interest rate.</p><p>Problem solved….right?</p><h3>2.1 Why option premium ≠ AMM trading fee</h3><p>Buying options in Panoptic is essentially “borrowing” an LP position and then selling it, thus there’s the problem of option pricing — how much should the buyer pay as premium? The parity between Uni v3 LP position and short option makes it surprisingly easy: the buyer just pays the trading fee that <strong>would’ve been earned</strong> by the LP position if it wasn’t borrowed. More intuitively, since 1) option sellers only earn option premium for selling option, and 2) LPs only earn trading fees for providing liquidity, and 3) selling option = providing liquidity, thus 4) option premium = trading fee. Indeed, option premia is called “streamia” in Panoptic and <a href="https://paper.panoptic.xyz/">research</a> does suggest that streamia converges to the result from Black-Scholes Model (the one people use to price options) on an equivalent traditional option.</p><p>A recap on what we’ve discovered so far:</p><ol><li>CFMM LPs are losing money.</li><li>The loss arises from passiveness, embodied by LVR.</li><li>From option perspective, LVR is <strong>in itself the good being sold</strong>, and LPs are already fairly compensated by trading fees.</li></ol><p>This seems to suggest that no much improvement is needed for AMMs, and LPs should just accept the reality.</p><p>Is this the case though?</p><p>Let’s do a simple thought experiment: what if we auction off the right to arbitrage a CFMM pool, and give the proceed to LPs? Leave implementation details aside, this would strictly improve LP’s payoff — from orderflow toxcity perspective, it would reduce the amount of toxic flow (thus the loss), and direct part of the gains from uninformed flow to the LPs. If an LP from such a pool lends his position to an option buyer, he would obviously charge for higher premium, since LP position would have been earning a higher return than in a vanilla AMM. So now we have to price option differently, simply because the LP is earning more? Do we have to rewrite Blach-Scholes Model to fit the new result?</p><p>The answer is obviously no. And to see what there’s a discrepancy, we have to realize that although AMM LPs are indeed providing optionality, it’s not the ONLY thing they provide. The “options” sold by LPs are almost entirely consumed by arbitrageurs who already knew they are going to make a profit even before entering the trade — that’s the definition of an arbitrage and toxic flow. In other words, those “options” will only be bought in cases where LPs lose money. Yes arbitrageurs pay fees, but only when net profit is positive. Since arbs make up most of the volume on-chain right now, it’s not surprising that trading fees (that are mainly contributed by arbs) converge to option premium (that’s supposed to be paid by option buyers, again arbers) calculated by BSM.</p><p>However, that’s only part of the story — uninformed flow isn’t buying options! When those naive or degen on-chain swappers make swaps in a CFMM pool, they certainly don’t have “optionality” in their heads. Instead they just need some <strong>liquidity</strong> which allows them to get another asset, and are willing to pay for the service. Although their volume is no comparison to arbs, it is suppose to bring real gains to LPs, but fails to be captured by the option perspective.</p><p>So to sum it up, LPs are selling options AND liquidity, therefore option pricing isn’t sufficient when it comes to evaluating whether CFMM LPs are receiving fair payout.</p><p>LPs are losing money.</p><h3>3. Passive liquidity and the MEV supply chain</h3><p>CFMM design has entered a dead end, especially for passive liquidity providers. Uni v3 type of concentrated liquidity AMM is very similar to orderbooks, which requires active management, basically forcing LPs to become professional market makers. Automated strategies on top of concentrated liquidity AMM (i.e., <a href="https://www.mav.xyz/">Maverick</a>) only work for pegged assets (like USDT-USDC), and you can still lose money from rebalancing, since every rebalance turns impermanent loss permanent. There are blackbox market making vaults like <a href="https://hyperliquid.xyz/">Hyperliquid</a> and <a href="https://elixir.finance/">Elixir</a> that basically work on a “trust me bro” model, taking users deposits and make markets on orderbooks. Also there are more oracle-based DEXes that give up price discovery to Binance, making people question why the need to build a “dex” in the first place. AMMs are losing. Just look at how many protocols have given up on AMM or virtual AMM and turned to orderbooks/RFQ (this happens more significantly with derivative protocols, like Drift, Perpetual, Lyra, etc.).</p><p>If passiveness means taking loss, the future will be dim for on-chain liquidity. But at least we now know that LVR is NOT the necessary passiveness cost, because if it was, then there shouldn’t be a way to reduce it. But our thought experiment shows that it is possible to do so with a change in market structure.</p><p>On the high level, the way to make passive liquidity provision more profitable is likely outside the CFMM design space, instead lies in MEV. You know who’s also passive? Validators. And who’s getting the most out of MEV (or the totally extractable value created on a blockchain)? Validators. PBS (Proposer-Builder Separation) has freed validators from <em>actively</em> building blocks and still manages to direct most of the value towards them with competitive auctions. Why can’t the same scenario happen to LPs?</p><p>The thought experiment of auctioning off the right to arbitrage a CFMM pool isn’t my invention. MEV capturing AMM (McAMM) was first <a href="https://ethresear.ch/t/mev-capturing-amm-mcamm/13336">proposed</a> last year and is seeing increasing interest from the community. I believe we are very close to the first working instantiation of McAMM. The questions are mostly on the execution side: How do we conduct the auction? Is it going to add another centralized layer (just like MEVBoost for PBS) to our already quite centralized MEV supply chain? Is it possible to do it on-chain? If so will the auction itself create more MEV leakage? How to fairly return the captured MEV to LPs?</p><p>From MEV perspective, CFMM LP profitability is part of a bigger problem: How do we ensure fair representation of value created by different participants in crypto? IMO Cosmos has by far the best answer: <a href="https://docs.cometbft.com/v0.37/spec/abci/">ABCI++</a>, the interface between application layer and consensus layer that empowers more participants (dapps, users, DAOs) to have a say in how consensus should work and how transactions should be ordered. In Ethereum we have <a href="https://ethresear.ch/t/unbundling-pbs-towards-protocol-enforced-proposer-commitments-pepc/13879">PEPC</a>, a more generic framework that allows proposers (validators) to enter binding commitments outside Ethereum consensus. Both designs would theoretically allow a more equitable MEV distribution since LPs would be able to express their preferences even if they stay passive when providing liquidity. McAMM, or other designs with similar principles, could then be built in a decentralized way.</p><p>So do AMMs have a future? The answer is yes, but we need to move fast. Passive liquidity providers are the backbone of DeFi, and they may leave if they don’t get rewarded fairly for value they created.</p><p>Thanks to <a href="https://lambert-guillaume.medium.com/uniswap-v3-lp-tokens-as-perpetual-put-and-call-options-5b66219db827">Professor Lambert’s</a> relentless effort, it’s already common knowledge that providing single-tick liquidity at Uni v3 has a payoff identical to selling a put option. LP = Short put.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*mEJTqZy2T5GTpL9D8LAo7A.png" /></figure><p>Since LPs are now option sellers, they are short volatility, meaning they want to sell volatility for a high price without actually losing money to option buyers, which is a bet on volatility ends up low. With option terminologies, the ideal scenario for option sellers is to sell option when implied volatility (IV) is high and the realized volatility (RV) ends up lowers than IV when the option expires. IV &gt; RV, option sellers win. Translated into AMM LPing language, it basically says LPs want to start to LP when a pool has low liquidity and high volume (which means high IV), and exit the position before volume/liquidity ratio becomes too low or the price deviates too much from the entry point (which means IV is now much more likely to be smaller than RV)</p><p>What’s magical is that, when looking at LPing from option perspective, everything we’ve discussed so far (IL, LVR, toxic flow…) seems to become irrelevant! IL isn’t “loss” anymore — you just unfortunately betted on the wrong side, and RV ended up bigger than IV. LVR isn’t loss either — it is the <strong>sole value</strong> that LPs provide to traders (the commitment to buy/sell assets at a pre-determined price), and traders buy it with fees. So LPs just need to make sure LVR &lt; fees, again just like option sellers. Toxic flow becomes orthogonal to the question — as long as it contributes trading fees, why should I care about whether a trade is “toxic” or not?</p><p>Panoptic Finance is founded on those insights, enabling borrowing and lending of Uni v3 positions to help more sophisticated option traders to write options via AMM more efficiently. And normies can just deposit their money into a lending pool to provide liquidity for the professionals, earning a more stable interest rate.</p><p>Problem solved….right?</p><h3>2.1 Why option premium ≠ AMM trading fee</h3><p>Buying options in Panoptic is essentially “borrowing” an LP position and then selling it, thus there’s the problem of option pricing — how much should the buyer pay as premium? The parity between Uni v3 LP position and short option makes it surprisingly easy: the buyer just pays the trading fee that <strong>would’ve been earned</strong> by the LP position if it wasn’t borrowed. More intuitively, since 1) option sellers only earn option premium for selling option, and 2) LPs only earn trading fees for providing liquidity, and 3) selling option = providing liquidity, thus 4) option premium = trading fee. Indeed, option premia is called “streamia” in Panoptic and <a href="https://paper.panoptic.xyz/">research</a> does suggest that streamia converges to the result from Black-Scholes Model (the one people use to price options) on an equivalent traditional option.</p><p>A recap on what we’ve discovered so far:</p><ol><li>CFMM LPs are losing money.</li><li>The loss arises from passiveness, embodied by LVR.</li><li>From option perspective, LVR is <strong>in itself the good being sold</strong>, and LPs are already fairly compensated by trading fees.</li></ol><p>This seems to suggest that no much improvement is needed for AMMs, and LPs should just accept the reality.</p><p>Is this the case though?</p><p>Let’s do a simple thought experiment: what if we auction off the right to arbitrage a CFMM pool, and give the proceed to LPs? Leave implementation details aside, this would strictly improve LP’s payoff — from orderflow toxcity perspective, it would reduce the amount of toxic flow (thus the loss), and direct part of the gains from uninformed flow to the LPs. If an LP from such a pool lends his position to an option buyer, he would obviously charge for higher premium, since LP position would have been earning a higher return than in a vanilla AMM. So now we have to price option differently, simply because the LP is earning more? Do we have to rewrite Blach-Scholes Model to fit the new result?</p><p>The answer is obviously no. And to see what there’s a discrepancy, we have to realize that although AMM LPs are indeed providing optionality, it’s not the ONLY thing they provide. The “options” sold by LPs are almost entirely consumed by arbitrageurs who already knew they are going to make a profit even before entering the trade — that’s the definition of an arbitrage and toxic flow. In other words, those “options” will only be bought in cases where LPs lose money. Yes arbitrageurs pay fees, but only when net profit is positive. Since arbs make up most of the volume on-chain right now, it’s not surprising that trading fees (that are mainly contributed by arbs) converge to option premium (that’s supposed to be paid by option buyers, again arbers) calculated by BSM.</p><p>However, that’s only part of the story — uninformed flow isn’t buying options! When those naive or degen on-chain swappers make swaps in a CFMM pool, they certainly don’t have “optionality” in their heads. Instead they just need some <strong>liquidity</strong> which allows them to get another asset, and are willing to pay for the service. Although their volume is no comparison to arbs, it is suppose to bring real gains to LPs, but fails to be captured by the option perspective.</p><p>So to sum it up, LPs are selling options AND liquidity, therefore option pricing isn’t sufficient when it comes to evaluating whether CFMM LPs are receiving fair payout.</p><p>LPs are losing money.</p><h3>3. Passive liquidity and the MEV supply chain</h3><p>CFMM design has entered a dead end, especially for passive liquidity providers. Uni v3 type of concentrated liquidity AMM is very similar to orderbooks, which requires active management, basically forcing LPs to become professional market makers. Automated strategies on top of concentrated liquidity AMM (i.e., <a href="https://www.mav.xyz/">Maverick</a>) only work for pegged assets (like USDT-USDC), and you can still lose money from rebalancing, since every rebalance turns impermanent loss permanent. There are blackbox market making vaults like <a href="https://hyperliquid.xyz/">Hyperliquid</a> and <a href="https://elixir.finance/">Elixir</a> that basically work on a “trust me bro” model, taking users deposits and make markets on orderbooks. Also there are more oracle-based DEXes that give up price discovery to Binance, making people question why the need to build a “dex” in the first place. AMMs are losing. Just look at how many protocols have given up on AMM or virtual AMM and turned to orderbooks/RFQ (this happens more significantly with derivative protocols, like Drift, Perpetual, Lyra, etc.).</p><p>If passiveness means taking loss, the future will be dim for on-chain liquidity. But at least we now know that LVR is NOT the necessary passiveness cost, because if it was, then there shouldn’t be a way to reduce it. But our thought experiment shows that it is possible to do so with a change in market structure.</p><p>On the high level, the way to make passive liquidity provision more profitable is likely outside the CFMM design space, instead lies in MEV. You know who’s also passive? Validators. And who’s getting the most out of MEV (or the totally extractable value created on a blockchain)? Validators. PBS (Proposer-Builder Separation) has freed validators from <em>actively</em> building blocks and still manages to direct most of the value towards them with competitive auctions. Why can’t the same scenario happen to LPs?</p><p>The thought experiment of auctioning off the right to arbitrage a CFMM pool isn’t my invention. MEV capturing AMM (McAMM) was first <a href="https://ethresear.ch/t/mev-capturing-amm-mcamm/13336">proposed</a> last year and is seeing increasing interest from the community. I believe we are very close to the first working instantiation of McAMM. The questions are mostly on the execution side: How do we conduct the auction? Is it going to add another centralized layer (just like MEVBoost for PBS) to our already quite centralized MEV supply chain? Is it possible to do it on-chain? If so will the auction itself create more MEV leakage? How to fairly return the captured MEV to LPs?</p><p>From MEV perspective, CFMM LP profitability is part of a bigger problem: How do we ensure fair representation of value created by different participants in crypto? IMO Cosmos has by far the best answer: <a href="https://docs.cometbft.com/v0.37/spec/abci/">ABCI++</a>, the interface between application layer and consensus layer that empowers more participants (dapps, users, DAOs) to have a say in how consensus should work and how transactions should be ordered. In Ethereum we have <a href="https://ethresear.ch/t/unbundling-pbs-towards-protocol-enforced-proposer-commitments-pepc/13879">PEPC</a>, a more generic framework that allows proposers (validators) to enter binding commitments outside Ethereum consensus. Both designs would theoretically allow a more equitable MEV distribution since LPs would be able to express their preferences even if they stay passive when providing liquidity. McAMM, or other designs with similar principles, could then be built in a decentralized way.</p><p>So do AMMs have a future? The answer is yes, but we need to move fast. Passive liquidity providers are the backbone of DeFi, and they may leave if they don’t get rewarded fairly for value they created.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c58f4945925" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/il-lvr-and-optionality-do-amms-have-a-future-1c58f4945925">IL, LVR and Optionality: Do AMMs Have a Future?</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Abstraction and SUAVE: How far are we from an Intent-Centric Ethereum?]]></title>
            <link>https://medium.com/metaweb-vc/account-abstraction-and-suave-how-far-are-we-from-an-intent-centric-ethereum-907e30804880?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/907e30804880</guid>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 03:18:30 GMT</pubDate>
            <atom:updated>2023-06-08T03:18:30.737Z</atom:updated>
            <content:encoded><![CDATA[<p>“Intent” recently has become the center of Ethereum nerdy discussion, and dots are gradually being connected (Account Abstraction, SUAVE, order flow auction, etc.). This article will discuss how we can possibly complete the transition from “transaction-based interaction” to “intent-based interaction” and what unexpected outcomes could happen halfway that may thoroughly change the form of MEV.</p><h3>Intents are already here</h3><p>It’s unfair to talk about “intents” w/o mentioning <a href="https://anoma.net/">Anoma</a>. They have been building from ground up a blockchain architecture that’s natively intent-centric. So what are intents? This article is thankfully frontrun by <a href="https://www.paradigm.xyz/2023/06/intents">Paradigm</a>, so that I can borrow their definition:</p><blockquote><em>“an intent is a signed set of declarative constraints which allow a user to outsource transaction creation to a third party without relinquishing full control to the transacting party”</em></blockquote><p>Let’s look at a real world example. Alice has 10,000 USDT on Ethereum, and with this money she wants to acquire as many GLP as possible, which is on Arbitrum. Today, Alice needs to first bridge her fund from Ethereum to Arbitrum, which requires optimally choosing a bridge. Luckily this can be done with a bridge aggregator like <a href="https://www.bungee.exchange/">Bungee</a>. After bridging USDT to Arbitrum, Alice now needs to decide which asset she uses to buy GLP — since GMX imposes dynamic fees to different assets when buying GLP to balance the pool, which means if the fees on USDT is too high, it may be profitable for Alice to swap USDT to another asset (i.e., ETH) and use ETH to buy GLP. To make the decision, Alice needs to compare the fee difference on GMX and transaction slippage between multiple assets. That’s a lot of work to do, and her calculation result may become obsolete when she signs the transaction — rates, prices and slippage change all the time.</p><p>With intents, the process would look totally different. Alice only needs to express her intent “I want to acquire as many GLPs as possible, at minimum 100,000, with 10,000 USDT on Ethereum” and an intent solver will do all the calculation and transaction for her, giving her only the end result: GLPs on Arbitrum.</p><p><strong>In short, transaction = you specify HOW to do; intent = you specify WHAT you want, but don’t care how to achieve it.</strong></p><p>Indeed, we are expressing intents right now on Ethereum already. Every swap using a DEX aggregator like 1inch is an intent: you only specify input amount and slippage tolerance, and let the routing contract find you the best routes. We call them “<strong>simple intents</strong>”. There’s also something I call “<strong>searcher intents</strong>”, as in searchers’ preferences on the ordering of transactions, in a Flashbots auction. This is important when we later dig into the implementation of intents. And then there’s “<strong>arbitrary intents</strong>”, as in users can express arbitrary intents and get them done.</p><h3>A UX revolution</h3><p>Blockchains have long been blamed for bad user experience, and many people deem UX as one of the major hurdles to the mass adoption of web3. Now that we have intents, an interaction paradigm that could make blockchain UX not only on par, but actually better than that of web2 today. Under current web2 setup, users with an end goal are still required to have knowledge of the paths, i.e., you need to know which app to use if you want to buy stocks/items/food… But intents enable to achieve end goals w/o knowledge of the paths. Native composability of blockchain dapps further makes this model scalable v.s. siloed web2 apps.</p><h3>The Intent Layer</h3><p>The vision sounds good, but we first need an intent layer where users express their intents and solvers compete to solve them. Anoma and <a href="https://collective.flashbots.net/t/the-future-of-mev-is-suave/762">SUAVE</a>, Flashbots’ endgame for intents, are both trying to be THE intent layer for blockchains, while using quite different methodologies. It’s too early to compare them (nobody knows what an intent layer should look like yet), but one thing is for sure: building an intent layer is HARD. Many of its design principles actually contradict with each other, and it’s shown on SUAVE’s blueprint:</p><p><strong>1. Credible commitment &amp; Decentralization</strong></p><p>A simple p2p network for intents (i.e., an “intent mempool”) is less likely to work, because it cannot guarantee both users and solvers’ commitment to the intent — for example, we need to make sure that a user will pay the amount she promises once her intent is solved, and a solver must follow the constraints set by users. A centralized solution could work, but of course we want a decentralized one, which leaves us only one option: a blockchain. Yes, that’s why SUAVE is itself a blockchain.</p><p><strong>2. Privacy</strong></p><p>We want solvers to provide the best execution for user intents, which requires as much information as possible; but at the same time don’t want malicious actors to exploit them, which entails at least some of the intents’ information to be concealed. Two problems are present: First, it is technically hard to make computable information private on a blockchain. Options are limited: TEE, ZKP, MPC. None of them is perfect, and Flashbots proposes to use SGX, Intel’s TEE, which has already drawn some critics on safety (and elegancy, compared to cryptographic solutions). Second, it’s unclear if there will ever exist a “right balance” of privacy. Flashbots’ latest product <a href="https://collective.flashbots.net/t/mev-share-programmably-private-orderflow-to-share-mev-with-users/1264">MEV-Share</a>, or “ proto-SUAVE”, enables partial disclosure of transaction data from users to searchers. Whether that will actually make both users and searchers better off is yet to be seen: a backrun is only optimized if the searcher knows exactly the size and slippage of a swap, while zero information leakage makes it impossible to extract any value. Anything in between will reduce the maximum possible surplus.</p><p><strong>3. Intent language/Protocol</strong></p><p>Users also need a language to express intents. We want that language to be expressive enough for arbitrary intents, and that’s why SUAVE will use EVM/Solidity — it’s Turing Complete. But we also need a protocol that standardizes intents, and maybe limits the language, for two reasons: First, unlimitedly expressive intents are likely unsolvable, or unverifiable on-chain. Second, expressivity enables vague intents, vague intents generate more MEV, which we want to minimize. Another difficult balance to strike.</p><p><strong>4. Cross-chain settlement &amp; oracle</strong></p><p>Since SUAVE is a standalone blockchain, for it to deal with intents from external domains (i.e., Ethereum), cross-chain settlement is involved. Ethereum users must deposit funds on SUAVE and commit to unlock them if their intents are solved. And for smart contracts on SUAVE to verify that, oracles are needed. Therefore, SUAVE will face every problem we have today with cross-chain bridges: security, speed, UX, trust assumptions, etc.</p><p>To recap: We want to use a blockchain to decentralize the intent layer, which introduces cross-chain settlement problem; we want to give more value back to users, which could also lead to more exploitation; we want users to express as they will, but also need to make sure what they expressed are solvable.</p><h3>Intent Layer needs Account Abstraction</h3><p>Account Abstraction is often reduced to “gasless transaction”, “seedless recovery”, and maybe “rate limit”. Yes, those are cool, but not cool enough. The coolest thing about AA lies in its architecture, making wallets the entry of intent.</p><p>Short recap on AA:</p><p>There are two types of addresses on Ethereum: smart contracts and external-owned accounts (EOA). EOAs can initiate transactions, but smart contracts can’t. Therefore most Ethereum wallets we use today are EOAs. There are smart contract wallets (SCW) like Gnosis Safe, but since a smart contract can’t initiate transactions, you need EOA(s) to prompt the SCW. SCW is good: as a smart contract, a wallet can execute arbitrary logics, opening up countless new applications to wallets, while EOAs can only sign transactions.</p><p>To enable users to use SCWs w/o needing a separate EOA, <a href="https://www.alchemy.com//blog/account-abstraction">EIP-4337</a> introduces a new transaction type called User Operation, and a new role called Bundlers. After EIP-4337, users flow of SCWs becomes:</p><p>Users send UserOps (indicating actions they want wallets to do) to the UserOp mempool — → Bundlers validate and “bundle” UserOps together, execute them (sign, pay gas fee), send the transaction to the EntryPoint contract — → the EntryPoint contract pass transactions to SCWs, prompting the SCWs to do what users asked — → Bundlers get gas fee refund from EntryPoint contract (we will skip PayMaster for simplicity).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*RUquxSdLtJS9P8XmAhuaAQ.png" /></figure><p>So why would an intent layer need AA? We still use SUAVE as an example. There are two scenarios:</p><p><strong>1. SUAVE directly addresses user intents</strong></p><p>In this case, as we mentioned, users would need to deposit funds and <em>check note</em> write smart contracts on SUAVE. This would be a huge downgradation in UX. And it’s very counterintuitive — why do I need to move funds to and interact with a different chain just to do something on Ethereum? Here, AA and SCW come into play: you can wrap all interaction logics with SUAVE into an Ethereum wallet. Fund deposit, verification of execution, everything. This doesn’t solve any fundamental challenges to SUAVE — we still need a trustless bridge, an intent protocol, etc. But at least UX per se can be largely saved by SCW. An EOA simply cannot do that.</p><p><strong>2. SUAVE only addresses searcher intents</strong></p><p>It’s clear that Flashbots will iteratively build SUAVE on top of its current offerings, namely MEV-Boost and MEV-Share. Considering the difficulty of building a feasible protocol for arbitrary intents, it’s very likely that SUAVE will NOT touch user intents in a long time. Instead, it will look more similar to the current Flashbots, who mainly work with preferences on transaction ordering, or what I call “searcher intents”. In this case, there has to be someone who <strong>turn users intents to transactions</strong> first, then submit transactions to SUAVE, meaning the intent solving will happen prior to SUAVE.</p><p>So who’s going to be the intent layer in this case? Today it’s dapps, just like DEX aggregators solving simple intents. With AA matures over time, SCWs will likely become the de facto intent layer and take the lunch away from both dapps and SUAVE. And here’s why:</p><h3>Exclusive Intent Flow redefines MEV</h3><p>Currently, MEV is about <strong>reordering existing transactions</strong>. However, with intents, most of the value will be extracted already BEFORE transactions are even created, and MEV (if we still call it by this name) will be about <strong>creating transactions from intents</strong>. Solvers, after receiving intents, can tweak the execution freely as they want (as long as constraints are met) and insert their own transactions into intent-generated transactions, bundle them together as ONE atomic transaction.</p><p>The most straightforward example will be a sandwich attack: Right now, sandwich attackers need inventory to move prices against user transactions, and have to trust relays, builders and proposers NOT to unbundle their sandwich bundle (otherwise they get absolutely <a href="https://twitter.com/samczsun/status/1642848556590723075">nuked</a>). But an intent solver would be able sandwich a user intent risk-free &amp; capital-free: He only needs to take a flashloan and sway the price before user’s swap, and swap back after user’s swap, repay flashloan and take profit, all in one transaction because all steps involved are technically HIS.</p><p>Wait, doesn’t this sound familiar? Let’s take a look at this wonderful drawing again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*RUquxSdLtJS9P8XmAhuaAQ.png" /></figure><p>Yes. Bundlers are very much like intent solvers. They receive UserOps, turn them into transactions, and take advantage of them at will because technically those transactions belong to them.</p><p>So you are saying bundlers will become the next searchers. What does it have to do with wallets? The key point is, UserOps AREN’T intents. UserOps are pseudo-Ethereum-transaction whose nonce and signature fields usage is not defined by the protocol but instead by each account implementation. Thus there has to be a “intent-to-UserOp” process. And that’s exactly what an intent layer does.</p><p>If we believe that SCWs will dominate, then there’s only one logical outcome: Wallet(s) become the intent layer. Intents and order flow that previously go to dapps will be intercepted by wallet frontends. The users flow will become something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8pQ2veGhUWT4JkE80qU0Q.png" /></figure><p>Notice that intent solvers on SCW frontends are very likely to simultaneously act as bundlers, who may also be block builders. Such vertical integration gives rise to the so called “Exclusive Intent Flow (EIF)”, just like EOF (Exclusive Order Flow) that has been widely discussed in the MEV community. In my <a href="https://t.ly/DFN4">previous article</a> I argued that EOF is less of a problem because users can easily switch executors if they find themselves being squeezed. But intents will make it different this time: Users don’t own their transactions anymore. Of course they can switch intent layers too, but the cost will be much higher than switching RPCs like today.</p><p>So (un)surprisingly, intents will further centralize MEV. The good news is, building a fully functional intent layer is difficult for both Flashbots and any wallets, so we won’t see EIF in its full form for a long time. The bad news is, wallets can iterate too. Remember, dapps are intent solvers today, and SCWs can have plugins, or in-wallet dapps. Installing a wallet plugin to your wallet will be as normal as installing an app to your Android phone from Google Play. Those wallets plugins will act as the earliest intent solvers, and all intents they attract will be first funneled to the wallet. <strong>An intent layer built from the bottom up</strong>.</p><p>Now we can answer the question in the topic: We are still far far away from an intent-centric Ethereum, but intents will start playing a bigger role in user flow, which will inevitably change MEV landscape permanently, with smart contract wallets becoming a strong value extractor. Users sacrifice ownership over their transactions for better UX, hoping for an ingeniously designed intent layer to equitably return them the value their intents generated.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=907e30804880" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/account-abstraction-and-suave-how-far-are-we-from-an-intent-centric-ethereum-907e30804880">Account Abstraction and SUAVE: How far are we from an Intent-Centric Ethereum?</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From MEV to Execution-as-a-Service]]></title>
            <link>https://medium.com/metaweb-vc/from-mev-to-execution-as-a-service-108ed9e72a4b?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/108ed9e72a4b</guid>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Wed, 09 Nov 2022 07:16:51 GMT</pubDate>
            <atom:updated>2022-11-09T07:16:51.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-joBNwFkCpXyCXjhHUp5Q.png" /><figcaption>Source: Flashbots</figcaption></figure><p><strong>MEV recap</strong></p><p>“A blockchain can be viewed as a timestamping service that allows for the ordering of data in a canonical way” — <a href="https://www.paradigm.xyz/2022/09/base-layer-neutrality">Paradigm</a></p><p>Data on a blockchain can only be changed by signed transactions. Therefore, the right to order transactions lies at the heart of blockchain economics. Indeed, the buzz word “MEV” (Miner-Extractable-Value or Maximal-Extractable-Value) is defined as the value that can be extracted from transaction inclusion, exclusion and ordering, by miners, validators, sequencers, builders, etc. For a more in-depth discussion of MEV per se, here’s an old <a href="https://medium.com/metaweb-vc/mev-capturing-the-necessary-evil-6186b92ff15">article</a> by me.</p><p><strong>Think MEV from orderflow angle</strong></p><p>Ethereum MEV is a huge cake — hundreds of thousands to millions of dollars profit every day. In the beginning it was monopolized by miners when transaction ordering was fully determined by PGA (Priority Gas Auction); then Flashbots came into play, formalizing MEV extraction by searchers and miners with sealed-bid auction.</p><p>A weird fact is, it’s users who actually initiate and own their transactions, but they don’t get to share any of the MEV generated from those transactions. Users have long been excluded from the MEV discussion.</p><p>The reason behind this is that users give their valuable orderflow to searchers for free. We simply send transactions to Ethereum public mempool via MetaMask default RPC (which is Infura) for searchers to play their Dark Forest game. In fact, Retail orderflow is valuable to market makers because of non-toxicity (in other words, being more naive than institutional takers. You can refer to this <a href="http://tinyurl.com/2s3hukjz">article</a> for more info), who are willing to pay for it. In tradfi it’s called PFOF (Payment For Order Flow) and that’s how Robinhood made most of its money: by selling Robinhood users’ orders to market makers. Users get rebates too.</p><p><strong>So, how can i sell my orderflow in Crypto?</strong></p><p>PFOF has another name: Exclusive orderflow (EOF). And it exists in crypto too. For example, all Sushiswap orders are exclusively routed through (aka sold to) <a href="https://www.manifoldfinance.com/">Manifold Finance</a>, a private relay that’s unaccessible to public mempool searchers, who then extracts as much MEV as possible via backrunning, and split profits between themselves and Sushi, which is then <a href="https://t.ly/Ynal">shared</a> among Sushi stakers. This relationship is exactly like Robinhood and its MMs — brokers (Robinhood/Sushi) give exclusive non-toxic orderflow to professional MMs (Manifold and its searchers) and share part of the profits generated. I call it the 2B solution because Manifold works with dapps.</p><p>Another example is <a href="https://www.rook.fi/">Rook</a>. Rook is what I call the 2C solution (although it provides services to dapps too): it works directly with users. If you want to swap 1M DAI for ETH on chain, you can submit your transaction through Rook, which is also a private relay protecting you from outside searchers. Searchers on Rook, who stake $ROOK for access to transactions, bid for the right to execute your transaction. Part of the bid then goes back to you.</p><p>Other than those two on Ethereum, probably the most classic instance of DeFi PFOF is <a href="https://dflow.net/">DFlow</a>, which started on Solana and recently launched an appchain.</p><p><strong>MEV and EOF on the PoS Ethereum</strong></p><p>EOF protocols began to receive magnitudes more attention after the Merge, and subsequent Proposer-Builder Separation implemented by Flashbots’ MEV-Boost client. MEV-Boost implements sealed-bid auction to the validator layer: a new role called builders collect transactions, build the whole block, and only provide the block header and a tip to ETH validators (also called block proposer). Proposers don’t see the content of the blocks, therefore cannot extract MEV by themselves. Instead they simply propose the block with the highest tip, adding it to Ethereum blockchain. MEV-Boost and PBS, which will be enshrined to Ethereum in the future, essentially isolate validators from MEV extraction, preventing potential harm from MEV to Ethereum consensus. Right now, nearly <a href="https://www.mevwatch.info/">90% of all Ethereum blocks</a> are produced by MEV-Boost clients.</p><p>What does this have to do with EOF? MEV is now highly professionalized and concentrated to block builders. In order to build the most lucrative block, builders need access to the most lucrative transactions — where EOF comes into play. Those who control orderflow control Ethereum block production.</p><p><strong>Centralization is the end of the world…or is it?</strong></p><p>And this is the reason why many are worrying about a potential MEV centralization: for example MetaMask could set up their own transaction relay, searcher and builder, and monopolize block building with MetaMask orderflow, which is 70% of all Ethereum transactions. Even searchers in public mempool have to submit their bundles to the MetaMask builder whose blocks get proposed all the time (because they are simply more lucrative than other builders’ blocks thus can pay higher tips to validators). By that time, no party would have enough bargaining power against MetaMask, whose monopoly makes everyone else worse off.</p><p>It’s such a gloomy outlook. But if we push the thought experiment a couple steps further, we will see that this type of vertical-integration-based monopoly is easier to break than it seems, because crypto users have a stronger ownership over their transactions than in tradifi. Let’s say if MetaMask obtains the monopolistic position, and starts to squeeze everyone else — validators get less tips, users get less rebates — what will happen next? Users will surely be unhappy. They will look for other channels to sell their orders for a higher price. DEXs have a natural advantage to satisfy this need, since the majority of MEV arises from DEX trading activities. If Uniswap, Sushiswap and Balancer forms an association and build their own transaction relay (and searcher+builder team) and offer users with better pricing, a huge chunk of valuable orderflow will leave MetaMask and go to that “DEX relay” — switching cost is relatively low, since all you need to do is signing a message. The MetaMask builder now faces a strong contender: the DEX builder, who is supercharged by DEX orderflow to build lucrative blocks and get them proposed. Competition between both brings more value sharing to validators and users.</p><p><strong>Ownership gives birth to EaaS</strong></p><p>Switching your stock broker is a costly activity, but switching RPC is only one-click. It again shows that blockchain gives users true ownership. With that in mind, applications — MetaMask, Uniswap, etc. — are most likely to go for adequate competition from day one. Execution-as-a-service (EaaS) thus becomes plausible. EaaS looks just like a generalized Rook: instead of just swap transactions, all transactions can be sent to a transaction relay, where searchers bid for the right to execute, part of which goes back to users, aka transaction originators.</p><p>See this is a searcher-layer full competition, as users don’t really care about which builder searchers are sending bundles to with how much tip. Even if we have a dominant builder who builds and wins 90% of all blocks, it still doesn’t necessarily mean lower return to users, as long as it still relies on searchers to provide bundled transactions. The key is to avoid builder’s control over orderflow, which according to our previous deduction, is economically implausible.</p><p>Conflicts only happen when the dominant builder starts its own searcher and discriminates against outside searchers — which will lead to searchers going to other builders, reducing orderflow going to the builder and harming the builder itself eventually.</p><p>Such an EaaS neutral relay has the potential to fundamentally change how people transact on-chain. By EaaS, users can now cut a bigger share in the market surplus that’s previously monopolized by institutions. Rook is building a <a href="https://twitter.com/0x81B/status/1582087247012110336">neutral relay</a> and it seems to be a transaction relay. Something worth following.</p><p>What comes with EaaS is MEV redefined. Today, MEV only seems to derive from most straightforward DeFi activities: sandwiching/backrunning transactions, liquidation, arbitrage, etc. But we are seeing MEV expanding its boundary. In theory, every transaction carries a certain amount of MEV. More people, facilitated by more available information, begin to extract more uncertain (but potentially much bigger) value. EaaS makes sure that more complex MEV strategies can be built, and users will benefit from the ever-growing MEV.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=108ed9e72a4b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/from-mev-to-execution-as-a-service-108ed9e72a4b">From MEV to Execution-as-a-Service</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are we talking about when we talk about (attacks of) cross-chain bridges?]]></title>
            <link>https://medium.com/@stanley_he_17/what-are-we-talking-about-when-we-talk-about-attacks-of-cross-chain-bridges-91720ee095d9?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/91720ee095d9</guid>
            <category><![CDATA[wormhole]]></category>
            <category><![CDATA[crosschain]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[anyswap]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Sat, 19 Feb 2022 04:49:14 GMT</pubDate>
            <atom:updated>2022-02-19T04:49:14.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snjVnHmuwKOG_hkh-fmeYQ.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/File:Hai_Duong_bridge_bombing_1972.jpg">https://en.wikipedia.org/wiki/File:Hai_Duong_bridge_bombing_1972.jpg</a></figcaption></figure><p><em>Cross-chain bridges had once stepped onto the center of the stage for an awkward reason: being exploited. From THORChain, to Chainswap, to Anyswap, and finally the largest exploitation ever happened to the crypto world (though returned afterwards) of Poly Network, bridges really had a bad time. After all the technical details and market noises, one may realize that the (attack of) cross-chain bridges is actually a mixed problem with multiple fields conflated together, blurring important subtleties. This article intends to analyze the cross-chain bridge issue from the token model perspective, and compare major bridge solutions.</em></p><h3>Revisiting cross-chain bridge exploitations</h3><p>Probably the best way to understand mechanisms of cross-chain bridges is through exploitation analysis. We will study four cases, namely THORChain, Chainswap, AnySwap and Poly Network.</p><h3>THORChain exploitation (<a href="https://www.rekt.news/thorchain-rekt2/">7/22/2021</a>)</h3><p>THORChain is a cross-chain liquidity protocol. It allows users to swap assets on chain A for assets on chain B. THORChain achieves cross-chain exchange with two components: router contracts on each chain it supports, and THORChain, an independent blockchain composed of nodes. Each node is capable of <strong>observing the router contracts</strong>, and updating THORChain state to reflect any changes and trigger subsequent actions by other routers. For example, if Alice wants to swap 1 ETH (Ethereum) for 3500 BUSD (BSC), she deposits 1 ETH to THORChain’s Ethereum router contract. Nodes then observe this transaction, update the THORChain state, and collectively command its BSC router to release 3500 BUSD to Alice’s BSC address.</p><p>The attack was done by creating a<strong> fake router contract</strong>, which fooled the nodes, triggering a refund that’s not supposed to happen. In Alice’s case, it’s as if Alice made the nodes believe that she has deposited 1 ETH to the Ethereum router for 3500 BUSD on BSC without actually depositing the ETH, but the transaction failed due to bad memo, so the nodes decided to return 1 ETH to Alice — although she had never deposited it.</p><h3>ChainSwap exploitation (<a href="https://rekt.news/chainswap-rekt/">7/11/2021</a>)</h3><p>ChainSwap is a cross-chain bridge that allows tokens native to chain A to be locked, and mints corresponding tokens on chain B. Tokens locked on chain A can be unlocked by burning minted tokens on chain B. This type of bridge is called “<strong>mint-burn bridge</strong>” (it does have other functionalities, but this was the exploited function). ChainSwap utilizes its own PoA (proof of authority) blockchain to verify transactions. If Alice wants to move 1 $WILD (one of the affected tokens in the exploitation) from Ethereum to BSC, she would lock 1$WILD into ChainSwap’s contract on Ethereum. ChainSwap nodes then verify the deposit, and command ChainSwap contract on BSC to mint 1 $WILD for Alice.</p><p>The attack was due to a loophole in the mint contract. Signatures from ChainSwap validators (nodes) are supposed to be needed for the mint contract to mint tokens. However, the hacker found out that the identity of the signatory was not checked by the mint contract, and only one signature was required to mint tokens. So the hacker <strong>minted millions of tokens from thin air without locking anything on any chains</strong>.</p><p>It’s important to notice that the mint-burn bridge is not only a bridge for users to move tokens, but actually an architecture for projects to<strong> deploy</strong> their tokens to other chains. If project A only issued their token on Ethereum and doesn’t want to inflate the total supply, it can choose to apply to ChainSwap bridge, who will deploy a token contract for project A on BSC. After that users can cross their project A tokens from Ethereum to BSC through mint-burn bridge.</p><h3>AnySwap (<a href="https://rekt.news/anyswap-rekt/">7/10/2021</a>)</h3><p>AnySwap is probably the most widely used multichain bridge. It has a mint-burn bridge (V2) and a liquidity bridge (V3) which serves <strong>tokens that are native to more than one chain</strong>, for example, USDC. The defining feature of AnySwap is the<strong> intermediary anyTokens</strong>. If Alice wants to move her 1 USDC from Ethereum to Polygon, she can deposit 1 USDC to AnySwap, who then mints 1 anyUSDC to Alice’s Polygon address. Alice can then swap this 1 anyUSDC for USDC (Polygon) in outside pools, or in AnySwap V3 liquidity pools.</p><p>AnySwap is built upon Fusion blockchain, and utilizes<strong> MPC</strong> (multi-party computation) to secure its token contracts on each chain. Similar to THORChain, the nodes of AnySwap, called AWN (AnySwap working nodes), monitor the deposit by users on each chain to AnySwap’s contracts, and trigger minting activity correspondingly. Just like THORChain, AnySwap routers need signatures from MPC-AWNs in order to perform certain functions. The hacker found out <strong>two identical signatures</strong> being used, and deduced the private key. Then he/she minted millions of anyTokens to him/herself, and swapped them for stablecoins.</p><h3>Poly Network (<a href="https://slowmist.medium.com/the-analysis-and-q-a-of-poly-network-being-hacked-8112a35beb39">8/10/2021</a>)</h3><p>Probably the most dramatic heist ever seen. On a high level, Poly Network’s mechanism is similar to that of AnySwap. Bookkeepers monitor activities on chain A, and trigger token release on chain B. This process is exploited by the hacker by<strong> calling a privileged contract which can initiate cross-chain messaging AND control the keepers list</strong>. The then replaced keepers with a malicious one, and released $600M tokens to him/herself.</p><p>Note that Poly Network is a cross-chain communication protocol whose functions are not limited to token transactions. There are projects like O3 Swap that’s built on Poly Network.</p><p>Liquidity providers are the most affected by the attack. Their “real” tokens, provided to Poly Network for cross-chain asset movement, were mistakenly released to the hacker, leaving them with nothing but now<strong> uncollateralized intermediary tokens</strong> (pTokens).</p><h3>Token models and three functionalities of bridges</h3><p>In the news, all those attacks were oversimplified as “cross-chain bridge attacks”. However, the reality is more complicated since not only those “bridges” are different, they also serve different tokens, and attacks were targeted at different functionalities of the bridges. Generally speaking, we want “bridges” to realize three functions:</p><ul><li>Multichain deployment of token</li><li>Homogenous asset cross-chain movement</li><li>Cross-chain exchange</li></ul><p>This gives us a clearer categorization of the aforementioned attacks:</p><ul><li><strong>Attack on deployment</strong>: ChainSwap</li><li><strong>Attack on homogenous asset movement</strong>: AnySwap and Poly Network</li><li><strong>Attack on cross-chain exchange</strong>: THORChain</li></ul><p>From a *philosophical* perspective, the most disastrous exploitation was not Poly Network’s $600M heist, but ChainSwap’s “mint as much as you can”. In the case of Poly Network, the “real” tokens were stolen from LPs; in the case of ChainSwap, the “real” tokens were simply <strong>inflated</strong> by the hacker. Those tokens were mainly of small-to-medium projects who issued their tokens on Ethereum and deployed BSC token contracts via ChainSwap. The attack created extra supply of tokens that most project teams had to buy back the same amount of minted token and burn them so as to bring the total supply back to normal. Imagine one day the Polygon bridge is compromised (though unlikely) by a hacker who then minted 10000 ETH (Polygon) and switched them to USDC. It would be a nightmare to both ETH and Polygon, since extra ETHs are now created from nowhere, so Ethereum Foundation would have to burn their own ETHs to cover that; ETH (Polygon) will lose their authenticity and be dumped, further messing up the economy of both Polygon and Ethereum. This may never happen, but ChainSwap incident is a demonstration with *less important* tokens.</p><p>Homogenous asset movement is a completely different story. Tokens like USDC and MIM are natively issued on multiple chains, so there is no need to mint or burn. What AnySwap and Poly Network do is essentially a <strong>stable swap</strong>: Alice swaps one USDC (Ethereum) for one USDC (BSC), just like what she does with the Curve 3pool, only that this time it is cross-chain. Liquidity providers took the bullet, while token issuers have to worry nothing.</p><p>What happened to THORChain is similar, only that it is a cross-chain exchange that enables heterogeneous assets swap between chains, and liquidity is custodied by THORChain.</p><h3>What will be the prevailing token models in a multichain world?</h3><p>When Ethereum first came into existence, dapp developers rarely cared about “multichain” deployment since there was literally only one chain that allowed smart contracts. Therefore, early tokens are mainly exclusive to one blockchain. Native tokens for blockchains like ETH and BTC are also naturally single-chain assets. Those two kinds of tokens are the main users of mint-burn bridges because they have to create some mapped version of the original tokens on other chains and mint-burn model is almost the only choice.</p><p>For newer projects, the narrative is quite different. With the rapid development of alternative L1 public chains and L2s, we are seeing more and more multichain-native projects. A good example is MIM, which is a multichain stablecoin protocol. For multichain-native projects, mint-burn bridges are no longer necessary.</p><p>If we take a step back and reassess the demand for cross-chain asset movement, we can almost say with certainty that the demand will focus on two types of assets:</p><ul><li>The <strong>biggest crypto assets like BTC and ETH</strong>. Those tokens will continue being the backbone of DeFi. When a new chain emerges, it has to have some sort of mint-burn bridge to cross ETH and BTC over to its own ecosystem.</li><li>Stablecoins like DAI, USDC and USDT. They will continue serving as the intermediary for exchange. When a new chain emerges, if it wants to grow, it has to persuade Maker or Circle of Tether to issue tokens on their chain.</li></ul><p>In a multichain world, “mint-burn” demand will actually be quite limited to the biggest tokens, since protocols that want to go to more than one chain will simply issue tokens <strong>on different chains natively</strong>.</p><h3>The “best” bridges</h3><p>Mint-burn purpose requires the highest level of security. If we abstract the mint-burn structure into three components: chain A, communicator, chain B, then the highest level of security the bridge can achieve equals the lowest security level that any of the three components can provide. Therefore, the optimal solution would be to utilize the native security provided by chain A and chain B, hopefully getting rid of the communicator. This is achieved by <a href="https://near.org/bridge/">NEAR Rainbow Bridge</a>, which is a trustless, permissionless, and generic protocol for connecting blockchains. The bridge protocol removes the need to trust anyone except the security of the connected chains. Anyone can deploy a new bridge, use an existing bridge, or join the maintenance of an existing bridge without getting approval from anyone else. Rainbow Bridge (currently connecting Ethereum and NEAR) achieves this by deploying a NEAR light client on Ethereum as a smart contract, and an Ethereum light client on NEAR as a smart contract.<strong> Light clients directly verify the transactions on the other chain</strong>, and mint tokens correspondingly. This setting eliminates the trusted third party, and fully inherits security of both chains.</p><p>A common concern over the rainbow bridge model is that we are going to build too many bridges if we have to build one between every two chains. The statement is true, but from a token model perspective it’s also unnecessary. Let’s say a new EVM chain called ZYX just launched, and of course it wants to bridge ETH over. What they have to do is to build a rainbow-bridge-type infrastructure that mints ETH (XYZ) when people lock ETH on Ethereum. What if someone wants to move ETH from NEAR to XYZ? Moving ETH back to Ethereum then to XYZ would be too tedious and costly, while there is no direct rainbow bridge between NEAR and XYZ. The solution, however, is<strong> cross-chain exchange</strong>. Since a substantial amount of ETH have already been bridged to both NEAR and XYZ, there is no need to set up another bridge between them. Instead, users only need to do a liquidity swap,<strong> from ETH (NEAR) to ETH (XYZ), without minting or burning anything</strong>. The key here is that mint-burn should only happen between native chain and other chains, for ETH and BTC.</p><p>The swap can take different forms. For homogenous assets,<strong> HTLC</strong> (Hashed Timelock Contract) is a nice trustless option, which is used by Celer’s <a href="https://cbridge.celer.network/#/transfer">cBridge</a>. At a high level, HTLC works as follows: The user sends a transferOut request of 1000 USDC to the cBridge contract on the Ethereum side. This action emits an event LogNewTransferOut. The user also specifies the duration of the timelock(UI default is 12h).</p><p>Multiple relay nodes or cBridge nodes are waiting to serve the liquidity requests. The Gateway server picks a relay node based on specific parameters.</p><p>The bridge node sends a transferIn request to the Optimism part of the bridge(destination chain) using the same hashlock set by the sender. In this example, assume the bridge node sends 990 USDC to the contract after deducting the fees.</p><p>When the user sees that the 990 USDC is waiting for them on Optimism, they release 1000 USDC from the Ethereum part of the bridge to the Relayer.</p><p>Finally, the Relayer releases 990 USDC from the Optimism part of the bridge to the user.</p><p>Indeed, a multichain aggregator can essentially build a cross-chain swap without involving any trusted third party — be it a blockchain or MPC wallet or anything — by integrating rainbow bridges, HTLC atomic swaps, and single-chain DEXs. A multichain 1inch, if you need a comparison. The efficiency loss may not be too huge if optimization is done correctly, and considering the increased security, it’s definitely worth trying.</p><h3>Useful links</h3><p>Multicoin research on Thorchain: <a href="https://assets.ctfassets.net/qtbqvna1l0yq/5WqbfijNKHtIuEX4a8siDA/4569e7b081c73c7de21e7b14ee87c763/THORChain_Analysis.pdf?mc_cid=bd52ba2230">https://assets.ctfassets.net/qtbqvna1l0yq/5WqbfijNKHtIuEX4a8siDA/4569e7b081c73c7de21e7b14ee87c763/THORChain_Analysis.pdf?mc_cid=bd52ba2230</a></p><p>THORChain technology: <a href="https://docs.thorchain.org/technology">https://docs.thorchain.org/technology</a></p><p>Attacks on bridges: <a href="https://www.rekt.news/polynetwork-rekt/">https://www.rekt.news/polynetwork-rekt/</a> <a href="https://www.rekt.news/anyswap-rekt/">https://www.rekt.news/anyswap-rekt/</a> <a href="https://www.rekt.news/chainswap-rekt/">https://www.rekt.news/chainswap-rekt/</a> <a href="https://www.rekt.news/thorchain-rekt2/">https://www.rekt.news/thorchain-rekt2/</a></p><p>Anyswap post-mortem: <a href="https://anyswap.medium.com/anyswap-multichain-router-v3-exploit-statement-6833f1b7e6fb">https://anyswap.medium.com/anyswap-multichain-router-v3-exploit-statement-6833f1b7e6fb</a></p><p>Anyswap router vs. bridge: <a href="https://anyswap.medium.com/how-to-apply-for-cross-chain-bridges-on-anyswap-82fcb6c9f0d2">https://anyswap.medium.com/how-to-apply-for-cross-chain-bridges-on-anyswap-82fcb6c9f0d2</a></p><p>Dragonfly on bridges: <a href="https://medium.com/dragonfly-research/secure-the-bridge-cross-chain-communication-done-right-part-i-993f76ffed5d">https://medium.com/dragonfly-research/secure-the-bridge-cross-chain-communication-done-right-part-i-993f76ffed5d</a></p><p>Figment on bridges: <a href="https://figment.io/resources/cross-chain-bridges/">https://figment.io/resources/cross-chain-bridges/</a></p><p>BlockSec Chainswap analysis: <a href="https://www.chainnews.com/articles/339762564958.htm">https://www.chainnews.com/articles/339762564958.htm</a></p><p>A&amp;T Capital on bridges: <a href="https://www.chainnews.com/articles/759243398396.htm">https://www.chainnews.com/articles/759243398396.htm</a></p><p>Multichain tokens: <a href="https://andrecronje.medium.com/multichain-dapp-guide-standards-and-best-practices-8fabe2672c60">https://andrecronje.medium.com/multichain-dapp-guide-standards-and-best-practices-8fabe2672c60</a></p><p>The best analyses of Poly Network hack: <a href="https://twitter.com/kelvinfichter/status/1425217046636371969">https://twitter.com/kelvinfichter/status/1425217046636371969</a></p><p><a href="https://mudit.blog/poly-network-largest-crypto-hack/">https://mudit.blog/poly-network-largest-crypto-hack/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91720ee095d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[dYdX and Perpetual Swaps]]></title>
            <link>https://medium.com/metaweb-vc/dydx-and-perpetual-swaps-60b17c29c9d5?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/60b17c29c9d5</guid>
            <category><![CDATA[perpetual-contracts]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[dydx]]></category>
            <category><![CDATA[near-protocol]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Sun, 24 Oct 2021 14:02:42 GMT</pubDate>
            <atom:updated>2021-10-24T14:02:42.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*2GC1D0NAzY0b4Lh6odcsrA.png" /></figure><p><em>After basic DeFi legos like DEX, lending protocol, and stableswap reach maturity, together with the blockchain scaling efforts generating real utility, the derivative market, whose size is supposed to be 10x or 100x of the spot market, is rapidly developing on-chain. Perpetual swap (perp), a type of derivative product that is mostly seen in crypto market, is among the first derivatives that’s been moved on-chain. dYdX v2 has been the most eye-catching perpetual swap protocol since the recent token launch. We will study dYdX’s solution to decentralize perps, and evaluate other mechanisms.</em></p><h3>Perpetual swap (perp) basics</h3><p>Perpetual swap, or perpetual future / perpetual contract, is a financial product that enables traders to access <strong>leveraged exposure</strong> to certain asset prices <strong>without owning</strong> any of the underlying assets. The concept of perps has existed before cryptocurrencies even emerged, but it hasn’t received much attention until being introduced to the crypto world by <a href="https://www.bitmex.com/app/perpetualContractsGuide">BitMEX</a> in 2016.</p><p>Perps are essentially <strong>imaginary assets</strong>. One bitcoin perp is one imaginary bitcoin. You can create as many imaginary bitcoins you can but they are non-redeemable. Suppose two people, Alice and Bob, want to long (buy) and short (borrow) one bitcoin respectively, but they have no money — Alice doesn’t have money to buy one bitcoin, and Bob doesn’t have one bitcoin to borrow and then sell. What they choose to do is that they “trade” one perp between each other: Alice lends Bob one imaginary bitcoin, in exchange for the imaginary market price for bitcoin — let’s say, $50K — from Bob. Both are imaginary and they cancel each other out, so neither Alice or Bob need to pay anything. One day later, the price of bitcoin (and also imaginary bitcoin) rose to $55K. Now Bob owes Alice $5K ($55K — $50K). He has to pay Alice $5K to make them back to even.</p><p>In reality, three metrics define the simplest perp: <strong>index price, mark price, and funding rate</strong>. Index price is the market price of the underlying asset. Mark price is the current price of the corresponding perp. In the previous example, the index price of bitcoin already rose to $55K, but what about the imaginary bitcoin (mark price)? Exchange platforms that create perps deploy funding rates as the mechanism to make the gap between index price and mark price <strong>converge</strong>. When the index price and the mark price diverge, the system transfers a funding fee between those who are long the perp (in our case, Alice) and those who are short the perp (Bob). In our example perp, the funding fee paid by the longs to the shorts is $(mark price — index price) per contract per day. When this number is negative, the shorts pay the longs. Therefore, if Bob cannot immediately pay Alice $5K to make them back to even (mark price and index price converge), he has to pay the funding fee to Alice during this period. In centralized exchanges, funding fees are usually paid every 8 hours.</p><p>Traders must also put down collateral, known as margin. When the mark price moves against the trader, the resulting losses are deducted from this margin. If the margin balance gets too low, the trader will be liquidated, meaning their position is automatically closed out. Margin trading in perps often allows high leverage: one can get 100x leverage or higher on centralized exchanges like Binance and FTX.</p><p>Due to the fact that perps trading is free from underlying asset limits and allows high leverage, it forms a much <strong>bigger and more lucrative</strong> market than spot trading — for Binance, at press time perps trading volume is 3 times higher than spot.</p><h3>dYdX</h3><p>Before dYdX, the biggest player in decentralized perps was<a href="https://www.perp.fi/"> Perpetual Protocol</a>. However, we can see that dYdX perps really disturbed the market after it launched trading incentives in late August. The market grew exponentially since then, with dYdX becoming the industry market leader. We will evaluate its technological solutions, pricing mechanisms, and tokenomics which is behind the mad rally of the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fi48wnsxp4VvFacu" /><figcaption><em>Decentralized Perpetual Swaps trading volume YTD. Source: The Block</em></figcaption></figure><h3>Validium</h3><p>dYdX utilizes StarkWare’s <a href="https://starkware.co/product/starkex/">StarkEx</a>, a scalability engine based on zero-knowledge proof algorithms which is also used by <a href="https://www.deversifi.com/">DeversiFi</a>, a decentralized exchange. StarkEx is a validum rather than a zkRollup, which means while validity proofs are generated for transactions (which is the “zk” part), those proofs aren’t posted on Ethereum L1. The matrix below gives a straightforward comparison between L2 solutions, and we can see where Validium is at. The advantage of Validium is that, gas fee can be infinitely close to zero (dYdX is gas-free) since there is little interaction between Validium and Ethreuem except for transferring capital between each other. The risk of Validium is that data availability is not guaranteed, and technically it does NOT share Ethereum’s security, unlike zkRollup where transaction validity proofs are posted on Ethereum.</p><p>For dYdX this is a necessary trade-off. In order to achieve the same UX like CEX (instant transaction confirmation, 0 network fee, etc.), Validium must be selected over zkRollup in the current stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Ez0FTWRNvriPqX5P" /><figcaption><em>L2 matrix. Source: </em><a href="https://www.buildblockchain.tech/newsletter/issues/no-99-validium-and-the-layer-2-two-by-two"><em>Buildblockchain.tech</em></a></figcaption></figure><h3>Pricing mechanism</h3><p>The most significant advantage StarkEx has brought to dYdX is high TPS, which enables dYdX to <strong>duplicate</strong> the <strong>order-book-based</strong> CEX model for perpetual swaps, where big market makers provide liquidity and maintain an order book, and funding fees are transferred between traders to move mark price towards index price. In a word, dYdX manages to decentralize CEX perps without changing the underlying mechanisms.</p><p>The only salient difference between dYdX and CEXs is that dYdX only offers as high as 25x leverage for ETH and BTC perps trading, while CEXs generally provide 100x or higher leverage. This could be due to two factors: first, higher leverage means more frequent liquidation, which translates to higher pressure on <strong>network capacity</strong>. StarkEx is a tested solution, but centralized servers still have advantage on this front. The second factor could be <strong>insurance fund</strong>. When leverage is high, it’s possible that a position’s net value <strong>drops below zero before</strong> it could get liquidated. In this case, an insurance fund is involved, which liquidates the negative-value position, ensuring systematic solvency. CEXs have insurance funds, so does dYdX. But the <a href="https://help.dydx.exchange/en/articles/4801076-how-does-the-perpetual-insurance-fund-and-deleveraging-work">current size</a> of the dYdX insurance fund is limited, plus it’s controlled by the dYdX team, which means it can’t afford to buy out too many insolvent positions.</p><h3>Tokenomics</h3><p>What really set dYdX to fly is not its fundamentals, though they look good, but instead its tokenomics and associated trading rewards. The total supply of its governance token, DYDX, is 1 billion, of which 50% will be used to incentivize community involvement. Note that DYDX holders <strong>do not share</strong> trading fees on dYdX, which currently all goes to the team. Therefore the only utility of DYDX is voting. The allocation of the <strong>50.00%</strong> (500,000,000 DYDX) to the community is as follows:</p><ul><li><strong>25.00%</strong> (250,000,000 DYDX) to users who trade on the dYdX Layer 2 Protocol based on a combination of fees paid and open interest (<strong>Trading Rewards</strong>)</li><li><strong>7.50%</strong> (75,000,000 DYDX) to past users who complete certain trading milestones on the dYdX Layer 2 Protocol (<strong>Retroactive Mining Rewards</strong>)</li><li><strong>7.50%</strong> (75,000,000 DYDX) to liquidity providers based on a formula rewarding a combination of uptime, two-sided depth, bid-ask spreads, and the number of markets supported (<strong>Liquidity Provider Rewards</strong>)</li><li><strong>5.00%</strong> (50,000,000 DYDX) to a community treasury (<strong>Treasury</strong>)</li><li><strong>2.50%</strong> (25,000,000 DYDX) to users staking USDC to a liquidity staking pool (<strong>Liquidity Module</strong>)</li><li><strong>2.50%</strong> (25,000,000 DYDX) to users staking DYDX to a safety staking pool (<strong>Safety Module</strong>)</li></ul><p>Both trading rewards and retroactive mining rewards are aimed for boosting trading volume on the platform. Past users of dYdX had to reach “milestones” on dYdX L2, which are tiers of trading volumes — the higher trading volume you incur, the more DYDX you would be granted. The retroactive mining rewards have ended before August. Then we have the trading rewards, which will be there for 5 years. During this period, all traders will be rewarded with DYDX. The exact mechanism is as follows:</p><p>DYDX will be distributed to traders based on a formula that rewards a combination of fees paid and open interest on the dYdX Layer 2 Protocol. DYDX will be distributed on a 28-day epoch basis over five years and is not subject to any vesting or lockups. 3,835,616 DYDX will be distributed per epoch.</p><p>The Cobb-Douglas function is used to compute how much DYDX is awarded to each trader during each epoch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0wcPVOfwqZ6FgibY" /></figure><p>We see that trading fees generated are disproportionately favored over average open interest, meaning that trading volume is dYdX’s main goal, and it has made it. People open new accounts on dYdX as many as possible (because of diminishing returns stipulated by Cobb-Douglas function) and optimize their funds, “water-trading” to generate more fees, and maximize DYDX return.</p><p>Another interesting part is liquidity provider rewards — unlike the LP rewards we are familiar with, here it actually rewards market makers. Only makers that have achieved a minimum of <strong>5% of maker volume</strong> on the dYdX Layer 2 Protocol in the prior epoch are eligible to receive DYDX as rewards in a given epoch. A <a href="https://forums.dydx.community/snapshot/dydxgov.eth/QmXtS7CGVX7C5v2JdcJpsqWAeZrStQcogSQpP6zzhzwLmN">proposal</a> to lower the threshold to 1% is likely to pass.</p><h3>Competitors</h3><p>In some way, dYdX can be compared to Serum, the order-book-based DEX on Solana. They both use high TPS blockchain technology, while duplicating centralized exchange models. Both are highly dependent on big market makers: Wintermute, Amber, Kronos, Alameda, just to name a few. Market makers bring depth and seamless trading experience for end users, but also make the projects less decentralized and less crypto-native. Here we take a look at the other two decentralized perps mechanisms that don’t rely on order books or market makers.</p><h3>Perpetual Protocol</h3><p>Perpetual Protocol, the market leader before dYdX, uses a different pricing mechanism for perps. In dYdX, the mark price is generated from the order book; in Perpetual Protocol, there is no order book, and the market price is discovered from a <strong>virtual AMM</strong> (vAMM). A vAMM pool contains virtual assets, i.e., vDAI and vETH, and is ruled by x*y=k formula. The initial k is defined by the pool operator and can be changed arbitrarily. Buying a perp works as follows:</p><p>Alice deposits 100 DAI to Perpetual Protocol’s Vault (which is independent from the vAMM) and goes 10x long ETH. The protocol therefore “mints” 1000 vDAI and uses them to swap for vETH in the vAMM and credits them to Alice. Alice now holds vETH that is worth 1000 DAI. Note that vTokens are not real tokens in Perpetual Protocol V1, so “minting” is also a virtual concept.</p><p>Perpetual Protocol also uses funding rate to drive the mark price towards index price.</p><p>AMM has been the go-to option for order-book-less price discovery, and Perpetual Protocol manages to reflect leveraged trading through vAMM. The problem with Perpetual Protocol V1 is that the value of k is hard to determine: if k is low, slippage will be too high for organic traders; if k is set too high, then arbitrageurs will need a huge capital to move the price. With this in mind, Perpetual Protocol will launch its V2 called “Curie”. V1 lives on xDai, while Curie will be deployed on Arbitrum.</p><h3><a href="https://medium.com/perpetual-protocol/introducing-perpetual-protocol-v2-curie-730d3e9aa609">Curie</a></h3><p>The biggest innovation in Curie is that the vAMM is “actualized” and integrated with Uniswap V3. vTokens are minted as real tokens, either by traders or liquidity providers, and used to form swap pools on Uniswap V3. The incentive behind Curie is straightforward: k value used to be hard to determine, now it can be set by the market; large trades face high slippage in a constant-product AMM, now Uniswap V3 provides concentrated liquidity to lower slippage.</p><p>A potential problem with Curie is that the actualization of vAMM introduces liquidity providers (aka pooled market makers) to the system who will decide the k value. Whether this will enhance or worsen the UX is still unknown, considering Curie may not be able to attract enough LPs at the initial stage which translates into high slippage. Nonetheless, the obverse side of it is the LP mining incentive for individual users and decentralization of market making (yes, the magic phrase “liquidity mining”), which could get Curie more clout considering dYdX is dominated by big market makers and individual users can only stake their USDC for big MMs to use.</p><h3><a href="https://gmx.io/">GMX</a></h3><p>GMX is a perpetual and spot exchange deployed on Arbitrum. It has a forerunner <a href="https://gambit.financial/">Gambit</a>, which is on BSC. GMX utilizes a third mechanism for perpetual trading, which we call the “pooled counterparty” model. GMX allows users to purchase GLP tokens with tradable assets of the platform, such as ETH, USDC, LINK, etc., and become the counterparty of all trades on the platform. The gap between mark price and index price is eliminated at the beginning, since all perpetuals are purchased (or sold) for <strong>market price of underlying assets</strong> fetched by oracles.</p><p>The pooled counterparty model of GMX has eliminated half of the utility of <strong>funding rate</strong>. Remember a funding rate is used to drive mark price toward index price, which in GMX’s case, are always the same. An expected outcome from the lack of funding rate is that GMX will run without arbitrage activities, which is supposed to constitute a substantial part of the transactional volume of other perpetual exchanges.</p><p>The other half of the utility of funding rate is to control the net position of market makers. Imagine in a perpetual market where most traders are long ETH, the market makers will have to short a great amount of ETH, exposing themselves to the downside risk of ETH. In this case, the mark price would go up and pass the index price, making the longs to pay the shorts, as a way both to reduce the net short position of market makers, and to compensate for the risk they are taking. For GMX, however, since there is no funding rate,<strong> the pooled counterparty (GLP holders) is almost constantly exposed to a large net position</strong> (as for now, GLP holders are net short $14M ETH). This could be mitigated by collecting a different kind of “funding rate”, which directly links to net position of market makers (see <a href="https://docs.deri.finance/guides/trading#what-is-funding-fee">Deri Finance example</a>).</p><p>The biggest advantage of the pooled counterparty model is slippage-free perpetual trading. In AMM-based models, slippage is ever-present; and since markets are isolated from each other, so are the AMM pools, resulting in siloed liquidity, thus even higher slippage for long-tail markets. In GMX, liquidity is unified for all markets, and GLP holders become counterparties of all traders.</p><h3>Outlook</h3><p>dYdX is the market leader for now. But with the further development of the decentralized derivatives market, it’s unlikely to win every niche market. The order book model can satisfy traditional traders, but the accompanying binding with big market markers doesn’t quite suit DeFi degen’s taste. The pooled counterparty model largely solves the liquidity problem and the long-tail asset problem, but the net position management still needs improvement. A competitive advantage of the AMM model used by Curie is that it allows leveraged liquidity provision, just like leveraged trading.</p><h3>Useful links</h3><p>The cartoon guide to perps: <a href="https://www.paradigm.xyz/2021/03/the-cartoon-guide-to-perps/">https://www.paradigm.xyz/2021/03/the-cartoon-guide-to-perps/</a></p><p>Everlasting options: <a href="https://www.paradigm.xyz/2021/05/everlasting-options/">https://www.paradigm.xyz/2021/05/everlasting-options/</a></p><p>Perpetual swaps scan: <a href="https://mp.weixin.qq.com/s/NthZSf7XpztNvfNoYoqueA">https://mp.weixin.qq.com/s/NthZSf7XpztNvfNoYoqueA</a></p><p>dYdX token documents: <a href="https://docs.dydx.community/dydx-governance/">https://docs.dydx.community/dydx-governance/</a></p><p>dYdX FAQs: <a href="https://help.dydx.exchange/en/collections/2721747-perpetuals-on-l2">https://help.dydx.exchange/en/collections/2721747-perpetuals-on-l2</a></p><p>dYdX reduce market maker incentive discussion: <a href="https://forums.dydx.community/proposal/discussion/1805-reduce-market-maker-incentives">https://forums.dydx.community/proposal/discussion/1805-reduce-market-maker-incentives</a></p><p>Perpetual Protocol litepaper: <a href="https://docs.perp.fi/library/litepaper">https://docs.perp.fi/library/litepaper</a></p><p>Perpetual Protocol V2 “Curie”: <a href="https://medium.com/perpetual-protocol/introducing-perpetual-protocol-v2-curie-730d3e9aa609">https://medium.com/perpetual-protocol/introducing-perpetual-protocol-v2-curie-730d3e9aa609</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60b17c29c9d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/dydx-and-perpetual-swaps-60b17c29c9d5">dYdX and Perpetual Swaps</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Framework for GameFi Analysis]]></title>
            <link>https://medium.com/metaweb-vc/a-simple-framework-for-gamefi-analysis-cfa9a81974cf?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfa9a81974cf</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[near-protocol]]></category>
            <category><![CDATA[playtoearn]]></category>
            <category><![CDATA[gamefi]]></category>
            <category><![CDATA[axie-infinity]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Sat, 23 Oct 2021 14:52:47 GMT</pubDate>
            <atom:updated>2021-10-23T14:52:47.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*AIHkcDHXyLxSoOULxTiXPg.png" /></figure><p><em>Started by Axie Infinity, “play-to-earn” has become the single most important catalyst for blockchain gaming. A natural integration of DeFi and NFT games gives birth to GameFi. In this research we try to provide an analytical framework to study various kinds of blockchain games and their economic designs. Since NEAR as a blockchain is highly suitable for games, we expect high quality and sustainable games to be built on NEAR.</em></p><h3>Categorizing GameFi tokenomics</h3><p>In-game economy is not a new topic. It can be as simple as buying items in a Mario game, or as complex as growing your fleet and waging a war in EVE Online. No matter how complex the economy is, it’s only going to be “in-game”, which means while you can buy game items with real money, there is no other way round: there is no official channel for players to sell game assets for real money.</p><p>The emergence of blockchain and NFT has brought the other half of the loop to games. “Play-to-earn”, the mechanism promoted by Axie Infinity that encourages players to earn in-game tokens and sell them for money. While there are many different economic setups among NFT games, we abstract the skeleton mechanisms and analyze them in groups.</p><h3>Three components: NFT, medium, governance</h3><p>All NFT games we currently see have all or some of the following components in their tokenomics:</p><ul><li>NFTs. They represent in-game assets (Axies, heroes, land slots, etc.) which are the <strong>core</strong> <strong>of NFT games</strong>. Players buy NFTs using <strong>hard currencies </strong>like Ethreum in order to play the games.</li><li>Medium tokens. They serve as the in-game exchange medium. Players usually earn medium tokens in PvE or PvP battles or through other in-game activities. Medium tokens can be used to purchase accessory items and facilitate in-game operations.</li><li>Governance tokens. Some games adopt a <strong>DAO governance structure</strong> and issue governance tokens. Token holders usually have the right to vote on proposals and control game treasury, which consists of in-game tax on all activities.</li></ul><h3>Basic profit model</h3><p>The most fundamental profit model for NFT games is simply NFT selling and transaction fees. The game team mint NFT items, and sell them for ETH. All subsequent in-game trades of NFTs between players are subject to a substantial fee which is also collected by the team (or by the game treasury controlled by DAO). If the game NFTs and the game design are good enough, an NFT game can prosper without medium or governance token.</p><h3>Hard and soft medium</h3><p>By “hard medium”, we refer to <strong>ETH or major stablecoins like DAI</strong>. They are hard currencies that don’t exclusively belong to the game, which means players can safely earn those medium tokens without worrying about depreciation. On the other hand, since hard medium tokens are exogenous to the game, the game team has no control over their in-game monetary policy.</p><p>By “soft medium”, we refer to <strong>game-specific medium tokens</strong>, like SLP for Axie Infinity. Soft medium tokens are usually cap-less and whose remittance is fully controlled by the game team. The team can adjust the supply in whatever way they see appropriate. Soft medium tokens have no intrinsic value.</p><h3>Play-to-earn incentive</h3><p>If you write “play-to-earn” on your website, then players will come to your game, not for fun, but to earn. Players have to buy NFTs with hard currencies in order to play the game, which is a different type of “entrance fee”. What they earn through game play in return, are <strong>medium tokens</strong>. Therefore, a rational player would want to sell earned medium tokens as soon as possible to reach the <strong>breakeven point</strong>. After that, he can play on the house money if he wants.</p><h3>Hard medium</h3><p>Some games use hard medium tokens, giving up the direct control over in-game economy. The income of the game, therefore, is fully driven by new demand on NFTs and economic effects of game mechanisms. Examples of hard medium games:</p><h3><a href="https://zed.run/">ZED RUN</a></h3><p>ZED RUN is an on-chain horse racing game. Players buy and breed horses with ETH, and participate in races. They can earn ETH by winning races, resell horses, stake their horses and share breeding fees, etc. ETH is the one and only medium in ZED RUN.</p><h3><a href="https://www.leagueofkingdoms.com/">League of Kingdoms</a></h3><p>League of Kingdoms (LoK) is an MMO strategy game. The major NFTs in LoK are land slots, which can be bought with ETH. DAI is the in-game medium token, which will be used for in-game purchase, and for paying the land owners their take. For land NFT owners, they spend ETH, and earn DAI as income.</p><h3>Soft medium</h3><p>More games use soft medium gokens, which means the game team mint a new token that’s specific for the game and fully controlled by the team. In this case, players still spend ETH or other hard currencies to play the game, but their earnings are in the form of a soft medium. An example of soft medium games is F1 Delta Time.</p><h3><a href="https://www.f1deltatime.com/">F1 Delta Time</a></h3><p>F1 Delta Time is an F1 car racing game. Players can buy NFTs (cars, keys, etc.) with ETH or credit card, and their earnings are in the form of REVV token, a soft medium token whose total supply is capped at 30B.</p><h3>Medium as governance</h3><p>Not all NFT games have governance tokens. After all, games require frequent iteration and swift upgrades, which may not suit a DAO structure, unlike DeFi protocols which can stay unchanged for relatively longer periods of time. Nonetheless, there are still many games who adopt DAO, and issue governance tokens, which makes them much closer to the “Fi” part in GameFi. Medium tokens can be used for governance too.</p><h3><a href="https://www.illuvium.io/">Illuvium</a></h3><p>Illuvium is an open world RPG game, where players purchase in-game items with ETH and subdue “illuvials”. The medium and governance token for Illuvium is ILV, part of which will be allocated as gaming reward.</p><h3>Soft medium plus governance</h3><p>This is probably the mechanism that people are most familiar with, the dual-token system: games issue soft medium tokens, and launch DAO with a different governance token. Examples including some of the most popular play-to-earn games:</p><h3><a href="https://axieinfinity.com/">Axie Infinity</a></h3><p>Players purchase “Axies” with ETH, enter PvE and PvP battles, and earn SLP, the in-game medium token. AXS serves as the governance token of Axie Infinity, which is only used in Axie breeding.</p><h3><a href="https://splinterlands.com/">Splinterlands</a></h3><p>Splinterlands is a turn-based digital trading card game similar to Yu-Gi-Oh. Players buy card packs with hard currencies, in return they could earn in-game medium token “Dark Energy Crystals (DEC)”. The governance token for Splinterlands is SPS.</p><h3><a href="https://staratlas.com/">Star Atlas</a></h3><p>Star Atlas is a space-themed game built on Solana. It hasn’t been released yet, but both of its tokens are being traded actively. It has an in-game medium token ATLAS, together with governance token POLIS. ATLAS will be players’ reward.</p><h3>Economic system failure</h3><p>The key question for all play-to-earn games to answer is, how does a game allow <strong>continuous earnings for players</strong> without the team giving out money. We know that almost all NFT games get their first pot of gold by selling NFTs, which guarantees that the team gets a substantial money reward at the launch of the game. After that, players enter the game, and they seek for earnings. For hard medium games, this is quite straightforward: older players earn extra money that’s contributed by newer players. For example, in ZED RUN, you can resell your horse for a higher price, or collect breeding fees by staking them. Newcomers bring more ETH to the system to benefit everyone.</p><p>For soft medium games, things become more complicated. Ultimately, earnings are still brought by new demand, but there exists one more layer of mechanism: the soft medium token. For example, in Axie Infinity, the in-game currency SLP has no supply cap, whose emission is under full control by the team. SLPs can be earned by completing in-game tasks, and have to be burnt when breeding Axies. If there is a strong demand in Axies, which means a lot of new players want to enter the game, the price for Axies (denominated in ETH) will rise, which makes breeding Axies more profitable, resulting in an increasing demand for SLPs, pushing the price up. At last, new players earn SLPs and sell them to cover their sunk cost.</p><h3>Feedback failure</h3><p>A big advantage of soft medium games is that they can <strong>bootstrap</strong> the game much faster even if the demand is not that strong. Since the medium token is issued by the game team, it’s not hard to manipulate the token price at the early stage of the game to attract new players. While for hard medium games, teams have no such <strong>easy monetary instruments</strong> to create earnings from nowhere.</p><p>It all looks good until new demand begins to fade. Once there is less new demand, the <strong>constant selling pressure</strong> on the soft medium token starts to dominate the tokenomics. Players want to sell tokens as soon as possible to secure their earnings, dragging the price down, once again reducing the incentive for new players to join. The game team, as the central bank in this case, still has the monetary instrument. However, they now face a dilemma: reducing the supply may further deter new demands, while increasing the supply would make the price even lower. The recent price trajectory of SLP is quite interesting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Qz8GcH0yd-uHbI6" /><figcaption><em>SLP (Axie Infinity in-game currency) price</em></figcaption></figure><p>Beginning from late July, the price of SLP has been demonstrating a periodic pattern while going down. It can somehow be related to the 14-day lockup period for every player between two SLP withdrawals. For soft medium games, decreasing demand means monetary policy failure.</p><h3>Siloed dual token system</h3><p>Governance token and soft medium token form a dual token system. In reality, medium tokens are the income source for players, while governance tokens are often the biggest cash reward to the teams. The two kinds of tokens are inherently different in terms of value derivation and governance goal (unless they are the same token, like Illuvium). In theory, the value of soft medium tokens fully depends on players’ belief in the future demand of the game and the economic system, which means there is no “real” value source. Governance tokens, instead, are supposed to <strong>capture the value of the whole game</strong>, since in theory you can own the game by owning all governance tokens. No room is left for soft medium tokens. Therefore, the dual token system is actually quite siloed. On one hand, players have no incentive to hold medium tokens — their income — because of the insecure value derivation. They simply want to cash out and turn those tokens into hard currencies. On the other hand, governance tokens become a DeFi project for their holders, who don’t have to be players at all.</p><h3>The “play-to-earn” curse</h3><p>Play-to-earn is the single most important boost behind NFT games. However, the gifts of fate come with a price. After all, players are essentially earning money from newer players, who come with the desire to earn money from even newer players…… “Ponzi” is a dreadful word, but many projects, especially non-gaming projects, took advantage of it to bootstrap, and finally reach a healthy state where the projects create endogenous value to benefit users. The question left for play-to-earn games is, then, will they ever create endogenous value for players? The only endogenous value a game can provide is fun.</p><h3>The only long game is play-for-fun</h3><p>Earning is not a new incentive in games. Before blockchain and NFT, assets from certain games have already sold for millions of dollars, which obviously have attracted play-to-earn players. However, “earn” has always been the secondary slogan until now. We see organizations like YGG who treat play-to-earn as a real job and organize players like a sharecropper labor union. It’s indeed questionable whether such a mechanism is sustainable. We very much look forward to fun games on blockchain that urge players to play for fun.</p><h3>Useful links</h3><p>YGG portfolio: <a href="https://medium.com/yield-guild-games/ygg-10-games-were-invested-in-f1e7b452565f">https://medium.com/yield-guild-games/ygg-10-games-were-invested-in-f1e7b452565f</a></p><p>a16z investment in YGG: <a href="https://a16z.com/2021/08/19/investing-in-yield-guild-games/">https://a16z.com/2021/08/19/investing-in-yield-guild-games/</a></p><p>Coinbase article on play-to-earn: <a href="https://blog.coinbase.com/axie-infinity-yield-guild-games-the-play-to-earn-economy-e73ac6b39e6c">https://blog.coinbase.com/axie-infinity-yield-guild-games-the-play-to-earn-economy-e73ac6b39e6c</a></p><p>Is Axie Infinity sustainable: <a href="https://axiepulse.substack.com/p/is-axie-infinity-sustainable">https://axiepulse.substack.com/p/is-axie-infinity-sustainable</a></p><p>Dual-token game economy: <a href="https://medium.com/league-of-kingdoms-eng/utility-tokens-5c035ca51cb4">https://medium.com/league-of-kingdoms-eng/utility-tokens-5c035ca51cb4</a></p><p>Axie Infinity economic model: <a href="https://www.chainnews.com/articles/233233113955.htm">https://www.chainnews.com/articles/233233113955.htm</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfa9a81974cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/a-simple-framework-for-gamefi-analysis-cfa9a81974cf">A Simple Framework for GameFi Analysis</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MEV: Capturing the “Necessary” Evil?]]></title>
            <link>https://medium.com/metaweb-vc/mev-capturing-the-necessary-evil-6186b92ff15?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/6186b92ff15</guid>
            <category><![CDATA[frontrun]]></category>
            <category><![CDATA[near-protocol]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[black-forest]]></category>
            <category><![CDATA[miner-extractable-value]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Fri, 22 Oct 2021 10:32:56 GMT</pubDate>
            <atom:updated>2021-10-22T10:32:56.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*EuXxwLlbjAGYoFJVYfPJaA.png" /></figure><p><em>Eden Network recently got seed investment from major crypto VCs, bringing the MEV topic to the front stage again. MEV was first noticed in 2019, better researched in 2020, and sees more solutions in 2021. We would like to revisit the concept of MEV in the context of new blockchains and L2 solutions, and conduct a brief comparative analysis of different MEV solutions.</em></p><h3>The origin of MEV</h3><h3>Blockchain architecture</h3><p>We all know that blockchain is a distributed ledger, where each (full) node keeps a local copy of the ledger, bundles transactions into blocks, and broadcasts the new block to other nodes. After other nodes validate the new block, they update their local copy of the ledger according to the transactions included in the new block. This architecture ensures that all transactions are valid, and new blocks of transactions are continually produced.</p><p>A key component that’s missing is <strong>objectivity</strong>. Usually this is provided together with authority by a centralized entity. When you trade on a centralized exchange, the exchange’s server <strong>knows </strong>that your transaction comes <strong>earlier </strong>than mine, and it’s going to execute your transaction before mine. On a blockchain, however, there is no objective entity that records the order of transactions (since blockchain is trustless). Therefore, a node can arbitrarily order transactions within a block, and there isn’t actually a guarantee that transactions will be ordered in the exact manner they were submitted to the blockchain.</p><h3>Ordering is everything</h3><p><strong>Miner Extractable Value (MEV) is a measure of the profit a miner (or validator, sequencer, etc.) can make through their ability to arbitrarily include, exclude, or re-order transactions within the blocks they produce</strong>.</p><p>MEV is a neutral word. In theory, it represents the <strong>total definitive profit</strong> generated by a blockchain system in a given time period. By “definitive”, we are talking about profits from price arbitrage and liquidation that aren’t subject to future asset price — a successful arbitrage between two exchanges can give you guaranteed profit regardless of the price fluctuations afterwards. The value is “miner-extractable” because theoretically miners can find a profitable unexecuted transaction — i.e., a rare arbitrage opportunity — that’s broadcasted to his node, choose to ignore this transaction, and do the arbitrage by himself.</p><p>In reality, there are countless MEV bots wandering in the Ethereum mempool (where nodes store unexecuted transactions) and try to extract the value, by paying a higher gas fee to the miner so that their transactions can be executed before the original ones.</p><p>A classical kind of “MEV exploit” is “sandwich attack”. Below is a perfect example where the victim is the famous “Alameda”:</p><p>First, one of the MEV bots found a huge AMM swap transaction (swap 34 ETH for UNN) submitted by Alameda. It knew that this would increase the price of UNN.</p><p>Then, the MEV bot submitted a <a href="https://etherscan.io/tx/0xdb9fe3f3799036555775bbd912d30283c1815e805c8f2439076b7689c8420f00">similar swap transaction</a> and managed to get it executed before Alameda’s, even though it’s submitted later. This is the first piece of bread in a sandwich.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0KVKP6JPIf1sVhIW" /><figcaption><em>First piece of sandwich bread</em></figcaption></figure><p><a href="https://etherscan.io/tx/0x9454d233f700dbc43ca22699f58e69629776ba4c095ebd27eb5d30d4f9b6fff6">Alameda’s transaction</a> was then executed. Since the previous MEV transaction pushed UNN price higher, Alameda experienced a higher slippage, and got fewer UNN than expected. Alameda’s transaction is the tuna for the sandwich.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AsmR2UMkh4Re0gRj" /><figcaption><em>“Tuna” for the sandwich</em></figcaption></figure><p>Finally, the MEV bot <a href="https://etherscan.io/tx/0x473820134d9b9f3ba44b3db9a97f52c90a66afbb8324e8827726b3b3e387ad17">swapped</a> the UNN back for ETH. Since UNN price was pushed even higher by Alameda’s transaction, the MEV bot got more ETH back. This is the second piece of bread in the sandwich. The MEV exploiter secured a 4.67 ETH net gain from this attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8WBHJwUAMsbljQGQ" /><figcaption><em>Second piece of sandwich bread</em></figcaption></figure><p>MEV bots normally pay <strong>higher gas fees</strong> in order to get their transactions executed. It’s worth noticing that in our example, the first transaction cost nearly zero gas fee, while the last transaction paid 4.6 ETH to the miner, which indicates that this sandwich attack was likely done by the miner himself.</p><h3>MEV problems</h3><p>MEV is a neutral concept, as arbitrage and liquidation are an organic and crucial part of the ecosystem. It’s only when MEV is extracted in a way which undermines the user experience and total surplus of the system that we consider it as a problem. For example, the sandwich attack which caused Alameda a higher slippage, or an MEV searcher front-running oracle price update to get unfair advantage over all other users.</p><h3>Gas war and slippage</h3><p>MEV searchers compete with each other with higher gas fees in order to get their transactions executed by the miner. This “gas war” results in soaring gas fees for ordinary users.</p><p>Higher slippage caused by front-running and sandwich attack, as we see in Alameda’s case.</p><h3>Bad bots drive out the good</h3><p>There are “good bots” living on Ethereum who arbitrage between exchanges so that prices reach equilibrium and liquidate default positions so that debt risk is resolved. Building those bots requires considerable effort. On the other hand, MEV bots can simply front-run the good bots and extract the profit. This may disturb the normal ecosystem and discourage good bots.</p><h3>Chain re-organization</h3><p>If the MEV available in a block significantly exceeds the standard block reward, miners may be incentivized to re-mine blocks and capture the MEV for themselves, causing blockchain re-organization and consensus instability.</p><h3>MEV in different blockchains</h3><h3>Ethereum</h3><p>Ethereum is most heavily plagued by MEV problems because of two things: its complexity, and mempool-block waiting time. The Ethereum ecosystem is by far the most complex among all blockchains, especially on DeFi and NFT, which means way more MEV opportunities than other simpler chains, for example, Bitcoin. The 15 seconds block time and the fact that transactions are gossiped among nodes (thus entering the public mempool) before getting included in a block make it easier to monitor all Ethereum pending transactions. MEV bots have plenty of time to identify potentially profitable transactions, replay them locally to validate the profitability, and submit their own transactions to the network — all done before a new block is produced.</p><h3>Rollups</h3><h3>Optimistic rollups</h3><p>In optimistic rollup solutions like Arbitrum and Optimism, validators only get to choose what transactions to include/exclude. The ordering of transactions, instead, is done by a sequencer node. The sequencer then uploads a fraud proof of the ordered transaction bundle to Ethereum mainnet, and all transaction execution is done on layer 2. The separation of the authority of sequencing from the authority of including has essentially stripped MEV access from nodes, and concentrated it to the sequencer. Therefore, “who controls the sequencer” becomes an inevitable question. The answer from Optimism is “<strong>MEV Auction</strong>”: transaction ordering power of a given block will be sold to the highest bidder, who can then maximize the MEV he or she gets from this block. Arbitrum takes a different approach, by which transactions will be ordered according to a “<strong>fair ordering</strong>” algorithm that sequences transactions by certain criteria. In fact, it is possible for optimistic rollups to completely abandon transaction ordering, at the cost of latency on L1, to <strong>eliminate MEV completely</strong>.</p><p>Currently, both Arbitrum and Optimism teams are running their sequencers, therefore not fully decentralized.</p><h3>Zero-knowledge rollups</h3><p>Currently in ZK-rollup solutions like StarkWare and zkSync, validators compute zero-knowledge proof for transactions and send them to Ethereum mainnet. There are no explicit rules for transaction ordering, so MEV still exists; nonetheless, it’s possible for ZK-rollups to embed a universal ordering algorithm into the proof-generating process so as to eliminate MEV. It is a similar logic with Arbitrum’s fair ordering which re-introduces <a href="https://docs.google.com/document/d/1MyH51MmgLv30ay6s0-N9UZ-qs3qLyDuT3mne9XyZzjM/edit#heading=h.rph9ynmwmedb">objectivity</a> to blockchains.</p><h3>Novel public blockchains</h3><h3><a href="https://near.org/">Near</a></h3><p>Remember that MEV depends on blocktime and transaction visibility to both the public and the nodes. On NEAR blockchain, the average block time is about 1 second, which means the time left for MEV searchers to identify, test, and submit lucrative transactions is little. Moreover, as the only <strong>natively-sharded blockchain</strong>, NEAR’s architecture makes MEV exploitation extremely difficult because an MEV searcher would have to be able to track all shards of NEAR in order to make sure that his/her transactions would be successful. Therefore, MEV exploitation is only theoretically present in NEAR, but minimized in reality.</p><h3>Solana</h3><p>Solana introduces a novel component into its consensus mechanism, which is “Proof of History (PoH)”. Every transaction will have a proof or timestamp generated by a Verified Delay Function (VDF) which proves that a certain period of time has elapsed since the creation/submission of the transaction. The PoH is used for nodes to universally agree on the sequence of events on Solana, therefore the classical MEV doesn’t seem to exist on Solana.</p><h3>How Eden approaches the problem</h3><p>Eden Network, formerly known as ArcherDAO, is a protocol aiming at regulating MEV extraction in a decentralized manner, and reducing MEV negative externalities. The core feature of Eden Network is its Eden token system. Essentially, Eden network wants to <strong>incentivize miners to order transactions according to the amount of Eden tokens each user is willing to stake/pay, and reward miners with Eden token release</strong>. In it’s vision, all MEV will be captured by EDEN tokens, which is then distributed fairly to miners. Eden Network has its own Ethereum client, eden-geth, which is a fork of MEV-geth by <a href="https://docs.google.com/document/d/1MyH51MmgLv30ay6s0-N9UZ-qs3qLyDuT3mne9XyZzjM/edit#heading=h.iymbfjxhbk0g">Flashbots</a>, that enables miners to order transactions according to Eden’s rules, and produce “Eden blocks”.</p><h3>Capturing all MEV with Eden token</h3><h3>Slots auction</h3><p><strong>Slot</strong> is a new class of transactions that get priority above all other transactions in Eden Network block producers’ blocks. There are 3 slots in every Eden block, each with a maxim gas limit of 1.5M. Users (called “slot tenants”) reserve these slots via a continuous auction mechanism known as a Harberger tax, which tax slot tenants on a linear basis tax rate of 3.3% everyday. A slot tenant loses claim to the slot after all prepaid rent is consumed, which is about 30 days. A slot tenant can be outbid by another user anytime. In this case, the outbid tenant can either increase his bid, or forgo the claim to the slot and take back the remaining rent.</p><h3>Transaction bundles auction</h3><p>Block producers are also allowed to accept transaction bundles. Bundles are included after any priority queue transactions, but before transactions from regular Ethereum/Eden users. There is an overall gas limit for bundles (4M). The transaction bundle auction is a mature mechanism developed by Flashbots, which is widely used by arbitrageurs liquidators. In Eden Network, transaction bundles only have second-tier priority compared to slots, which means the system naturally favors big MEV extractors (who are willing and able to pay for the slot rents for at least 30 days) over medium ones.</p><h3>Eden staking</h3><p>Regular users are able to stake EDEN in exchange for transaction ordering priority and extra transaction handling options. Regular transactions (whether from the Eden network or public mempool) will be ordered first by staked EDEN balance then by ETH tip, and they will come after the priority queue transactions + transaction bundles. Users must stake a minimum of 100 EDEN in order to gain the benefit of special transaction handling options. Transactions submitted directly to the <strong>Eden Network relay </strong>by users with at least the minimum stake will not be gossiped to other nodes to provide for enhanced privacy and attack protection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d9yeHTWx2zFqgBhq" /><figcaption><em>Structure of an “Eden block”</em></figcaption></figure><h3>Unsolved questions</h3><p>Since its token launch, Eden Network has incurred considerable doubt. Although it claims that more than 50% of total hash power of Ethereum network is now mining Eden blocks, it’s unclear what’s Eden block’s share among all blocks produced, since miners can freely switch between producing Eden blocks and normal (or Flashbots) blocks with no cost. From a pure economic view, the following problems seem to be still present in Eden’s current structure.</p><h3>Slot auction: smoothen the un-smoothable?</h3><p>Slot auction in Eden block is meant to “institutionalize” MEV extraction, where some huge arbitrageurs and bot runners, and also DeFi protocols that don’t want to be attacked, are supposed to rent the slot and make the best use of it. The reality is, however, MEV is highly volatile, which means a rational MEV extractor cannot determine whether it’s worth it to bid a big amount of Eden for unpredictable MEV value for the next 30 days. At the same time, miners are forced to accept the auction result, which may let them earn much less than normal if the MEV value is actually high for the next period. This could explain why Eden slot auction is not hot.</p><h3>Transaction bundles: second-tier Flashbots?</h3><p>The problem with transaction bundle auction in Eden Network is that transaction bundles no longer enjoy the top priority. Instead, they are constantly executed after slots. For those who can’t afford slot auctions, they have to face the risk that their transaction bundles, and the underlying MEV opportunities, are actually executed by slot tenants before them. Therefore, medium MEV extractors will either be discouraged from the ecosystem, or simply use Flashbots instead.</p><h3>Stake Eden: institutionalized sandwich attack?</h3><p>For average Ethereum users, “staking 100 EDEN so that your transactions won’t be sandwiched” may sound attractive. But there are two problems with it. First, private transaction is a service already provided by Flashbots, Taichi minepool, and other private relay providers, which doesn’t require staking any token. Eden Network is providing a permissioned version of a permissionless service. Second, <strong>staking Eden doesn’t protect you from being sandwiched</strong>: the MEV attacker can simply stake more EDEN in their accounts, or pay a higher ETH tip. Front-running and sandwich-buy are actually made easier by Eden.</p><h3>Neutral MEV regulating vs. Bad MEV prevention</h3><p>The distinction between regulating neutral MEV (arbitrage, liquidation, etc.) and preventing bad MEV (front-running, sandwich attack, etc.) is sometimes neglected in the discussion of MEV solutions. For the former, the focus should be <strong>isolating</strong> MEV extraction from other on-chain transactions so that there won’t be a gas war that hurts every user. For the latter, however, the only fundamental solutions are transaction privacy and universal objectivity: it’s impossible to sandwich a transaction if it’s not even visible to you, or miners don’t have the power to order transactions at all. Eden Network’s solution to the former is still perplexed by the abovementioned problems, which goes on to affect its solution to the latter.</p><h3>Other solutions</h3><p>There are other solutions to the MEV problem. We categorize them into four groups.</p><h3>Separation and auction</h3><p>This group of solutions separates neutral MEV extraction from ordinary transactions. Therefore, average Ethereum users will be isolated from the gas war and the resulting soaring gas fee. The most classical solution of this kind is Flashbots.</p><h3>Flashbots</h3><p>Flashbots provides a unique type of Ethereum client (mev-geth) that enables transaction bundle auctions. Users can send their transaction bundles to mev-geth without being exposed to public mempool. The ordering of bundles is then determined by an auction among all users, denominated by ETH.</p><h3>Private mining pool</h3><p>There are mining pools stating that they don’t expose users’ transactions to the public mempool, so that users can directly send transactions to their nodes without worrying about being front-run. One of the most famous private mining pools is Taichi, which has been used by Samczsun to <a href="https://samczsun.com/escaping-the-dark-forest/">escape from the dark forest</a>.</p><h3>Private transaction</h3><p>An intuitive response to MEV is to hide the transaction content from the public, and this is indeed possible. There are protocols like Libsubmarine that allows users to reveal the content of their transactions only after it’s been included in a block.</p><h3>Objectivity</h3><p>Someone wants to deprive nodes the right of sequencing. As what we see in certain L2 and new blockchains, technologies like Chainlink’s Fair Sequencing Service (FSS) and Verified Delay Function (VDF) are used to introduce objectivity to blockchain infrastructure.</p><h3>Useful links</h3><p>Ethereum is a Dark Forest: <a href="https://medium.com/@danrobinson/ethereum-is-a-dark-forest-ecc5f0505dff">https://medium.com/@danrobinson/ethereum-is-a-dark-forest-ecc5f0505dff</a></p><p>Escaping the Dark Forest: <a href="https://samczsun.com/escaping-the-dark-forest/">https://samczsun.com/escaping-the-dark-forest/</a></p><p>Flashbots: <a href="https://medium.com/flashbots/frontrunning-the-mev-crisis-40629a613752">https://medium.com/flashbots/frontrunning-the-mev-crisis-40629a613752</a></p><p>Paradigm article: <a href="https://research.paradigm.xyz/MEV">https://research.paradigm.xyz/MEV</a></p><p>Dragonfly article: <a href="https://medium.com/dragonfly-research/we-live-in-a-mempool-backrunning-the-mev-crisis-a4ea0b493b05">https://medium.com/dragonfly-research/we-live-in-a-mempool-backrunning-the-mev-crisis-a4ea0b493b05</a></p><p>MEV auction philosophy: <a href="https://ethresear.ch/t/mev-auction-auctioning-transaction-ordering-rights-as-a-solution-to-miner-extractable-value/6788">https://ethresear.ch/t/mev-auction-auctioning-transaction-ordering-rights-as-a-solution-to-miner-extractable-value/6788</a></p><p>MEV Auction debate: <a href="https://medium.com/offchainlabs/meva-what-is-it-good-for-de8a96c0e67c">https://medium.com/offchainlabs/meva-what-is-it-good-for-de8a96c0e67c</a></p><p>MEV on Ethereum: <a href="https://ethereum.org/ca/developers/docs/mev/">https://ethereum.org/ca/developers/docs/mev/</a></p><p>MEV smoothing proposal: <a href="https://ethresear.ch/t/committee-driven-mev-smoothing/10408">https://ethresear.ch/t/committee-driven-mev-smoothing/10408</a></p><p>Mempool basics: <a href="https://dyor-crypto.fandom.com/wiki/Mempool">https://dyor-crypto.fandom.com/wiki/Mempool</a></p><p>Solana on mempool: <a href="https://medium.com/solana-labs/gulf-stream-solanas-mempool-less-transaction-forwarding-protocol-d342e72186ad">https://medium.com/solana-labs/gulf-stream-solanas-mempool-less-transaction-forwarding-protocol-d342e72186ad</a></p><p>Sealed-bid MEV auction: <a href="https://ethresear.ch/t/mev-sgx-a-sealed-bid-mev-auction-design/9677">https://ethresear.ch/t/mev-sgx-a-sealed-bid-mev-auction-design/9677</a></p><p>Regarding Eden’s economy: <a href="https://twitter.com/bertcmiller/status/1435686488725934101">https://twitter.com/bertcmiller/status/1435686488725934101</a></p><p>Grug capital research: <a href="https://www.chainnews.com/articles/574175057859.htm">https://www.chainnews.com/articles/574175057859.htm</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6186b92ff15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/mev-capturing-the-necessary-evil-6186b92ff15">MEV: Capturing the “Necessary” Evil?</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into Decentralized Storage: IPFS, Filecoin and Arweave]]></title>
            <link>https://medium.com/metaweb-vc/a-brief-deep-dive-into-filecoin-313e8badc504?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/313e8badc504</guid>
            <category><![CDATA[arweave]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[decentralized-storage]]></category>
            <category><![CDATA[filecoin]]></category>
            <category><![CDATA[near-protocol]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Mon, 11 Oct 2021 13:28:00 GMT</pubDate>
            <atom:updated>2021-10-18T08:26:10.406Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ZWI9nX1frGHwINpZyEm9hA.jpeg" /></figure><p><em>Decentralized storage is a vital layer in the decentralized future that has not been receiving as much attention as the application and consensus layers. Nonetheless, NEAR prioritizes the storage layer because of its high importance. Recently, NEAR launched </em><a href="https://near.org/blog/filecoin-launches-collaboration-with-near-to-accelerate-the-growth-of-the-web3-stack/"><em>collaboration</em></a><em> with Filecoin to enable native utilization of Filecoin storage by NEAR smart contracts and users. This article analyzes Filecoin’s technology and economic model, and conducts a comparison with Arweave, another major decentralized storage protocol.</em></p><h3>Background</h3><p>Filecoin is an incentive layer built upon IPFS, a decentralized data storage technology, that provides end users with contract-based storage service (just like AWS and Ali Cloud). It currently possesses around <strong>10EiB</strong> storage space, or 0.01% of the total data size of the world, provided by more than 3000 active miners.</p><h3>How does Filecoin store data?</h3><h3>IPFS</h3><p>InterPlanetary File System (IPFS) is a peer-to-peer distributed data storage and sharing protocol, including a suite of systems encompassing peer-to-peer node connection, data transfer, content addressing, etc. IPFS has already been adopted by many users and websites to store data (for example, Library Genesis).</p><p>IPFS is the underlying storage layer of Filecoin. <strong>All Filecoin nodes are IPFS nodes</strong>.</p><h3>Sectors</h3><p>The sector is the default unit of storage that miners put in the network (currently 32GBs or 64GBs). Miners commit sectors to Filecoin for a fixed period of time, where multiple users can store their data within multiple deals.</p><h3>Proofs</h3><h3>Proof of Replication (PoRep)</h3><p>Once a client has reached a deal and transferred the data to the miner, a sealing process begins. After the sector(s) containing client’s data have been sealed, the miner can prove to the Filecoin network that they have created <strong>a unique copy </strong>of some piece of data on the network’s behalf with Proof of Replication. PoRep is a <strong>one-time</strong> zero knowledge proof.</p><h3>Proof of Spacetime (PoSt)</h3><p>Once a deal is active and during its full lifetime, the miner has to prove that it is still storing the data associated with a deal. For at least one time every 24 hours, the miner will be asked to demonstrate that he has access to <strong>a randomly selected subset</strong> of the client’s data, which is the Proof of Spacetime. PoSt is also based on zero knowledge proof, and will be conducted regularly throughout the deal’s lifetime.</p><h3>How do Filecoin miners mine?</h3><h3>Storage</h3><p>Miners can mine FIL by storing clients’ data — which is the core functionality of Filecoin — and earn <strong>storage fees</strong>. Each data storage deal is negotiated off chain between the client and the miner, so that storage fees could fluctuate from deal to deal. The current average storage cost on Filecoin is 0.0000053 USD/GiB/Month, or around 0.04% of Amazon’s price. Please note that the current price could be impacted by Filecoin subsidies and tokenomics and may not reflect the real market dynamics.</p><h3>Collateral</h3><p>For every sector added, the miner has to commit some <strong>pledge</strong> (denominated in FIL), which will be slashed if the miner does any malicious behaviors such as failing to provide PoSt or quitting before the end of a deal. It can be understood as a different form of PoS. A miner must commit two times: first when they add a new sector to the system (initial pledge), second when the sector is filled by deals (storage deal collateral). The current initial pledge is 0.1668 FIL/32GiB. The current total pledged collateral is <strong>108,055,729 FIL</strong>, or 5.4% of the total supply and 1.05 times of circulating supply.</p><h3>Block production</h3><p>Miners can mine FIL by producing new blocks on Filecoin blockchain and earn block rewards, just like on any other blockchains. Note that block production is different from storage, and a miner can choose to only store data but not participate in block production (though this is very rare).</p><p>Block reward is divided into <strong>simple minting and baseline minting</strong>. For details please check the <a href="https://docs.google.com/document/d/1QOh4Fpdgdorw-l1je5vi6renpPJdARJNUGEEax9wUwE/edit#heading=h.wfq1snhsb2nh">tokenomics</a> section. The current block reward is <strong>24.1551 FIL</strong>. In the current stage, block reward is the <strong>major incentive</strong> for miners, since the number of deals on Filecoin is still limited.</p><h3>Consensus mechanism</h3><p>Storage Power Consensus (SPC) is the main interface which enables Filecoin nodes to agree on the state of the system. SPC is in a way similar to PoS, only that “stake” should instead be “<strong>quality-adjusted storage power</strong>”. For a Filecoin miner, the probability of earning the block reward and transaction fees is proportional to the amount of storage the miner contributes to the Filecoin network. If you contribute 1% of quality-adjusted storage of Filecoin, then you can expect to be selected as the producer of 1% of Filecoin blocks.</p><h3>Retrieval</h3><p>Miners can mine FIL by retrieving clients’ data at request. Retrieval is like a <strong>mirror process of storage</strong>: each data retrieval deal is negotiated off chain between the client and the miner. A payment channel (which is off chain) will be established between the client and the miner for fee payment, of which proofs will be uploaded on chain.</p><h3>Tokenomics</h3><h3>Token allocation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lS44MWXyy-gDuP_M" /></figure><h3>Minting model</h3><p>As mentioned earlier, Filecoin’s block reward is split into simple minting (30% of total mining reward allocation) and baseline minting (70% of total mining reward allocation).</p><h3>Simple minting</h3><p>Simple minting follows a<strong> simple exponential decay</strong> model which favors early adopters. Bitcoin uses a similar though not the same model for block rewards:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BHNmdf-1bFvuoN5N" /></figure><p>Simple minting can help attract miners at the beginning of the blockchain, but may discourage subsequent miners due to lowered rewards.</p><h3>Baseline minting</h3><p>Baseline minting softens the exponential decay model at the early stage and <strong>incentivizes participation</strong> in the long run. If Filecoin’s capacity is below the network baseline (1EiB at the beginning, growing 200% every year), baseline minting will <strong>hold back</strong> some of the block rewards, resulting in lower total block reward. Once Filecoin’s capacity exceeds the baseline, baseline minting will be fully released and the overall minting model will become simple exponential decay.</p><h3>Implications</h3><p>Filecoin has already passed the network baseline in May 2021, so that its block reward is being released at full speed. This brings the network to its second stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*IpRvCcNdzw6MSPCQ" /></figure><p>Block reward starts to decline at stage 2, prompting miners to provide more capacities to clients and make storage fees a major part of their income, then reach stage 3. Whether Filecoin can accomplish this transition is the key to its success.</p><p>A key feature of Filecoin’s economic model is that miners need to put collateral for every GB of storage space they commit to the network. <strong>In the long run this will create a consistent demand for FIL and direct a substantial portion of block reward to storage collateral, since the storage power of Filecoin is likely to grow. Combined with exponential decay of block reward, this underpins FIL price in the long run.</strong></p><h3>Comparison with Arweave</h3><p>Arweave is another distributed storage protocol. It’s primary goal is to provide permanent storage (i.e., pay once for 200 years) of information and establish a “<strong>permaweb</strong>” which resides upon Arweave. Permaweb is just like World Wide Web, except that all information is stored permanently and cannot be deleted.</p><p>Filecoin and Arweave are fundamentally different regarding goals, target markets, and economic models. External clients, who are currently using AWS or Google Could, will be Filecoins’ primary customers, while native applications on permaweb will be the long-term pillar for Arweave. Nonetheless, neither protocol has acquired enough data to store, and blockchain-generated data could be the next battlefield for both. Below is a detailed comparison.</p><h3>Storage and blockchain</h3><h3>Storage layer</h3><p>The Arweave network builds on content distribution mechanisms utilized in BitTorrent and other peer-to-peer file-sharing networks. Similar to Filecoin, it’s an <strong>incentive layer</strong> built upon an existing storage layer.</p><h3>Blockchain and consensus mechanisms</h3><p>Note that Arweave is fundamentally different from Filecoin in terms of redundancy: Filecoin clients specify how many extra copies they want miners to store, and pay for each copy. In contrast, Arweave uses consensus mechanism to <strong>automatically incentivize miners to store redundant data</strong>. The process of mining in the Arweave network is designed to increase the number of replications of the dataset as much as possible</p><p>Arweave uses <strong>Proof of Access</strong> (PoA) mechanism to determine block producers. In order to produce a block, a miner must prove that he has access to a randomly selected old block (recall block). Therefore, rational miners will choose to store copies of “rare” blocks, those that aren’t well-replicated by others, to get an edge in the block production competition.</p><p>It should be noted that different consensus mechanisms for Filecoin and Arweave derive from their different nature, and are by far working well for both.</p><h3>Entry barrier</h3><h3>Miner</h3><p>As mentioned earlier, Filecoin miners are required to put an initial pledge for their storage space, elevating the entry barrier to Filecoin. It also requires industrial level hardware, including 128GiB RAM at least. On the contrary, Arweave doesn’t entail any collateral or pledge for data stored, and allegedly only requires 8GiB RAM.</p><p>Judging purely from economic and technological perspectives, Arweave has a much lower entry barrier than Filecoin for miners. This, however, needs empirical evidence since mining in reality generally requires much higher hardware input than theoretical estimation.</p><h3>Developer</h3><p>Both Filecoin and Arweave are working with major blockchains — <a href="https://solana.com/ecosystem/arweave">Solana</a> is storing all its data at Arweave, while Filecoin has just launched a cross-chain bridge with <a href="https://near.org/blog/filecoin-launches-collaboration-with-near-to-accelerate-the-growth-of-the-web3-stack/">NEAR</a> that enables seamless storage of data by smart contracts on NEAR at Filecoin. Both storage protocols have development tools, and feedback from our developer community shows that Filecon is relatively more mature on this front.</p><h3>Client</h3><p>Both Filecoin and Arweave have applications for end clients. Clients can use <a href="https://docs.filecoin.io/store/estuary/#store-data-on-filecoin">Estuary</a> to find miners and store data on Filecoin. They can also use <a href="https://ardrive.io/start/">Ardrive</a> to upload data to Arweave. For retail users, Arweave appears to be a more friendly option since it doesn’t involve duration of the deal or deal-making with miners.</p><h3>Economic model</h3><h3>Miner incentives</h3><p>Filecoin miners earn block rewards + transaction fee + storage fee. Arweave miners earn block rewards + transaction fee + storage endowment (if necessary). First of all, unlike Filecoin, Arweave uses a simple decay model for block rewards, favoring early miners. Second, since data will be stored FOREVER on Arweave, the storage fees paid by clients will not be issued to miners immediately. Instead, most of them will go to a <strong>storage endowment</strong>, which will only be activated in the future when block rewards + transaction fee cannot fully compensate miners’ cost to store data and advance blockchain.</p><p>It is safe to say that in the near future, both Filecoin and Arweave miners will rely on block rewards as the main income source. Arweave’s storage endowment mechanism will work similar to Filecoin’s collateral mechanism in regard to token price — they both <strong>reduce selling pressure</strong> on their tokens. However, the magnitude could be different, considering there aren’t too many data deals on Arweave right now, therefore less locked AR, but Filecoin miners always need FIL if they want to expand or store.</p><h3>Storage cost</h3><p>To store 1GiB data for 200 years on Arweave, you currently have to pay around 0.6AR, or $35. This is a price that is only suitable for super-long-time storage clients. On the contrary, Filecoin aims to provide a very affordable price. When it comes to the most likely clients, which are blockchains, smart contracts, NFT projects, etc., it’s worth thinking which strategy works better for their aim. Permanency is naturally associated with blockchain, therefore giving Arweave some edge; on the other hand, it’s unclear whether people are willing to pay for the future (especially when they won’t even benefit from their payment in the future since they would be dead already).</p><p>In the retail market, Arweave could benefit from possible price inelasticity of retail users and outperform Filecoin, but it’s unclear which protocol will win when blockchain big data era finally comes.</p><h3>Ecosystem</h3><h3>Infrastructure</h3><p>Arweave has a smart contract platform called “<strong>SmartWeave</strong>” which enables development with JavaScript. SmartWeave contracts are run locally, freeing up on-chain computation resources, but at the same time partly sacrificing speed and trustlessness. Filecoin currently doesn’t support smart contracts, but an EVM-compatible environment is on its roadmap (we may be able to see it as early as year end of 2021).</p><p>Filecoin appears to be more mature in terms of documentation and developer communities. It also has a highly-usable <a href="https://filscan.io/">blockchain explorer</a> and real-time <a href="https://file.app/">miner stats</a>. Arweave, on the other hand, can improve on building blocks of their ecosystem.</p><h3>Completeness</h3><p>The two protocols need different types of ecosystems. For Filecoin, it is more client-facing, therefore an efficient and robust <strong>dealmaking service</strong> is the premise of its success. Currently <a href="https://www.filswan.com/#/dashboard">Filswan</a> is one of the go-to options for Filecoin-native dealmaking, which still requires improvements. There are also file sharing apps like <a href="https://slate.host/">Slate</a> and video hosting apps like <a href="https://beta.voodfy.com/#/">Voodfy</a> built on Filecoin that demonstrate usability. <strong>Financial service for miners</strong> is another key layer for Filecoin. Miners in the future may want to borrow money against their storage power or collaterals. This layer requires a smart contract platform. Filecoin is strong in terms of accessibility, thanks to <a href="https://www.textile.io/">Textile</a>, which provides a suite of open-source tools for decentralized storage building.</p><p>There are more than 30 active projects built on Filecoin.</p><p>Arweave, on the other hand, focuses on permaweb and a native ecosystem. A mechanism called <a href="https://docs.google.com/document/d/1QOh4Fpdgdorw-l1je5vi6renpPJdARJNUGEEax9wUwE/edit#heading=h.6u7lw9t5n1f2">Profit Sharing Token (PST)</a> is deployed to facilitate permaweb. There are currently more than 40 active applications built on Arweave, encompassing decentralized social media, DeFi data accessibility, NFT storage, PST exchange, etcs., including <a href="https://www.verto.exchange/">Verto</a>, <a href="https://redstone.finance/">Redstone</a>, <a href="https://koi.rocks/">Koii Network</a>.</p><p>Both Filecoin or Arweave have a long way to go in terms of ecosystem building. For Filecoin, external clients and infrastructures that enable easy deals will be the catalyst for a booming ecosystem, while Arweave needs to attract developers and incubate a native killer app.</p><h4>Profit Sharing Token</h4><p>PSTs work like this: when a developer builds an application, they can add a mechanism that sends small tips (in the form of AR tokens) whenever the user interacts with the app in a way that generates a transaction on the Arweave network. PST incentivizes development on Arweave, and helps developers bootstrap their projects — they can sell PSTs to raise money. The main difference between PST financing and a normal ICO/IDO is that, PSTs are “yield-bearing” tokens that derive their value from both the project’s business model and future cash flow.</p><h3>Useful links</h3><p>Filecoin docs: <a href="https://docs.filecoin.io/">https://docs.filecoin.io/</a></p><p>Filecoin specifics: <a href="https://spec.filecoin.io/">https://spec.filecoin.io/</a></p><p>Filecoin statistics: <a href="https://filfox.info/en">https://filfox.info/en</a></p><p>Filecoin miner statistics: <a href="https://file.app/">https://file.app/</a></p><p>Filecoin ecosystem: <a href="https://www.awesomefilecoin.com/">https://www.awesomefilecoin.com/</a></p><p>Filecoin ecosystem research: <a href="https://cj.sina.com.cn/articles/view/6311913111/1783826970200179hd">https://cj.sina.com.cn/articles/view/6311913111/1783826970200179hd</a></p><p>Multicoin research: <a href="https://coinmarketcap.com/alexandria/article/the-decentralized-storage-war-filecoin-vs-arweave">https://coinmarketcap.com/alexandria/article/the-decentralized-storage-war-filecoin-vs-arweave</a></p><p>Filecoin crossed baseline: <a href="https://medium.com/block-science/sustainability-goal-achieved-filecoin-network-crosses-baseline-target-cec13a3ed8f">https://medium.com/block-science/sustainability-goal-achieved-filecoin-network-crosses-baseline-target-cec13a3ed8f</a></p><p>Arweave docs: <a href="https://docs.arweave.org/info/">https://docs.arweave.org/info/</a></p><p>Ardrive: <a href="https://ardrive.io/">https://ardrive.io/</a></p><p>Arweave economics: <a href="https://ardrive.io/can-data-really-be-stored-forever/">https://ardrive.io/can-data-really-be-stored-forever/</a></p><p>Arweave explorer: <a href="https://viewblock.io/arweave">https://viewblock.io/arweave</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=313e8badc504" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/a-brief-deep-dive-into-filecoin-313e8badc504">A Deep Dive into Decentralized Storage: IPFS, Filecoin and Arweave</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[About MetaWeb Venture Capital]]></title>
            <link>https://medium.com/@stanley_he_17/about-metaweb-venture-capital-d1ac5d69b389?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1ac5d69b389</guid>
            <category><![CDATA[near-ecosystem]]></category>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Fri, 08 Oct 2021 08:44:02 GMT</pubDate>
            <atom:updated>2021-10-08T08:44:02.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UtelcdAGkml9ovH_.png" /></figure><p>MetaWeb Venture Capital (MetaWeb.VC) is a research-driven VC fund focusing on early-stage investment in disruptive blockchain technologies and crypto-native projects that define the future of Web 3.0 and Metaverse. We are here to identify innovations with the most potential and accelerate their growth.</p><p>MetaWeb.VC is led by crypto pioneers with global network and entrepreneurial experience, with a team of researchers deeply seasoned in token economics, technical architecture, product design, cybersecurity, and protocol innovation. All investment decisions by MetaWeb.VC are based on extensive due diligence and research.</p><p>MetaWeb.VC invests in the NEAR Protocol ecosystem and beyond. We take an incubator approach by deeply engaging in portfolio projects, providing comprehensive support in aspects including technology, economics, marketing and community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1ac5d69b389" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[About MetaWeb Venture Capital]]></title>
            <link>https://medium.com/metaweb-vc/about-metaweb-venture-capital-4c3cf8d60290?source=rss-e774bd37a457------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c3cf8d60290</guid>
            <dc:creator><![CDATA[Stanley He]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 07:10:08 GMT</pubDate>
            <atom:updated>2021-09-27T07:10:08.014Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-059qZ6kE1U7TyLG1pt2Q.png" /></figure><p>MetaWeb Venture Capital (MetaWeb.VC) is a research-driven VC fund focusing on early-stage investment in disruptive blockchain technologies and crypto-native projects that define the future of Web 3.0 and Metaverse. We are here to identify innovations with the most potential and accelerate their growth.</p><p>MetaWeb.VC is led by crypto pioneers with global network and entrepreneurial experience, with a team of researchers deeply seasoned in token economics, technical architecture, product design, cybersecurity, and protocol innovation. All investment decisions by MetaWeb.VC are based on extensive due diligence and research.</p><p>MetaWeb.VC invests in the NEAR Protocol ecosystem and beyond. We take an incubator approach by deeply engaging in portfolio projects, providing comprehensive support in aspects including technology, economics, marketing and community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c3cf8d60290" width="1" height="1" alt=""><hr><p><a href="https://medium.com/metaweb-vc/about-metaweb-venture-capital-4c3cf8d60290">About MetaWeb Venture Capital</a> was originally published in <a href="https://medium.com/metaweb-vc">MetaWeb.VC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>