<?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[CarbonDeFi - Medium]]></title>
        <description><![CDATA[Carbon is a decentralized trading protocol allowing users to customize liquidity strategies using onchain limit orders and range orders. The protocol automatically shifts liquidity into predefined price ranges as markets move, maximizing capital efficiency and ease of use. - Medium]]></description>
        <link>https://medium.com/carbondefi?source=rss----bce9c4b6cf23---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CarbonDeFi - Medium</title>
            <link>https://medium.com/carbondefi?source=rss----bce9c4b6cf23---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 06:28:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/carbondefi" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Now Live on Fantom!]]></title>
            <link>https://medium.com/carbondefi/now-live-on-fantom-dbca60803029?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/dbca60803029</guid>
            <category><![CDATA[decentralized-exchange]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[bancor-protocol]]></category>
            <category><![CDATA[trading-bot]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Tue, 26 Mar 2024 23:38:01 GMT</pubDate>
            <atom:updated>2024-03-15T16:19:27.248Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i8ESrI_vLKu698uy" /></figure><p>Velocimeter, the first licensee to deploy Carbon DeFi’s smart contracts, has now extended Graphene’s reach beyond <a href="https://www.carbondefi.xyz/blog/now-live-on-base-revolutionizing-onchain-liquidity-trading-beyond-ethereum">Base</a> and onto <a href="https://fantom.foundation/">Fantom</a>, a highly flexible and efficient framework perfectly suited to its advanced orderbook-like features. By merging the technological advancements of <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=GrapheneLiveOnFantom">Carbon DeFi</a> with the high-speed and efficient infrastructure of Fantom, <a href="https://twitter.com/VelocimeterDEX">Velocimeter</a>, through its launch of <a href="https://graphene.velocimeter.xyz/">Graphene</a>, proudly brings the Fantom community unrivaled precision and flexibility in their trading endeavors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dm0BO6JhWw9mpgN5" /></figure><p>The Fantom community is now able to tailor make sophisticated trading and liquidity strategies through Graphene’s comprehensive suite of <a href="https://www.carbondefi.xyz/orders">order types</a> powered by <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=GrapheneLiveOnFantom">Carbon DeFi</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*iYa8N8k0hv1UN8Y4" /></figure><ul><li><a href="https://www.carbondefi.xyz/blog/true-dex-limit-orders-carbon-vs-existing-solutions"><strong>Limit Orders</strong></a>: Similar to the functionality of a centralized exchange (CEX), limit orders allow users to specify a single price to buy or sell a token. <em>Eg. Buy ETH at $3700.</em></li><li><a href="https://www.carbondefi.xyz/blog/crypto-trading-scaling-in-and-out"><strong>Range Orders</strong></a>: Ditch the dozens of limit orders and <a href="https://www.carbondefi.xyz/blog/maximize-market-gains-scaling-in-and-out">scale in/out</a> with this novel range trading feature. Range orders enable buying or selling within two specified price points, making them ideal for methodically entering or exiting positions. This approach eliminates the risk of needing to perfectly time the market or predict the exact peak, which could lead to sacrificing profits if the anticipated peak is not reached. <em>Eg. Sell ETH from $6000 to $6400.</em></li><li><a href="https://www.carbondefi.xyz/blog/automated-recurring-limit-orders-explained"><strong>Recurring Orders</strong></a>: This exclusive feature links two separate buy and sell orders, consistently buying low and selling high with all newly acquired tokens automatically rotating to the opposite order. Native to the protocol, recurring orders function with zero dependency on external services such as keepers or oracles, and incur zero trading and gas fees when filled. Designed to thrive on market volatility and to simplify intricate trading scenarios, recurring orders function similar to a <a href="https://www.carbondefi.xyz/blog/dex-trading-bots-transformed-the-new-era-of-automated-trading-on-the-horizon">trading bot</a> or grid trading system, compounding profits and autonomously growing token holdings. <em>Eg. Only buy ETH at $3700 and only sell ETH from $6000 to $6400.</em></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnybGuOd2MMc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnybGuOd2MMc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnybGuOd2MMc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/74c37dfc1c445bd0513ce3e86958cb76/href">https://medium.com/media/74c37dfc1c445bd0513ce3e86958cb76/href</a></iframe><ul><li><a href="https://www.carbondefi.xyz/blog/overlapping-liquidity"><strong>Overlapping Liquidity</strong></a>: This advanced form of concentrated liquidity enables users to create positions within any price range in a gas efficient manner. Unlike the fixed fee tier of traditional concentrated liquidity models, overlapping liquidity offers greater control over a liquidity strategy by giving its users the freedom to set their own bid/ask spread.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0R1LFm_bvbO-wR-k" /></figure><blockquote><a href="https://twitter.com/MBRichardson87"><strong>Dr. Mark Richardson</strong></a><strong>– Project Lead at Bancor</strong></blockquote><blockquote>“With the deployment of Graphene and the Arb Fast Lane on Fantom through our collaboration with Velocimeter, we’re not just expanding our technological footprint; we’re knitting together the unique strengths of Fantom’s infrastructure with our vision for a more nuanced and accessible DeFi. This venture is a reflection of our commitment to thoughtful innovation and the practical empowerment of our users, blending the robust capabilities of Fantom with the advanced features of Carbon DeFi to foster a DeFi environment where precision and flexibility are simply given.”</blockquote><h4><strong>A Protocol for Efficient Order Execution</strong></h4><p><a href="https://bancor.network/arbfastlane">Bancor’s Arb Fast Lane Protocol</a> is a cornerstone of the Carbon DeFi trading system, meticulously crafted to see that orders are efficiently filled on Ethereum with <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=GrapheneLiveOnFantom">Carbon DeFi</a>, along with all <a href="https://www.carbondefi.xyz/networks">licensed deployments</a> powered by Carbon DeFi, including Graphene on both Base and Fantom. The Arb Fast Lane is now live on <a href="https://fantom.foundation/">Fantom</a> and seamlessly integrated with numerous liquidity sources, including:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qOJ6cOk9loWInxos" /></figure><ul><li>Velocimeter</li><li>Graphene</li><li>Equalizer</li><li>HyperJump</li><li>KnightSwap</li><li>SoulSwap</li><li>SpookySwap</li><li>Sushiswap v2 and v3</li><li>WigoSwap</li><li>Beethoven X</li></ul><p>The Arb Fast Lane is a permissionless, open-source framework that searches and performs complex <a href="https://blog.bancor.network/turbocharging-defi-arbitrage-with-10x-speed-boosts-the-arb-fast-lane-evolution-25063d023f69">arbitrage transactions</a>, blending sophisticated technology with a lesser requirement of technical knowledge. <a href="https://bancor.network/">Bancor</a> encourages the Fantom Community to run the Arb Fast Lane, earning nearly 50% of the arbitrage profit.</p><p>With the launch of <a href="https://graphene.velocimeter.xyz/">Graphene</a> and the <a href="https://bancor.network/arbfastlane">Arb Fast Lane</a> on Fantom, the community is now equipped with a suite of sophisticated trading and market-making tools that go well beyond the standard offerings of typical decentralized exchanges (DEXs).</p><p>Hear what Michael Kong, CEO at <a href="https://fantom.foundation/">Fantom Foundation</a> and Dr. Mark Richardson, Project Lead at <a href="http://bancor.network/">Bancor</a> have to say about the arrival of Bancor’s trading products on Fantom, the Sonic upgrade, and how they’re set to enhance the community’s experience with more seamless and efficient transaction capabilities.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzZoG48p-IR4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzZoG48p-IR4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzZoG48p-IR4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5beda5f5baabef65c9cb00bb7dbd05b/href">https://medium.com/media/c5beda5f5baabef65c9cb00bb7dbd05b/href</a></iframe><h4><strong>On the Horizon</strong></h4><p>The launch of Carbon DeFi’s smart contracts on a second Layer 2 network marks 2024 as a transformative year for Bancor. By strategically <a href="https://medium.com/bancor/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">licensing</a> its <a href="https://resources.carbondefi.xyz/pages/CarbonWhitepaper.pdf">cutting-edge technology</a>, Bancor is further solidifying its foundational role within decentralized finance, and this expansion underscores its substantial evolution, setting the stage for a rapidly growing ecosystem and prominent presence across various blockchain networks.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0kKEJ4JCk6U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0kKEJ4JCk6U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0kKEJ4JCk6U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/387fc32def683247725513e52792d92a/href">https://medium.com/media/387fc32def683247725513e52792d92a/href</a></iframe><p>For additional information on Bancor’s technologies, or obtaining a license of your own, please reach out at contact@Bancor.network.</p><p>Disclaimer: Users are advised to exercise caution and conduct their own due diligence before engaging with any DeFi projects. Bancor does not control the deployments or operations of 3rd parties who license Bancor technology, and although Carbon DeFi has undergone three comprehensive audits, there is no guarantee that the code itself or the protocols using the technology will function as intended. Bancor does not guarantee the safety or security of, and this announcement is not an endorsement of, any protocol.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbca60803029" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/now-live-on-fantom-dbca60803029">Now Live on Fantom!</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your New Secret Weapon for Successful Trading: Unveiling the Carbon DeFi Simulator]]></title>
            <link>https://medium.com/carbondefi/your-new-secret-weapon-for-successful-trading-unveiling-the-carbon-defi-simulator-9e73beefd87d?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/9e73beefd87d</guid>
            <category><![CDATA[trading-strategy]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[trading-bot]]></category>
            <category><![CDATA[decentralized-exchange]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Mon, 04 Mar 2024 17:05:26 GMT</pubDate>
            <atom:updated>2026-06-01T21:03:27.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fKcVRYLqiz-1qnVv" /></figure><p>Exciting news from <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=NewSecretWeaponApp">Carbon DeFi</a>! Introducing the <a href="https://carbondefi.xyz/simulate?utm_source=Medium&amp;utm_medium=Carbon+DeFi&amp;utm_campaign=Simulator">Carbon DeFi Simulator</a> — a powerful tool for crafting winning trading strategies. The simulator allows users to backtest their trading strategies against historical market data, offering valuable insights into how they would have performed in the past. The simulator equips users with the ability to assess potential profitability and risk, refine their approach, and make informed decisions before allocating capital to live trades.</p><p>The best part? The Carbon DeFi Simulator is seamlessly integrated into the desktop user interface (UI), making it incredibly easy to switch from testing strategies to executing trades with just a single click. It’s all about simplifying the experience, helping you trade smarter and with more confidence.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqxCoURjfhw8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqxCoURjfhw8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqxCoURjfhw8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac9ebd44347134c8bac249f9ff6890d6/href">https://medium.com/media/ac9ebd44347134c8bac249f9ff6890d6/href</a></iframe><h4>The Carbon DeFi Simulator operates on four standard inputs:</h4><ul><li><strong>Create a Trading Pair</strong>: Select any two standard ERC20 tokens.</li><li><strong>Choose Your Strategy Type</strong>: Opt for automated “Recurring Orders” that mimic a DEX trading bot or grid trading for dynamic market engagement, or “Overlapping Liquidity,” a pioneering approach to concentrated liquidity positions, coming soon to the Simulator.</li><li><strong>Set Your Price Target</strong>: Create “Limit” orders to aim for a single price target, or utilize “Range” trading to scale in or out by establishing custom price parameters, allowing for flexibility in your trading approach.</li><li><strong>Input Your Budget</strong>: Determine the budget for your buy and/or sell order. <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=NewSecretWeaponApp">Carbon DeFi</a> uniquely allows users the ability to provide for one side of the pair, removing the necessity to commit both tokens.</li></ul><p>In addition to the standard inputs provided, users have the capability to specify a date range for conducting the simulation, which can extend up to the past 365 days. Users are also given the option to modify the date range even after the simulation has concluded.</p><p>Upon completion of the simulation, users are presented with an overview bar which includes the four initial inputs, as well as Estimated Gains in TKN and ROI percentage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D9MVacFqhiD6mKpy" /></figure><p>The overview bar is complemented by a comprehensive array of data, generated and showcased in three distinct formats: Animation, Visual Summary, and a downloadable Trade History. Together, these elements furnish a detailed and nuanced understanding of the strategy’s performance.</p><h4><strong>Animation</strong></h4><p>This default format displays three dynamic charts:</p><ul><li><strong>Price Chart: </strong>Token price movements within the specified timeframe, highlighting strategy-specific buy and sell prices/zones</li><li><strong>Performance vs HODL:</strong> A clear visual representation of how the simulated strategy performed against a HODL position throughout the duration of the strategy.</li><li><strong>Token Balances:</strong> The final token balances following the simulation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zzBXbq2WEWPDzTU0" /></figure><h4><strong>Summary</strong></h4><p>Strategy makers can fine-tune their approach for optimal results by leveraging the provided Summary, meticulously crafted to display key insights to a strategy’s performance.</p><ul><li><strong>Ask:</strong> The price or range at which a user wishes to sell their tokens</li><li><strong>Bid</strong>: The price or range at which a user wishes to buy their tokens</li><li><strong>Price:</strong> Market price of the base token relative to the quote token</li><li><strong>Portfolio Value:</strong> The ending portfolio balance as a result of the simulated strategy</li><li><strong>Quote Portion:</strong> The proportion of the total portfolio value denominated in the quote asset</li><li><strong>HODL Value:</strong> The portfolio value had the user held their tokens</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NOdW15yZ5Ozo11aa" /></figure><h4><strong>Trade History</strong></h4><p>A downloadable CSV file offers a detailed breakdown of data for each trade executed during the simulation. This includes the date, price, ask, bid, risk balance and portion, cash balance and portion, portfolio value, HODL value, and a comparative analysis of Portfolio versus HODL performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TSWgldmfH0il83yb" /></figure><h4>Dr. Mark Richardson– Project Lead at Bancor</h4><blockquote><strong>“</strong>The simulator began as a communication tool — something I could wield in a meeting or during a presentation to describe and contrast Carbon DeFi with other protocols. Its repurposing as a trading strategy back-testing tool was obvious, but it has not forgotten its pedagogical heritage entirely. Carbon DeFi is a radical change in the liquidity infrastructure, and to have an interactive resource available that helps to make the protocol more accessible without referring to a Whitepaper or technical documentation is probably just what the industry needs more of.”</blockquote><h4><strong>Carbon DeFi: The Pinnacle Platform for Placing Bids and Offers</strong></h4><p>With the introduction of the <a href="https://carbondefi.xyz/simulate?utm_source=Medium&amp;utm_medium=Carbon+DeFi&amp;utm_campaign=Simulator">Simulator</a>, Carbon DeFi is not just keeping pace with the industry’s needs; it’s anticipating them, offering an already comprehensive suite of features and order types that not only meets, but exceeds the demands of the modern trader.</p><ul><li><a href="https://www.carbondefi.xyz/blog/automated-recurring-limit-orders-explained">Recurring Orders</a>: This exclusive feature streamlines trading by linking buy and sell orders, automatically rotating your tokens between them, similar to the way a <a href="https://www.carbondefi.xyz/blog/dex-trading-bots-transformed-the-new-era-of-automated-trading-on-the-horizon">trading bot</a> or grid trading would, simplifying complex scenarios and <a href="https://www.carbondefi.xyz/blog/maximize-market-gains-scaling-in-and-out">maximizing on market volatility</a>. Recurring orders enable continuous buying low and selling high, automatically accumulating tokens and compounding profits with zero reliance on 3rd parties such as Keepers. Not only that, but strategy makers incur zero trading and gas costs when their strategies are traded against and their orders are filled. <strong>Simulator capabilities now live!</strong></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnybGuOd2MMc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnybGuOd2MMc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnybGuOd2MMc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/408e2ef611d450bf2767e83325a50dcb/href">https://medium.com/media/408e2ef611d450bf2767e83325a50dcb/href</a></iframe><ul><li><a href="https://www.carbondefi.xyz/blog/overlapping-liquidity">Concentrated Liquidity</a>: Previously referred to as Overlapping Liquidity, Carbon DeFi’s concentrated liquidity is asophisticated advancement of traditional concentrated liquidity that allows users to create positions within any price range in a gas efficient manner. In contrast to prototypical concentrated liquidity models, which have preset fee tiers, Carbon DeFi’s concentrated liquidity allows its creators to choose their own spread (AKA Fee).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qITtJQLVHviz0MZa" /></figure><h4>Native Onchain Limit and Range Orders</h4><ul><li><a href="https://www.carbondefi.xyz/blog/true-dex-limit-orders-c">Limit Orders</a>: This traditional tool allows traders to specify precise buy or sell prices, mirroring the functionality of a centralized exchange. Additionally, there are no trading or gas fees incurred on orders that have been executed.</li><li><a href="https://www.carbondefi.xyz/blog/crypto-trading-scaling-in-and-out">Range Orders</a>: This unique <a href="https://www.carbondefi.xyz/blog/maximize-market-gains-scaling-in-and-out">scaling in/scaling out</a> feature, distinctive to <a href="https://app.carbondefi.xyz/?utm_source=Blog&amp;utm_medium=JensMedium&amp;utm_campaign=NewSecretWeaponApp">Carbon DeFi</a>, enables trading within designated price brackets, making it perfect for gradually entering or exiting a position. For instance, one could set an order to buy ETH if its price dips into the $2300-$2000 range, eliminating the need to time the market or call the exact top or bottom.</li></ul><h4><strong>Looking Towards the Future</strong></h4><p>Markets can change in minutes. Achieving long-term success and sustainability requires more than just skill — it demands the use of sophisticated tools. The <a href="https://carbondefi.xyz/simulate?utm_source=Medium&amp;utm_medium=Carbon+DeFi&amp;utm_campaign=Simulator">Carbon DeFi Simulator</a>, with its advanced <a href="https://medium.com/@Jen_Here2DeFi/backtesting-trading-strategies-3a5ba3e8291a">backtesting</a> capabilities, is not merely a recommendation for those serious about their trading endeavors; it is an indispensable necessity.</p><p>The launch of Carbon DeFi, its novel order types and sophisticated orderbook-like features, complemented by the newly introduced Simulator, marks the initial phase of the journey. As Bancor relentlessly pushes the boundaries of innovation and introduces groundbreaking developments, the mission stands firm: to equip users with the advanced tools and critical insights required for navigating the relentless and unpredictable terrain of cryptocurrency trading.</p><p>Visit <a href="https://carbondefi.xyz/simulate?utm_source=Medium&amp;utm_medium=Carbon+DeFi&amp;utm_campaign=Simulator"><strong>CarbonDeFi.xyz/Simulat</strong>e</a> and see firsthand how backtesting with historical data can sharpen your strategies, boost your trading performance, and enable you to master the intricacies of the market with confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e73beefd87d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/your-new-secret-weapon-for-successful-trading-unveiling-the-carbon-defi-simulator-9e73beefd87d">Your New Secret Weapon for Successful Trading: Unveiling the Carbon DeFi Simulator</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Theory vs Reality]]></title>
            <link>https://medium.com/carbondefi/theory-vs-reality-e4c40625767f?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/e4c40625767f</guid>
            <category><![CDATA[decentralized-exchange]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Mark Richardson]]></dc:creator>
            <pubDate>Tue, 20 Feb 2024 04:25:41 GMT</pubDate>
            <atom:updated>2024-02-25T20:53:35.323Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Precision and Accuracy of Carbon DeFi’s Fixed-Point Arithmetic</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jy6977Td6D5Q1Od87QDzZg.png" /></figure><p>My approach to de novo protocol design begins with establishing a theoretical framework. I assume this is common, but I am reluctant to speak for other designers. Speaking only to my experience, this phase of the development process invariably relies on pure algebraic abstraction. The goal is to achieve an exhaustive mathematical description of the protocol’s core methods such that its functionality can be demonstrated symbolically. It is wonderful to arrive at a proven (or, at the very least <em>provable</em>) source of truth with respect to what the expected outcomes are for any conceivable interaction with a newly imagined system. However, as a veteran experimentalist I understand better than most the difference between pen-and-paper theory and the limits of physical reality. For protocol design this is the difference between the immaculate mathematical abstraction of the system and its implementation under the limitations of its host blockchain. With only finite memory and compute cycles at hand, the challenge is to create the best possible approximation of the model while respecting the boundaries of what the network can realistically support. This is no small task. I am very fortunate to be working with talented embedded systems engineers, including and especially Barak Manos, with whom I can collaborate to thread this specific needle.</p><h3>Carbon DeFi in Brief</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GlAB_L7RJApLLVkS1b9UOQ.png" /></figure><p><a href="https://app.carbondefi.xyz/">Carbon DeFi</a> is a token exchange protocol, made to resemble a conventional orderbook in some respects, without completely turning its back on its AMM heritage. Fittingly, the system variables are those required to encapsulate a singular, or series of user-nominated exchange rates and token balances, which are then broadcast to other market participants who may elect to take the tokens and prices on offer. As is customary in DeFi, the exchange is formalized with an invariant function, from which its price quoting and swap functions can be derived:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQwz7z2NzDnnlk_VjALb8w.png" /><figcaption>Invariant Function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNT6LUhrRkHMbslIqv4Rxw.png" /><figcaption>Price Function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIvZ0sJS5L-uP9sq79K6wA.png" /><figcaption><em>Trade by Source Function (i.e. output amount, given the input amount)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M1OeqkR9i4DXwu17WWogIw.png" /><figcaption><em>Trade by Target Function (i.e. input amount, given the output amount)</em></figcaption></figure><p>The <em>a</em>, <em>b</em>, and <em>z</em> terms are constants that describe the relative curvature and size of the bonding curve; <em>z</em> denotes the y-intercept, and <em>a</em> and <em>b</em> are derived from the two price bounds of the range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tTtUIc9tct7jAwj4Pqi2dw.png" /><figcaption><em>Exchange Rate Parameter Definitions</em></figcaption></figure><p>In the equations above, (<em>x</em>, <em>y</em>) represent cartesian coordinates for a point that lies on the bonding curve, (Δ<em>x</em>, Δ<em>y</em>) represent token quantities corresponding to a translocation upon the same curve, and Δ<em>x </em>and Δ<em>y </em>have opposite signs. By convention, the swapped token amounts are expressed as unsigned integers, Δ<em>x </em>≥ 0 and Δ<em>y </em>≥ 0. In other words, we adopt a moving frame of reference, such that Δ<em>x </em>represents a number of tokens sent from the market participant to the contract, and Δ<em>y </em>represents a number of tokens sent from the contract to the market participant:</p><ul><li>Following a token exchange, the contract balance of <em>x</em> is <em>x</em> + Δ<em>x.</em></li><li>Following a token exchange, the contract balance of <em>y</em> is <em>y</em> <strong>− </strong>Δ<em>y.</em></li></ul><p>Consequently, the exchange rates for any curve inherit this convention; the exchange rate, ∂<em>y</em>/∂<em>x</em><strong>, </strong>is the drop in the <em>y</em>-balance with respect to some input amount as it approaches zero (Δ<em>x </em>→ 0). The benefit here is that rates are quoted as positive (rather than negative) numbers. While technically incorrect with respect to the invariant, these conventions support standard financial intuition. However, it is important to recognize that this formulation is necessarily numeraire-agnostic, as the <em>y</em>-axis may represent either the “cash” (or “quote”), or “risk” (or “base”) asset. In cases where the <em>y</em>-axis refers to a common numeraire, such as a $USD stablecoin, the price quote is intuitive: ∂<em>y</em>/∂<em>x</em><strong>, </strong>has units of $USD per risk token. However, in cases where the y-axis refers to the risk asset the price quote is inverted: ∂<em>y</em>/∂<em>x </em>has units of risk token per $USD.</p><p>For example, a curve which represents bidding liquidity denominated in USDC for the ETH markets beginning at <em>P_</em>a = 2,200 USDC per ETH and ending at <em>P_</em>b = 1,800 USDC per ETH has intuitive units, and the depletion of the USDC balance on the curve is commensurate with receding bidding prices. Suppose that the curve was initialized with 10,000 USDC of which 5,000 USDC remains. Through application of the price function, the marginal highest bid on the curve, <em>P</em>_m, is found to be ~1,995 USDC per ETH. Whereas <em>P</em>_m is the marginal rate corresponding to the current <em>y</em> balance of the curve, <em>P</em>_a and <em>P</em>_b refer to the marginal rates when <em>y</em> = <em>z</em>, and <em>y</em> = 0, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R66O8JLDo24_ADz4VwkwUw.png" /><figcaption>Figure 1: Invariant and Price Curves for P_a = 2,200 USDC per ETH, P_b = 1,800 USDC per ETH, y = 5,000 USDC and z = 10,000 USDC.</figcaption></figure><p>Consider now how a curve representing asking liquidity might look compared to the bidding liquidity example, above. As per the conventions the curve which offers ETH is necessarily denominated in ETH, and its contract balance is represented on the <em>y</em>-axis. Therefore, the output of the price function (and the variables <em>P</em>_a, <em>P</em>_b, and <em>P</em>_m) are reported in units of ETH per USDC. This can be a little jarring. For example, the curve which offers ETH at a rate beginning at 2,500 USDC per ETH and ending at 3,000 USDC per ETH must use the reciprocals of these values. Suppose that the curve was initialized with 10 ETH, of which 5 ETH remains. The price function returns the marginal lowest ask on the curve, <em>P</em>_m, as 3.66 × 10⁻⁴ ETH per USDC; as before, <em>P</em>_a and <em>P</em>_b refer to the marginal rates when <em>y</em> = <em>z</em>, and <em>y</em> = 0, which are 4.00 × 10⁻⁴ (i.e. 2,500⁻¹) and 3.33 × 10⁻⁴ (i.e. 3,000⁻¹) ETH per USDC, respectively. Note that this arrangement still exhibits the desired behavior; as the ETH balance is depleted, the reciprocal price of ETH is diminished, which is commensurate with higher asking prices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GSk6MT9cYVRzuaz4vL2Qw.png" /><figcaption>Figure 2: Invariant and Price Curves for P_a = 4.00 × 10⁻⁴ (2,500⁻¹) ETH per USDC, P_b = 3.33 × 10⁻⁴ (3,000⁻¹) ETH per USDC, y = 5 ETH and z = 10 ETH.</figcaption></figure><p>If the reader is appropriately motivated, the significance of this parametrization is elaborated in the Carbon DeFi <a href="https://resources.carbondefi.xyz/pages/CarbonWhitepaper.pdf">whitepaper</a>, <a href="https://resources.carbondefi.xyz/pages/CarbonLitepaper.pdf">litepaper</a>, and <a href="https://resources.carbondefi.xyz/pages/CarbonPatent.pdf">invention disclosure</a>. For the present discussion, assume that the user provides all three marginal rates <em>P</em>_a, <em>P</em>_b, and <em>P</em>_m as inputs, along with the token quantity, <em>y</em>, from which the <em>z</em> value must be calculated. In almost all cases, the user elects to have <em>P</em>_m = <em>P</em>_a at the time the curve is initialized, in which case <em>z</em> = <em>y</em>; however, this is not a requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5M82K7xjwuZmSvWFIqNDgQ.png" /><figcaption><em>Curve Size Parameter Definition</em></figcaption></figure><h3>Token Decimals</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dmeV901FNlvCV2y7c7NO9A.png" /></figure><p>For the benefit of the uninitiated, a single token is not what it first appears. Tokens have a property which determines its divisibility, called its “token decimals”. For example, Bitcoin’s decimals are 8, meaning that a single BTC unit is defined as comprising a set of 10⁸ individual parts called “satoshis” or “sats”. Ether’s decimals are 18, meaning that a single ETH unit comprises 10¹⁸ parts called “wei”. Circle’s USD stablecoin uses only 6 decimals, meaning that a single USDC unit comprises 10⁶ parts (also called wei), and so on.</p><p>From the perspective of the exchange system, these smallest indivisible parts are all that matter, and exchange rates are unavoidably expressed in these terms. For example, suppose that 20 ETH is equal in value to 1 BTC (e.g. ETH/USD = $2,500; BTC/USD = $50,000). At the contract level, this translates to 20 × 10¹⁰ ETH wei is equal in value to 1 BTC sat. Since 1 BTC sat is indivisible, BTC-to-ETH exchange is necessarily [for lack of a better word] “chunky”. This forms the basis for further erosion of the perceived accuracy of the system; however, this would be unavoidable even with unlimited storage and computer power.</p><p>To demonstrate how token decimals impact the data available on the smart contracts, the two bonding curves presented above have been recreated here, but this time accounting for the difference in the token decimals. The curve representing bidding liquidity on ETH denominated in USDC, beginning at <em>P_</em>a = 2,200 USDC per ETH and ending at <em>P_</em>b = 1,800 USDC per ETH, initialized with 10,000 USDC, of which 5,000 USDC remains, is now revealed to have a tiny fraction of the naïve exchange rate. At the wei level, the marginal price is no longer ~1,995 USDC per ETH, but 1.995 × 10⁻⁹ USDC wei per ETH wei.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIE-MTvz8ha2fc6KtH-WcQ.png" /><figcaption>Figure 3: Invariant and Price Curves for P_a = 2,200 USDC per ETH, P_b = 1,800 USDC per ETH, y = 5,000 USDC and z = 10,000 USDC, represented at the wei scale.</figcaption></figure><p>The curve representing asking liquidity for ETH denominated in USDC, beginning at 4.00 × 10⁻⁴ (2,500⁻¹) USDC per ETH and ending at 3.33 × 10⁻⁴ (3,000⁻¹) USDC per ETH, initialized with 10 ETH, of which 5 ETH remains, is revealed to exhibit a substantially more aggressive exchange profile compared to the naïve rate. At the wei level, the marginal price is no longer 3.66 × 10⁻⁴ ETH per USDC, but rather 3.66 × 10⁸ ETH wei per USDC wei.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmsG2-KkAIFROtd6K3jtYw.png" /><figcaption>Figure 4: Invariant and Price Curves for P_a = 4.00 × 10⁻⁴ (i.e. 2,500⁻¹) ETH per USDC, P_b = 3.33 × 10⁻⁴ (3,000⁻¹) ETH per USDC, y = 5 ETH and z = 10 ETH, represented at the wei scale.</figcaption></figure><p>Differences in token decimals can alter the effective exchange rates by several orders of magnitude. This presents an interesting challenge, as even common token pairs (e.g. ETH/USDC) can result in exchange rates one might have otherwise concluded were sufficiently unusual to justify ignoring. Unfortunately, no — the scope of the expected input space really is so vast as to include numbers both vanishingly small, and impenetrably large. The challenge is to define the boundaries of what is reasonable and ensure that calculations performed at any point within these bounds result in outputs that closely adhere to the theory, while remaining mindful of the limited computer resources of the network.</p><h3>The Scaling Constant</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXbaAI8O5L9FICdLwyWglw.png" /></figure><p>Fixed point systems only know about integers. For an exchange protocol based on theory that is so thoroughly entrenched in the real numbers, this is a problem. To illustrate, consider that any exchange rate less than one rounds to zero. Given the reciprocal nature of the bidding and asking prices, about half of all exchange rates will default to zero. For example, the value 2/3 cannot be stored in a fixed-point system; however, it can be recreated in-situ by storing the numerator and denominator discretely, (2, 3), and its parts can be summoned when performing further mathematical operations when needed. The approach implemented by <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> is fundamentally the same, save for the fact that the in-situ recreation of the original fraction is abstracted algebraically.</p><p><a href="https://app.carbondefi.xyz/">Carbon DeFi</a> multiplies the rate variables, <em>a</em> and <em>b</em>, by a large constant, <em>C</em>, and records the integer part as the contract variables <em>A</em> and <em>B</em> (n.b. the capitalization is intended to symbolically capture their meaning). Implicitly, these variables represent the numerators of the fractions <em>a</em> = A/<em>C</em> and <em>b</em> = B/<em>C</em>. To recreate<em> a</em> and <em>b</em>, the general formulae are appropriately modified to compensate for the implied denominator, <em>C</em>, which compensates for the scaling-up in <em>A</em> and <em>B</em> and allows these contract variables to be used directly during exchange calculations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpG_EYpIb8hlcs8xkzV02Q.png" /><figcaption><em>Exchange Rate Parameter Definitions (Scaling Corrected)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGUG0iZZPhxq-7wkqGM4SA.png" /><figcaption><em>Invariant Function (Scaling Corrected)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9R1aPMKqQU1j7_PfRGFtsA.png" /><figcaption><em>Price Function (Scaling Corrected)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xrACyqvrDwTzwOvq4cGAw.png" /><figcaption><em>Trade by Source Function (i.e. output amount, given the input amount) (Scaling Corrected)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfcY9B9_XJsMFEOQQJYWKA.png" /><figcaption><em>Trade by Target Function (i.e. input amount, given the output amount) (Scaling Corrected)</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1FKie8zf78-03k-9QytGg.png" /><figcaption><em>Curve Size Parameter Definition (Scaling Corrected)</em></figcaption></figure><h3>Data Storage</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PkriLiT84uD1Tgh7pjSBg.png" /></figure><p>The strategy data is organized into three slots:</p><ul><li><strong>Slot #1</strong>: Contains the <em>y</em>_bid and <em>y_</em>ask values. Each value has 112 bits of allocated memory.</li><li><strong>Slots #2 and #3</strong>: Contains the <em>z</em>_bid, <em>A</em>_bid, and <em>B</em>_bid, and the <em>z</em>_ask, <em>A</em>_ask, and <em>B</em>_ask values, and each slot is exclusive to either the bidding or asking curve. The <em>z</em>_bid and <em>z</em>_ask values have the same 112 bits of allocated memory as the <em>y</em>_bid and <em>y</em>_ask values in Slot #1. The <em>A</em>_bid, <em>B</em>_bid, <em>A</em>_ask, and <em>B</em>_ask values have 54 bits of allocated memory apiece, of which the first 48 bits is reserved for the mantissa (or “significand”) and the remaining 6 bits are reserved for the exponent.</li><li><strong>Unused Bits</strong>: The <em>y</em>_bid, <em>y</em>_ask, <em>z</em>_bid and <em>z</em>_ask values contain a 16-bit appendix, and the <em>A</em>_bid, <em>B</em>_bid, <em>A</em>_ask, and <em>B</em>_ask values contain a 10-bit appendix of unutilized memory. These spaces are envisioned to support other features of the system in the future. Being that this has no bearing on the present discussion, these appendices can safely be ignored.</li></ul><p>This arrangement allows the write operations to be restricted to only one slot in most cases. A trade executed against a strategy necessarily results in changes to both the <em>y</em>_bid and <em>y</em>_ask liquidity values in Slot #1. On occasion, if one of the <em>y</em>_bid or <em>y</em>_ask values exceed its corresponding <em>z</em>_bid or <em>z</em>_ask value, then a second write operation is required to reset the appropriate value in Slot #2 or #3. Therefore, trades executed against a strategy will require data to be overwritten in at most two slots in memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nw_bUcJBBckFEvCePCv96w.png" /><figcaption>Figure 5: <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> strategy data storage and organization</figcaption></figure><h4>Smart Contract Implementation, Fixed-Point Precision, and Relative Error</h4><p>The core object of the <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> protocol is called a <em>strategy</em>, which comprises two different <em>orders </em>represented by two different bonding curves, each representing one of the bid/ask pair. Someone who is quoting the bid and ask prices is called a <em>maker</em>, and the market participant who agrees to an exchange at the quoted price is the <em>taker</em>. There are two types of user-protocol interaction where numeric precision should be scrutinized:</p><ol><li>During strategy creation or editing an existing strategy, wherein the strategy’s owner (i.e. the maker) may provide price inputs of arbitrary precision (highestRate, lowestRate, marginalRate) which must then be transformed into fixed-point format and recorded to the smart contracts.</li><li>During a trade, wherein an outside market participant (i.e. the taker) calls one of the two available trade functions and sends an amount of the <em>source</em> token to the contract in exchange for the <em>target</em> token.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RlMrMXM2OauFDTZeLzbOqQ.png" /><figcaption>Figure 6: The two points of user-protocol interaction where precision loss occurs.</figcaption></figure><h4>Strategy Creation and Editing</h4><p>The maker’s purpose [one hopes] is conceived off-chain, where they may imagine an infinitely precise pair of bonding curves that represent their market outlook. Each curve’s parametrization can be described and communicated entirely by the three marginal rates <em>P</em>_a, <em>P</em>_b, and <em>P</em>_m, and the number of tokens, <em>y</em>, to be distributed across each curve. Once received, this data must be processed into the variables <em>A</em>, <em>B</em>, <em>y</em>, <em>z</em>. While these variables may also be infinitely precise with respect to the maker’s imagined strategy, their on-chain representation is limited by the storage allocated to each value. Therefore, this process of collecting and processing the maker’s inputs, and their truncation to fit the storage requirements of the blockchain is an important source of precision loss.</p><p>To understand how this looks in practice, consider an arbitrary set of inputs received from the maker during strategy creation: thehighestRate, lowestRate, marginalRate, and the liquidityvalues. The context is also important. If the maker’s ambition is to buy the risk/base asset, then the liquidity value refers to the cash/quote asset and the exchange rates can be used verbatim; whereas if the maker intends to sell the risk/base asset, then the liquidity value refers to the risk/base asset itself and the exchange rates must be inverted. In both cases, the token decimals and compression of the curve parameters <em>A</em> and <em>B</em> is worth close inspection.</p><p>One of the most challenging pairs in all of DeFi from a precision perspective is Shiba Inu (SHIB, a relatively worthless 18 decimals token) versus wrapped Bitcoin (wBTC, an extremely valuable, 8 decimals token). At the time of writing, the SHIB/USD rate is $0.0₅9756 ($9.756 × 10⁻⁶) and the wBTC/USD rate is $ 51,854.04 ($5.185404 × 10⁴). Therefore, the current wBTC/SHIB market rate is 5,315,092,250.92251 (5.31509225092251 × 10⁹).</p><p>Suppose that a user wants to create a direct market for this pair at the current market rate, offering to buy wBTC with SHIB as the price of SHIB improves in value versus wBTC, with a market depth of 10 billion SHIB tokens or approximately $97,560 USD equivalent value. The following hypothetical inputs represent such a view, and the maker’s arbitrarily precise bonding curve at the wei scale is depicted in Figure 7. Note that we adopt the perspective here that the maker’s off-chain inputs are in the familiar non-wei format, and that the decimal corrections must be applied as part of the input processing.</p><pre>          risk/base token = wBTC<br> risk/base token decimals = 8<br>         cash/quote token = SHIB<br>cash/quote token decimals = 18<br>               order type = “buy wBTC with SHIB”<br><br>  lowestRate = 3,543,394,833.948345819174724191772607317991320232065325065623989176702584205824065767190258<br> highestRate = 7,972,638,376.383778093143129431488366465480470522146981397653975647580814463104147976178081<br>marginalRate = 5,315,092,250.922518728762086287658910976986980348097987598435983765053876308736098650785387<br>   liquidity = 10,000,000,000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4AKD2LXODSvilFVqaNqwsQ.png" /><figcaption>Figure 7: Invariant and Price Curves for lowestRate = 3,543,394,833.9483… SHIB per wBTC, highestRate = 7,972,638,376.3837… SHIB per wBTC, y = 10,000,000,000 SHIB and z = 22,247,448,713.9158… SHIB at the wei scale.</figcaption></figure><p>Here we can examine the translation of the user’s inputs into the curve parameters, and their compression prior to storage. Since this curve has the cash/quote token (SHIB) as its own balance, the rates are used verbatim (i.e. that is, not their reciprocal values), and only adjusted for the decimals of the pair. The sheer size of the result is especially pronounced due to the enormous difference in the token values, which is further amplified by their decimals and the scaling constant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xH_idLdKQ-vvJMeKoiVhkQ.png" /><figcaption>Curve Parametrization (Not Inverted)</figcaption></figure><p>The off-chain compression algorithm then converts the rate parameter to an integer and normalizes it by the scaling constant to determine its bit length for truncation. Truncation occurs by bitwise shifting, removing insignificant bits (duh!). The exponent, indicating the value’s scale, is extracted from the truncated value’s bit length. The mantissa is isolated by right-shifting this value by the exponent. Finally, the mantissa and scaled exponent are combined with a bitwise OR, producing a compressed binary representation optimized for minimal storage.</p><p>In other words, (referring only to the integer part of the binary form of the result) the significand is defined as the first 48 digits, which is extracted to be used as the mantissa, and the remaining digits are replaced with zeroes. Then, the trailing zeroes after the 48th digit are counted; the count, expressed as a 6-bit binary number, is extracted as the exponent. The compressed value is then stored as the concatenation of the exponent and the mantissa, in that order.</p><p>I am sincerely hopeful that one of the above descriptions is helpful. Failing that, I am providing the following code snippet from the class I use to perform these analyses, as well as the plain text tables it can produce, which represent each step of the compression sequence for the wBTC/SHIB curve presently under examination for both its <em>B</em> and <em>A</em> parameters.</p><pre>def compress_rate_parameter(<br>    self,<br>    parameter_name: str, <br>    print_process_summary: bool = True<br>    ) -&gt; int:<br>    &quot;&quot;&quot;<br>    ### Compresses a rate parameter for storage in blockchain environments.<br><br>    ## Parameters:<br>    | Parameter Name          | Type      | Description                                                                           |<br>    |-------------------------|-----------|---------------------------------------------------------------------------------------|<br>    | `parameter_name`        | `str`     | The name of the parameter to be compressed.                                           |<br>    | `print_process_summary` | `bool`    | Whether to print a detailed summary of the compression process (default is `True`).   |<br><br>    ## Returns:<br>    | Return Name                | Type  | Description                                                                      |<br>    |----------------------------|-------|----------------------------------------------------------------------------------|<br>    | `compressed_rate_parameter`| `int` | The compressed form of the rate parameter, optimized for blockchain storage.     |<br><br>    ## Notes:<br>    - This method reduces the size of rate parameters, making them suitable for efficient storage and processing on blockchain platforms.<br>    - The compression process involves:<br>        1. Converting the parameter to an integer, if not already.<br>        2. Truncating any trailing zeroes to minimize the parameter&#39;s size.<br>        3. Extracting an exponent representing the scale of truncation.<br>        4. Identifying the mantissa as the significant part of the parameter.<br>        5. Combining the exponent and mantissa into a single integer.<br>    - Optionally, a detailed visual summary of the compression process can be printed, illustrating the transformation of the parameter into its compressed form.<br>    - This method is crucial for understanding the use of smart contract storage, reducing gas costs, and maintaining acceptable accuracy.<br>    &quot;&quot;&quot;<br>    rate_parameter_int = int(self.maker_precise_curve_parameters[parameter_name])<br>    number_of_bits = (rate_parameter_int // self.scaling_constant_int).bit_length()<br>    truncated_rate_parameter = (rate_parameter_int &gt;&gt; number_of_bits) &lt;&lt; number_of_bits<br>    exponent = (truncated_rate_parameter // self.scaling_constant_int).bit_length()<br>    mantissa = truncated_rate_parameter &gt;&gt; exponent<br>    compressed_rate_parameter = mantissa | (exponent * self.scaling_constant_int)<br>    if print_process_summary:<br>        self.print_compression_process_summary(parameter_name,<br>                                               rate_parameter_int,<br>                                               truncated_rate_parameter,<br>                                               exponent,<br>                                               mantissa,<br>                                               compressed_rate_parameter)<br>    return compressed_rate_parameter</pre><pre>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                                                     | Note          |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|      precise B parameter (decimal float) | &gt;&gt;&gt; 1675519805183645805377564.303617077025442675500104314972513464861602177426342456097867234892029625106 |               |<br>|            B parameter (decimal integer) | &gt;&gt;&gt; 1675519805183645805377564                                                                             |               |<br>|             B parameter (binary integer) | &gt;&gt;&gt;       101100010110011100001110001010010111110100010001001111111110010101111100000011100               | (max 96 bits) |<br>|   truncated B parameter (binary integer) | &gt;&gt;&gt;       101100010110011100001110001010010111110100010001000000000000000000000000000000000               | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;       ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑               |               |<br>|                                          | &gt;&gt;&gt;       |-----------------significand------------------||--------trailing-zeroes--------|               |               |<br>|              B exponent (binary integer) | &gt;&gt;&gt; 100001                                                                                                | (max 6 bits)  |<br>|              B mantissa (binary integer) | &gt;&gt;&gt;       101100010110011100001110001010010111110100010001                                                | (max 48 bits) |<br>|  compressed B parameter (binary integer) | &gt;&gt;&gt; 100001101100010110011100001110001010010111110100010001                                                | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                |               |<br>|                                          | &gt;&gt;&gt; |expt||-------------------mantissa-------------------|                                                |               |<br>| compressed B parameter (decimal integer) | &gt;&gt;&gt; 9483730408799505                                                                                      |               |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+</pre><pre>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                                                    | Note          |<br>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+<br>|      precise A parameter (decimal float) | &gt;&gt;&gt; 837759902591822902688782.151808538512721337750052157486256732430801088713171228048933617446014812554 |               |<br>|            A parameter (decimal integer) | &gt;&gt;&gt; 837759902591822902688782                                                                             |               |<br>|             A parameter (binary integer) | &gt;&gt;&gt;       10110001011001110000111000101001011111010001000100111111111001010111110000001110               | (max 96 bits) |<br>|   truncated A parameter (binary integer) | &gt;&gt;&gt;       10110001011001110000111000101001011111010001000100000000000000000000000000000000               | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;       ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑               |               |<br>|                                          | &gt;&gt;&gt;       |-----------------significand------------------||-------trailing-zeroes--------|               |               |<br>|              A exponent (binary integer) | &gt;&gt;&gt; 100000                                                                                               | (max 6 bits)  |<br>|              A mantissa (binary integer) | &gt;&gt;&gt;       101100010110011100001110001010010111110100010001                                               | (max 48 bits) |<br>|  compressed A parameter (binary integer) | &gt;&gt;&gt; 100000101100010110011100001110001010010111110100010001                                               | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                               |               |<br>|                                          | &gt;&gt;&gt; |expt||-------------------mantissa-------------------|                                               |               |<br>| compressed A parameter (decimal integer) | &gt;&gt;&gt; 9202255432088849                                                                                     |               |<br>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+</pre><p>In addition to the compression of these curve parameters, only the integer parts of the <em>y</em> and <em>z</em> values are stored. While this is obvious for <em>y</em>, which represents the SHIB token balance of the curve (in wei units), it is still worth raising as the maker be unaware of the decimals of the token they are using and provide an off-chain input that implies divisibility beyond that supported by the token contract (e.g. wBTC beyond the 8th decimal place). While <em>z</em> has an explicit correspondence with <em>y</em> and must also be an integer, it is also computed from the marginal rate user input. Therefore, its rounding will also have an impact on the overall precision of the system — albeit a negligible one. The error caused by rounding the <em>y</em> and <em>z </em>values and resulting from a compression/decompression cycle of the <em>A</em> and <em>B</em> values can be examined directly versus the maker’s arbitrarily precise inputs by comparing the digits in-place.</p><pre>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|                Parameter | Value                                                                                                 |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|        y precise (maker) | 10000000000000000000000000000                                                                         |<br>|                          | |||||||||||||||||||||||||||||                                                                         |<br>| y fixed point (contract) | 10000000000000000000000000000                                                                         |<br>|                          |                                                                                                       |<br>|        z precise (maker) | 22247448713915890490986420373.52945695982973740328335064216346283625480188728657513269929716552320115 |<br>|                          | |||||||||||||||||||||||||||||                                                                         |<br>| z fixed point (contract) | 22247448713915890490986420373                                                                         |<br>|                          |                                                                                                       |<br>|        A precise (maker) | 837759902591822902688782.151808538512721337750052157486256732430801088713171228048933617446014812554  |<br>|                          | ||||||||||||||::::||:::|                                                                              |<br>| A fixed point (contract) | 837759902591821830684672                                                                              |<br>|  A compressed (contract) | 9202255432088849                                                                                      |<br>|                          |                                                                                                       |<br>|        B precise (maker) | 1675519805183645805377564.303617077025442675500104314972513464861602177426342456097867234892029625106 |<br>|                          | |||||||||||||||::::|::::|                                                                             |<br>| B fixed point (contract) | 1675519805183643661369344                                                                             |<br>|  B compressed (contract) | 9483730408799505                                                                                      |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+</pre><p>Be reminded that a <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> strategy is composed of two bonding curves, each taking a different side of the market. It is worthwhile to consider the opposite order type — one which offers wBTC liquidity in exchange for SHIB as the price of wBTC appreciates relative to SHIB — because it represents the opposite extreme of the curve parametrization.</p><p>Suppose that the maker includes the following order as part of their strategy, representing the opposite side of the market with a depth of 4 wBTC tokens or approximately $207,416 USD equivalent value:</p><pre>          risk/base token = wBTC<br> risk/base token decimals = 8<br>         cash/quote token = SHIB<br>cash/quote token decimals = 18<br>               order type = “sell wBTC for SHIB”<br><br>  lowestRate = 7,972,638,376.383778093143129431488366465480470522146981397653975647580814463104147976178081<br> highestRate = 15,945,276,752.76755618628625886297673293096094104429396279530795129516162892620829595235616<br>marginalRate = 10,630,184,501.84503745752417257531782195397396069619597519687196753010775261747219730157077<br>   liquidity = 4</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VPFytAy7mYJFhIuDlj9Zg.png" /><figcaption>Figure 7: Invariant and Price Curves for lowestRate = 7,972,638,376.3837… SHIB per wBTC, highestRate = 15,945,276,752.7675… SHIB per wBTC, y = 4 wBTC and z = 7.3721… wBTC at the wei scale. Note that the curve rates P_a, P_m, and P_b are inverted with respect to the user inputs.</figcaption></figure><p>Note that since the <em>y</em> balance of the curve refers to the risk/base asset, the price quotes and token decimals must be converted to their reciprocals, which can be abstracted in the math as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aBJ9Q6U_g_rfWMNtHr3V4Q.png" /><figcaption>Curve Parametrization (Inverted)</figcaption></figure><p>With these numbers in-hand, the same compression algorithm and rounding of the <em>y</em> and <em>z</em> values apply, exactly as before.</p><pre>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                                                     | Note          |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|      precise B parameter (decimal float) | &gt;&gt;&gt; 22290.70278229099528962926755992160011182305315686523376722634019307511285975496714971660409421763525 |               |<br>|            B parameter (decimal integer) | &gt;&gt;&gt; 22290                                                                                                 |               |<br>|             B parameter (binary integer) | &gt;&gt;&gt;       101011100010010                                                                                 | (max 96 bits) |<br>|   truncated B parameter (binary integer) | &gt;&gt;&gt;       101011100010010                                                                                 | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;       ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                                                 |               |<br>|                                          | &gt;&gt;&gt;       |-significand-|                                                                                 |               |<br>|              B exponent (binary integer) | &gt;&gt;&gt; 000000                                                                                                | (max 6 bits)  |<br>|              B mantissa (binary integer) | &gt;&gt;&gt;       101011100010010                                                                                 | (max 48 bits) |<br>|  compressed B parameter (binary integer) | &gt;&gt;&gt; 000000101011100010010                                                                                 | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                                                 |               |<br>|                                          | &gt;&gt;&gt; |expt||--mantissa---|                                                                                 |               |<br>| compressed B parameter (decimal integer) | &gt;&gt;&gt; 22290                                                                                                 |               |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+</pre><pre>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                                                    | Note          |<br>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+<br>|      precise A parameter (decimal float) | &gt;&gt;&gt; 9233.11140725261452182535808827061525937857598134623803709959495937678947350425791519043211464010009 |               |<br>|            A parameter (decimal integer) | &gt;&gt;&gt; 9233                                                                                                 |               |<br>|             A parameter (binary integer) | &gt;&gt;&gt;       10010000010001                                                                                 | (max 96 bits) |<br>|   truncated A parameter (binary integer) | &gt;&gt;&gt;       10010000010001                                                                                 | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;       ↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                                                 |               |<br>|                                          | &gt;&gt;&gt;       |significand-|                                                                                 |               |<br>|              A exponent (binary integer) | &gt;&gt;&gt; 000000                                                                                               | (max 6 bits)  |<br>|              A mantissa (binary integer) | &gt;&gt;&gt;       10010000010001                                                                                 | (max 48 bits) |<br>|  compressed A parameter (binary integer) | &gt;&gt;&gt; 00000010010000010001                                                                                 | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                                                 |               |<br>|                                          | &gt;&gt;&gt; |expt||--mantissa--|                                                                                 |               |<br>| compressed A parameter (decimal integer) | &gt;&gt;&gt; 9233                                                                                                 |               |<br>+------------------------------------------+----------------------------------------------------------------------------------------------------------+---------------+</pre><p>What should be noted here is that the <em>A</em> and <em>B</em> curve parameters are sufficiently small to fit entirely within the 48-bit memory allocation of the mantissa, and the compressed value is identical to the integer part of the input. In other words, the scaled-up value is stored as-is, without compression. This is true for all rate parameters on any token pair, smaller than 48-bits. While the precision loss associated with compression is forgone, this does not mean that the process is necessarily more precise. On the contrary, the discarded fractional component may represent a more significant source of error, as its relative size with respect to the integer being stored is orders of magnitude larger (which is partly why low decimals tokens such as wBTC and USDC are such a nuisance in exchange protocols).</p><pre>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|                Parameter | Value                                                                                                 |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|        y precise (maker) | 400000000                                                                                             |<br>|                          | |||||||||                                                                                             |<br>| y fixed point (contract) | 400000000                                                                                             |<br>|                          |                                                                                                       |<br>|        z precise (maker) | 737215598.8403066345843944226900997996236027110871949096129123470537482453137996501292832036260560230 |<br>|                          | |||||||||                                                                                             |<br>| z fixed point (contract) | 737215598                                                                                             |<br>|                          |                                                                                                       |<br>|        A precise (maker) | 9233.11140725261452182535808827061525937857598134623803709959495937678947350425791519043211464010009  |<br>|                          | ||||                                                                                                  |<br>| A fixed point (contract) | 9233                                                                                                  |<br>|  A compressed (contract) | 9233                                                                                                  |<br>|                          |                                                                                                       |<br>|        B precise (maker) | 22290.70278229099528962926755992160011182305315686523376722634019307511285975496714971660409421763525 |<br>|                          | |||||                                                                                                 |<br>| B fixed point (contract) | 22290                                                                                                 |<br>|  B compressed (contract) | 22290                                                                                                 |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+</pre><p>Note that after the data is processed and stored, the original inputs are unknowable to anyone except the maker who produced them. This is an important observation because it adds ambiguity to the precision measurement as it relates to trade outputs, and to what we should refer to as the “precise standard”. For completeness’ sake, this investigation will include two different measurements: one from the perspective of the maker’s arbitrarily precise inputs, and one with the assumption that the data stored on the contract is itself, arbitrarily precise. In other words, the result of a trade executed against the strategy as it exists on Ethereum will be compared to:</p><ul><li>The same trade executed on a hypothetical system with unlimited memory and where tokens have infinite decimals, where the maker’s curve was created with perfect precision with respect to their inputs. That is, we will measure the error with respect to what the maker knows (referred to as maker-precise).</li><li>The same trade executed on the same hypothetical system as above, but where the maker’s inputs are substituted for the rounded and compressed/decompressed data of the fixed-point system. That is, we will measure the error with respect to what the smart contract knows (referred to as contract-precise).</li></ul><h3>Performing Exchange</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQZha62b0FkZ7h6YihGh7w.png" /></figure><p>From the perspective of the smart contract implementation, it is important to note that all rounding is performed in such a way as to always benefit the maker. That is, when the output of a trade function is rounded from its theoretical contract-precise value to an integer, it is always in the direction of a slightly less desirable exchange rate from the taker’s perspective. This approach annuls any attempt by an adversary to engineer an input whereby they might receive more than the theoretically allowed token amount.</p><p>There are two trade functions available on <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s smart contracts:</p><ul><li>tradeBySource (i.e. <em>amount-out-given-amount-in</em>) always returns a number less than or equal to the contract-precise theoretical amount.</li><li>tradeByTarget (i.e. <em>amount-in-given-amount-out</em>) always returns a number greater than or equal to the contract-precise theoretical amount.</li></ul><p>The purpose of this analysis is to examine how and to what extent information is eroded between conceiving a trading strategy, communicating it to the <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> contracts, and its execution. With that in mind, the perspective of the taker is not really within scope — nor should it be. Unlike the maker, the taker can read the information from the contracts and simulate the inputs and outputs with 100% precision. Having said this, I do consider the effective price differences on execution resulting from the choice of either tradeBySourceor tradeByTarget to be worth a considered analysis.</p><h4>Trade by Source</h4><p>Be reminded that the theory requires:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xrACyqvrDwTzwOvq4cGAw.png" /><figcaption><em>Trade by Source Function (i.e. output amount, given the input amount) (Scaling Corrected)</em></figcaption></figure><p>Which can be functionally composed such that each intermediate operation does not exceed the 256-bit EVM mandate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7-BWqQe1jdhIecM4ISfgrg.png" /><figcaption>Functional composition of the <em>Trade by Source Function (1 of 3)</em></figcaption></figure><p>The final trade value is then computed from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aipYcnmNCXhyH1LW9d-ZyA.png" /><figcaption>Functional composition of the <em>Trade by Source Function (2 of 3)</em></figcaption></figure><p>Which is equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8qB97H_WxoiNRT98Mx3_A.png" /><figcaption>Functional composition of the <em>Trade by Source Function (3 of 3)</em></figcaption></figure><p>The 256-bit limitation for the uint256 data type necessitates careful arithmetic management to prevent overflow while maintaining calculation precision. The smart contract’s approach is designed to navigate these constraints effectively.</p><p>The architecture utilizes mulDivC functions in certain computations (<em>f</em>₃, <em>f</em>₄, <em>f</em>₆, and <em>f</em>₇) to permit intermediate values to momentarily surpass the 256-bit boundary, ensuring that while the numerator in these operations may exceed the limit, the final results conform to the uint256 range. The final step also utilizes a mulDivC function to compute the scaled-down <em>C</em>²<em>z</em>² term, and uses a utilizes a mulDivF function to compute the scaled-down Δ<em>x </em>(<em>Ay + Bz</em>)<em> </em>term. This method balances precision with the technical limitations of Ethereum, adopting a strategic approach to expression refactoring when necessary.</p><p>The computation of the final trade value, Δ<em>y, </em>reflects <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s defensive programming: it underestimates the numerator and overestimates the denominator, and the final division utilizes a mulDivF function to round the result towards zero. This tactic intentionally biases rounding errors in favor of the maker, a measure taken to prevent giving undue advantage to the taker owing to calculation imprecision. This choice underscores a principle of transaction security and fairness innate to <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s implementation.</p><p>Overall, the contract demonstrates a balance between retaining calculation precision and preventing overflow, while adhering to Ethereum’s specifications and ensuring transaction integrity. By carefully managing arithmetic operations, the contract maintains a high degree of accuracy and reliability of its core functions without venturing out-of-bounds.</p><p>Returning to the example above, where the maker has offered SHIB tokens in exchange for wBTC tokens, we can simulate an exchange to reveal the implemented fixed-point precision result, and measure the relative error compared to the hypothetical maker-precise, and contract-precise outputs. For this example, assume that the taker wishes to send 0.32100123 wBTC tokens against the maker’s order, in return for the appropriate number of SHIB tokens as dictated by the general formula. The fixed-point smart contract implementation returns 1,654,355,822.074328684134994879 SHIB tokens, which is within 2.481523 parts per Quadrillion of the maker’s arbitrarily precise expectation, and within 26.631197 parts per Octillion of the arbitrarily precise result referencing only the data available stored on the contract itself. Again, the fixed-point calculation returns a number that is very slightly less than either of the precise calculations, meaning the taker trades at a slight disadvantage.</p><pre>Function Called: trade_by_source<br><br>Trade Input (Token Wei): 32100123 wBTC (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output SHIB (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1654355822074332789456944072.627885974582462779091418036616284712304625160064989689902030257444409839 |<br>|                                  | ||||||||||||||:::|::::|:|:::.::|::::|::::::::|:::|::::::::::::::::::::::::::::::::::::::::::::::::::: |<br>|   Arbitrary Precision (Contract) | 1654355822074328684134994923.057476573629605278371744220559652825496956981343545367598264564735765621 |<br>|                                  | |||||||||||||||||||||||||:::                                                                          |<br>| Fixed-point Precision (Contract) | 1654355822074328684134994879                                                                          |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 0.32100123 wBTC<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output SHIB                                                                                     |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1654355822.074332789456944072627885974582462779091418036616284712304625160064989689902030257444409839 |<br>|                                  | ||||||||||.||||:::|::::|:|:::::|::::|::::::::|:::|::::::::::::::::::::::::::::::::::::::::::::::::::: |<br>|   Arbitrary Precision (Contract) | 1654355822.074328684134994923057476573629605278371744220559652825496956981343545367598264564735765621 |<br>|                                  | ||||||||||.|||||||||||||||:::                                                                         |<br>| Fixed-point Precision (Contract) | 1654355822.074328684134994879                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 2.481523 parts per Quadrillion<br>Fixed-Point vs Arbitrary Precision (Contract): 26.631197 parts per Octillion</pre><p>Now, referring to the opposite order within the strategy, where the maker has offered wBTC tokens in exchange for SHIB tokens, assume that the taker wishes to exchange 10,000,000 SHIB the appropriate number of wBTC tokens as dictated by the general formula. The fixed-point smart contract implementation returns 0.00094062 wBTC tokens, which is within 60.433641 parts per Million of the maker’s arbitrarily precise expectation, and within 4.523412 parts per Million with respect to the contract data. Again, the fixed-point calculation returns a number that is very slightly less than either of the precise calculations, which is the desired behavior.</p><pre>Function Called: trade_by_source<br><br>Trade Input (Token Wei): 10000000000000000000000000 SHIB (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output wBTC (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 94067.68485269045831388380332087239085166052240773657843008681176800858259514885400558683400775461902 |<br>|                                  | ||||:.:::::::::::::|:::::::|:::::::::|:||::::|:::|::|:::::::::::::::::::::::::::::||:::::::::::::::|: |<br>|   Arbitrary Precision (Contract) | 94062.42548314780701261249837916821935266674645663587209179344662617977680268270640530830378232720800 |<br>|                                  | |||||                                                                                                 |<br>| Fixed-point Precision (Contract) | 94062                                                                                                 |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 10000000 SHIB<br><br>+----------------------------------+-----------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output wBTC                                                                                         |<br>+----------------------------------+-----------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 0.0009406768485269045831388380332087239085166052240773657843008681176800858259514885400558683400775461902 |<br>|                                  | |.|||||||::::::::::::::|:::::::|:::::::::|:||::::|:::|::|:::::::::::::::::::::::::::::||:::::::::::::::   |<br>|   Arbitrary Precision (Contract) | 0.00094062425483147807012612498379168219352666746456635872091793446626179776802682706405308303782327208   |<br>|                                  | |.||||||||                                                                                                |<br>| Fixed-point Precision (Contract) | 0.00094062                                                                                                |<br>+----------------------------------+-----------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 60.433641 parts per Million<br>Fixed-Point vs Arbitrary Precision (Contract): 4.523412 parts per Million</pre><h4>Trade by Target</h4><p>Be reminded that the theory requires:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfcY9B9_XJsMFEOQQJYWKA.png" /><figcaption><em>Trade by Target Function (i.e. input amount, given the output amount) (Scaling Corrected)</em></figcaption></figure><p>Which can be functionally composed such that each intermediate operation does not exceed the 256-bit mandate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRlpskofK4NOX_J7QvOWeA.png" /><figcaption>Functional composition of the <em>Trade by Target Function (1 of 3)</em></figcaption></figure><p>The final trade value is then computed from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m64JKgy6EDKtnzxxWlL8zQ.png" /><figcaption>Functional composition of the <em>Trade by Target Function (2 of 3)</em></figcaption></figure><p>Which is equivalent to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9z4MysoLBut6ekhoGN1wSw.png" /><figcaption>Functional composition of the <em>Trade by Target Function (3 of 3)</em></figcaption></figure><p>In the computation of Δ<em>x, </em>the implementation approach diverges from that of Δ<em>y </em>in a critical aspect: the direction of rounding errors. This difference is a consequence of the reciprocal nature of these two functions. For Δ<em>x, </em>which calculates the quantity of tokens a trader must send to the contract, the approach intentionally overestimates the numerator and underestimates the denominator, with the overall result being rounded up. This method is a deliberate inversion of the error biases applied in the Δ<em>y </em>calculation.</p><p>This inversion is necessary to align the contract’s defensive programming with the transaction’s direction — ensuring that any rounding errors do not unjustly penalize the maker by requiring them to overpay. By overestimating the numerator and underestimating the denominator in the final computation, and rounding the result up, the contract aims to slightly favor the maker in the presence of calculation imprecision. Whereas the taker, who can observe the trade result prior to committing to the transaction, still get exactly the exchange rate they expected. This careful adjustment ensures that the contract remains equitable and avoids inadvertently disadvantaging users, maintaining fairness, transparency and integrity in all transactions that occur between users of the protocol.</p><p>Revisiting again the scenario where SHIB tokens are offered by the maker in exchange for wBTC tokens, let us undertake another exchange simulation to measure the precision loss of the fixed-point arithmetic, but this time using tradebyTarget. Consider a situation where the taker’s goal is to secure 1,654,355,822.074328684134994879 SHIB tokens from the maker’s market, meaning she queries how many wBTC tokens must be relinquished from her wallet to the maker’s order to complete the trade. The smart contract’s fixed-point precision calculation determines that 0.32100123 wBTC tokens are needed. This outcome reveals a difference of only 2.559216 parts per Quadrillion with respect to the maker’s exact calculations, and a difference of only 27.464979 parts per Octillion while taking the curve parametrization on the smart contract at face-value. Notably, the amount of wBTC tokens calculated for the exchange slightly overshoots the arbitrarily precise amount, subtly disadvantaging the taker, akin to the earlier observations.</p><pre>Function Called: trade_by_target<br><br>Trade Input (Token Wei): 1654355822074328684134994879 SHIB (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output wBTC (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 32100122.99999991784886412852376781350937039114955097711412169114634721350541566773448401388225188758 |<br>|                                  | ||||||||.|||||||::::::::::::::::::::::|:|:|:::::::|:|::::|:::|::::|::::::|:|::::::::::::|:::::::|:::: |<br>|   Arbitrary Precision (Contract) | 32100122.99999999999999999911837079065977833525874017487511909540535177810240205627620351953898580437 |<br>|                                  | |||||||:                                                                                              |<br>| Fixed-point Precision (Contract) | 32100123                                                                                              |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 1654355822.074328684134994879 SHIB<br><br>+----------------------------------+--------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output wBTC                                                                                      |<br>+----------------------------------+--------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 0.3210012299999991784886412852376781350937039114955097711412169114634721350541566773448401388225188758 |<br>|                                  | |.|||||||||||||||::::::::::::::::::::::|:|:|:::::::|:|::::|:::|::::|::::::|:|::::::::::::|:::::::|:::: |<br>|   Arbitrary Precision (Contract) | 0.3210012299999999999999999911837079065977833525874017487511909540535177810240205627620351953898580437 |<br>|                                  | |.|||||||:                                                                                             |<br>| Fixed-point Precision (Contract) | 0.32100123                                                                                             |<br>+----------------------------------+--------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 2.559216 parts per Quadrillion<br>Fixed-Point vs Arbitrary Precision (Contract): 27.464979 parts per Octillion</pre><p>Lastly, and again turning our attention to the opposite order, where wBTC tokens are offered from the maker in exchange for SHIB tokens, consider a scenario where the taker aims to acquire 0.00094062 wBTC tokens using SHIB tokens. The taker requests the quantity of SHIB tokens that should be sent to the contract; in response, the smart contract’s fixed-point execution returns that 9,999,954.763923315127815869 SHIB tokens are needed. This result demonstrates a discrepancy of 55.916021 parts per Million from what was anticipated by the maker’s high-precision calculation and deviates by 40.578300 parts per Octillion when aligned against the contract data assuming arbitrary runtime resources. Consistent with prior examples, the computed SHIB token quantity for the trade is marginally greater than both precise evaluations, subtly positioning the taker at a slight disadvantage.</p><pre>Function Called: trade_by_target<br><br>Trade Input (Token Wei): 94062 wBTC (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output SHIB (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 9999395637511301625506302.622771540656487995730800965380663671805155126785782213292248238466542297775 |<br>|                                  | ||||:::::::::|:::|:::::::.:::::::::::::::::::::::|::::::|:::::|:::::::::::::::|::|:::::::::|::|:::::: |<br>|   Arbitrary Precision (Contract) | 9999954763923315127815868.594218836892670162259140677147615505874263278292550311194597366596202611817 |<br>|                                  | ||||||||||||||||||||||||:                                                                             |<br>| Fixed-point Precision (Contract) | 9999954763923315127815869                                                                             |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 0.00094062 wBTC<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output SHIB                                                                                     |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 9999395.637511301625506302622771540656487995730800965380663671805155126785782213292248238466542297775 |<br>|                                  | ||||:::.::::::|:::|::::::::::::::::::::::::::::::|::::::|:::::|:::::::::::::::|::|:::::::::|::|:::::: |<br>|   Arbitrary Precision (Contract) | 9999954.763923315127815868594218836892670162259140677147615505874263278292550311194597366596202611817 |<br>|                                  | |||||||.|||||||||||||||||:                                                                            |<br>| Fixed-point Precision (Contract) | 9999954.763923315127815869                                                                            |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 55.916021 parts per Million<br>Fixed-Point vs Arbitrary Precision (Contract): 40.578300 parts per Octillion</pre><h4>Testing to Failure</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ulx-Leha1EWL6RBp2Dn_tQ.png" /></figure><p>What I have tried to demonstrate above is that <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s implementation can handle even the most extreme of token exchange rates, such as that exhibited by high-decimals, relatively worthless tokens such as Shiba Inu, versus low-decimals, exceedingly valuable tokens such as wBTC. This begs the question as to where the limits of reasonable behavior are. Any system based on finite computer resources will have a limited scope of precision and accuracy, and it is a worthwhile endeavor to discover those boundaries.</p><p>This is not as easy as it sounds.</p><p>The parametrization of <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s bonding curves is four-dimensional (<em>A</em>, <em>B</em>, <em>y</em>, <em>z</em>), and while trade inputs are only one-dimension, there are two different kinds:tradeBySource (Δ<em>x</em>) and tradeByTarget (Δ<em>y</em>), which makes for a six-dimensional hypervolume of possible input space. Accounting for the data compression and storage, the upper bound on the rate parameter is 281,474,976,710,655 × 2⁴⁸, which in terms of price quoting and/or range width is 79,228,162,514,263,774,643,590,529,025 wei/wei units. Taken together, the input space is absurdly large — but it can be meaningfully searched.</p><p>When<a href="https://app.carbondefi.xyz/"> Carbon DeFi</a> was still in its gestational stage, I developed a suite of analysis tools to systematically map the input space (terabytes of data) and report problematic regions requiring further attention. Among its goals are to characterize how precision and accuracy change as a function of the inputs, and to discover situations where the effects of rounding have not had the desired result (i.e. the taker has an advantage over the maker). Fortunately, the only examples that exist for reversal of the rounding error benefit are nonsensical. Regardless, these families of input types are worth acknowledging and characterizing. The following example is representative of the set.</p><pre>          risk/base token = ABCD<br> risk/base token decimals = 18<br>         cash/quote token = WXYZ<br>cash/quote token decimals = 18<br>               order type = &quot;buy ABCD with WXYZ&quot;<br><br>  lowestRate = 4.0000000000000000000000000000000000000000000000000000000000000000000000000000000000<br> highestRate = 4.0000000000000000000000000000000001925929944387235792646606569178402423858642578125<br>marginalRate = 4.0000000000000000000000000000000001925929944387235792646606569178402423858642578125<br>   liquidity = 1</pre><p>The first thing to notice is that the difference between the input rates is very small — beneath the resolution that can be achieved after compression/decompression of the exchange range width parameter, <em>A</em>. Therefore, it rounds to zero. There is no such issue for the <em>B</em> parameter.</p><pre>+------------------------------------------+-----------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                       | Note          |<br>+------------------------------------------+-----------------------------------------------------------------------------+---------------+<br>|      precise A parameter (decimal float) | &gt;&gt;&gt; 1.35525271560688049999999999999999998368673883000368970659882225079E-20 |               |<br>|            A parameter (decimal integer) | &gt;&gt;&gt; 0                                                                       |               |<br>|             A parameter (binary integer) | &gt;&gt;&gt;       0                                                                 | (max 96 bits) |<br>|   truncated A parameter (binary integer) | &gt;&gt;&gt;       0                                                                 | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;                                                                         |               |<br>|                                          | &gt;&gt;&gt;       |significand|                                                     |               |<br>|              A exponent (binary integer) | &gt;&gt;&gt; 000000                                                                  | (max 6 bits)  |<br>|              A mantissa (binary integer) | &gt;&gt;&gt;       0                                                                 | (max 48 bits) |<br>|  compressed A parameter (binary integer) | &gt;&gt;&gt; 000000                                                                  | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑                                                                  |               |<br>|                                          | &gt;&gt;&gt; |expt||mantissa|                                                        |               |<br>| compressed A parameter (decimal integer) | &gt;&gt;&gt; 0                                                                       |               |<br>+------------------------------------------+-----------------------------------------------------------------------------+---------------+</pre><pre>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|                                 Variable | Value                                                                                                     | Note          |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+<br>|      precise B parameter (decimal float) | &gt;&gt;&gt; 562949953421312.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |               |<br>|            B parameter (decimal integer) | &gt;&gt;&gt; 562949953421312                                                                                       |               |<br>|             B parameter (binary integer) | &gt;&gt;&gt;       10000000000000000000000000000000000000000000000000                                              | (max 96 bits) |<br>|   truncated B parameter (binary integer) | &gt;&gt;&gt;       10000000000000000000000000000000000000000000000000                                              | (max 96 bits) |<br>|                                          | &gt;&gt;&gt;       ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↑↑                                              |               |<br>|                                          | &gt;&gt;&gt;       |-----------------significand------------------||trailing-zeroes|                               |               |<br>|              B exponent (binary integer) | &gt;&gt;&gt; 000010                                                                                                | (max 6 bits)  |<br>|              B mantissa (binary integer) | &gt;&gt;&gt;       100000000000000000000000000000000000000000000000                                                | (max 48 bits) |<br>|  compressed B parameter (binary integer) | &gt;&gt;&gt; 000010100000000000000000000000000000000000000000000000                                                | (max 54 bits) |<br>|                                          | &gt;&gt;&gt; ↑↑↑↑↑↑↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓                                                |               |<br>|                                          | &gt;&gt;&gt; |expt||-------------------mantissa-------------------|                                                |               |<br>| compressed B parameter (decimal integer) | &gt;&gt;&gt; 703687441776640                                                                                       |               |<br>+------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------+</pre><pre>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|                Parameter | Value                                                                                                 |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+<br>|        y precise (maker) | 1000000000000000000                                                                                   |<br>|                          | |||||||||||||||||||                                                                                   |<br>| y fixed point (contract) | 1000000000000000000                                                                                   |<br>|                          |                                                                                                       |<br>|        z precise (maker) | 1000000000000000000                                                                                   |<br>|                          | |||||||||||||||||||                                                                                   |<br>| z fixed point (contract) | 1000000000000000000                                                                                   |<br>|                          |                                                                                                       |<br>|        A precise (maker) | 1.35525271560688049999999999999999998368673883000368970659882225079E-20                               |<br>|                          | :                                                                                                     |<br>| A fixed point (contract) | 0                                                                                                     |<br>|  A compressed (contract) | 0                                                                                                     |<br>|                          |                                                                                                       |<br>|        B precise (maker) | 562949953421312.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |<br>|                          | |||||||||||||||                                                                                       |<br>| B fixed point (contract) | 562949953421312                                                                                       |<br>|  B compressed (contract) | 703687441776640                                                                                       |<br>+--------------------------+-------------------------------------------------------------------------------------------------------+</pre><p>WhentradeBySourceis called with its theoretical maximum input (with respect to the contract variables), 0.25 ABCD, there is nothing remarkable about the output:</p><pre>Function Called: trade_by_source<br><br>Trade Input (Token Wei): 250000000000000000 ABCD (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1000000000000000000.000000000000000024074124304840447408082582114730029428887840659198167255476383850 |<br>|                                  | |||||||||||||||||||                                                                                   |<br>|   Arbitrary Precision (Contract) | 1000000000000000000                                                                                   |<br>|                                  | |||||||||||||||||||                                                                                   |<br>| Fixed-point Precision (Contract) | 1000000000000000000                                                                                   |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 0.25 ABCD<br><br>+----------------------------------+------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ                                                                                    |<br>+----------------------------------+------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1.00000000000000000000000000000000002407412430484044740808258211473002942888784065919816725547638385 |<br>|                                  | |                                                                                                    |<br>|   Arbitrary Precision (Contract) | 1                                                                                                    |<br>|                                  | |                                                                                                    |<br>| Fixed-point Precision (Contract) | 1                                                                                                    |<br>+----------------------------------+------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 24.074124 parts per Undecillion<br>Fixed-Point vs Arbitrary Precision (Contract): Negligible error</pre><p>Exceeding the maximum input is impracticable, as the maker’s strategy will simply not have any more tokens to give, and the transaction will revert. Save for the fact that it is completely meaningless to do so, continuing to increase thetradeBySourceinput amount up to <em>exactly</em> 2× its theoretical limit reveals something unexpected. First, examine the outcome at some negligible amount smaller than 2×.</p><pre>Function Called: trade_by_source<br><br>Trade Input (Token Wei): 499999999999999999 ABCD (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1999999999999999996.000000000000000000000000000000000192592994438723577720347745950573968894003767416 |<br>|                                  | |||||||||||||||||||                                                                                   |<br>|   Arbitrary Precision (Contract) | 1999999999999999996                                                                                   |<br>|                                  | |||||||||||||||||||                                                                                   |<br>| Fixed-point Precision (Contract) | 1999999999999999996                                                                                   |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 0.4999999999999999999999999999999999999999999999999999999999999999999999999999999999999 ABCD<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ                                                                                     |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1.999999999999999996000000000000000000000000000000000192592994438723577720347745950573968894003767416 |<br>|                                  | |.||||||||||||||||||                                                                                  |<br>|   Arbitrary Precision (Contract) | 1.999999999999999996                                                                                  |<br>|                                  | |.||||||||||||||||||                                                                                  |<br>| Fixed-point Precision (Contract) | 1.999999999999999996                                                                                  |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): 96.296497 parts per Septendecillion<br>Fixed-Point vs Arbitrary Precision (Contract): Negligible error</pre><p>The error is significantly reduced compared to the maker-precise result, and the rounding is still in the right direction. Now, increasing by an amount so small I would consider it meaningless if I didn’t already know the outcome:</p><pre>Function Called: trade_by_source<br><br>Trade Input (Token Wei): 500000000000000000 ABCD (wei scale)<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ (wei scale)                                                                         |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1999999999999999999.999999999999999999999999999999999999999999999999998840873077910180889673968511799 |<br>|                                  | :::::::::::::::::::                                                                                   |<br>|   Arbitrary Precision (Contract) | 2000000000000000000                                                                                   |<br>|                                  | |||||||||||||||||||                                                                                   |<br>| Fixed-point Precision (Contract) | 2000000000000000000                                                                                   |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br>Trade Input (Ignoring Decimals): 0.5 ABCD<br><br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|                        Precision | Trade Output WXYZ                                                                                     |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br>|      Arbitrary Precision (Maker) | 1.999999999999999999999999999999999999999999999999999999999999999999998840873077910180889673968511799 |<br>|                                  | :                                                                                                     |<br>|   Arbitrary Precision (Contract) | 2                                                                                                     |<br>|                                  | |                                                                                                     |<br>| Fixed-point Precision (Contract) | 2                                                                                                     |<br>+----------------------------------+-------------------------------------------------------------------------------------------------------+<br><br><br>Fixed-Point vs Arbitrary Precision (Maker): Negligible error<br>Fixed-Point vs Arbitrary Precision (Contract): Negligible error</pre><p>The error is now so small as to have become nearly immeasurable. More importantly, the rounding is now in favor of the taker compared to the maker’s precise calculations; compared to the contract variables, there is no difference. As it happens, this is a general phenomenon. There exists an input space where, if the range width is sufficiently narrow so as to round to nothing on the contracts and we ignore the upper bound on the tradeBySourceinput, it is possible to achieve a rounding error that the maker would argue is in the wrong direction. Fortuitously this phenomenon is contained to nonsense inputs, and so has no bearing on the real-world functioning of <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s Smart contracts. I raise it here for the benefit of academic curiosity, and in the hope that it may shed light on other unexpected behaviors that may affect other systems designs.</p><h4>Conclusion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPsL43mZ2j87jF1sKRaH3g.png" /></figure><p>The exploration into <a href="https://app.carbondefi.xyz/">Carbon DeFi</a>’s fixed-point arithmetic and its impact on trade precision reveals both the challenges and achievements in supporting financial models within the constraints of blockchain technology. Through careful design and strategic implementation, <a href="https://app.carbondefi.xyz/">Carbon DeFi</a> navigates the inherent limitations of fixed-point computation, ensuring that the protocol remains equitable for both makers and takers. This study underscores the importance of precision in decentralized finance, illustrating that even minute discrepancies can have tangible effects on trading outcomes. As blockchain technology evolves, so too will the methodologies to optimize precision and efficiency in DeFi protocols, further bridging the gap between theory and execution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4c40625767f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/theory-vs-reality-e4c40625767f">Theory vs Reality</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Now Live on Base!]]></title>
            <link>https://medium.com/carbondefi/now-live-on-base-01330854bfba?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/01330854bfba</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[trading-bot]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Mon, 22 Jan 2024 17:40:02 GMT</pubDate>
            <atom:updated>2024-02-21T19:39:04.753Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Revolutionizing Onchain Liquidity &amp; Trading beyond Ethereum</strong></h4><p>It is exciting to announce that <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=Carbon+Medium&amp;utm_campaign=LiveOnBase">Carbon DeFi</a>’s smart contracts have made their way onto <a href="https://base.org/">Base</a> with the official launch of “<a href="https://graphene.velocimeter.xyz/">Graphene</a>” by Velocimeter!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOV6yg4YctNGsxvvPW6QdQ.png" /></figure><p>Graphene, the first third-party DeFi protocol to <a href="https://blog.bancor.network/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">harness Carbon DeFi’s technology</a>, unveils a comprehensive <a href="http://carbondefi.xyz/orders">suite of trading tools</a> to the Base community including Limit, Range, and Recurring <a href="https://medium.com/carbondefi/a-carbon-comparison-to-traditional-limit-orders-6bbd98b1028b">Orders</a>, along with the next-gen concentrated liquidity, <em>Overlapping Liquidity</em>.</p><p>These capabilities offer advanced functionalities without compromising on simplicity, allowing users to customize their trading and liquidity strategies with unparalleled precision and flexibility. This powerful combination not only revolutionizes the user experience in managing liquidity positions but also marks a significant leap in enhancing the adaptability and efficiency of trading on <a href="https://base.org/">Base</a>.</p><ul><li><a href="https://medium.com/carbondefi/true-dex-limit-orders-carbon-vs-existing-solutions-58cd955098fd"><strong>Limit Orders</strong></a>: This traditional tool allows traders to specify precise buy or sell prices, mirroring the functionality of a centralized exchange. Additionally, there are no trading or gas fees incurred on orders that have been executed.</li><li><a href="https://medium.com/carbondefi/trading-defi-narratives-with-carbon-range-orders-75ddb355b95b"><strong>Range Orders</strong></a>: This unique scaling in/scaling out feature, distinctive to Carbon DeFi, enables trading within designated price brackets, making it perfect for gradually entering or exiting a position. For instance, one could set an order to buy ETH if its price dips into the $2300-$2000 range, eliminating the need to time the market or call the exact top or bottom.</li><li><a href="https://medium.com/carbondefi/automated-recurring-limit-orders-explained-8a137b8bb206"><strong>Recurring Orders</strong></a>: This exclusive feature streamlines trading by linking buy and sell orders, automatically rotating your tokens between them, similar to the way a <a href="https://medium.com/carbondefi/trading-bots-transformed-the-new-era-of-automated-trading-on-the-horizon-05544ef74016">trading bot</a> or grid trading would, simplifying complex scenarios and <a href="https://medium.com/carbondefi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4">maximizing on market volatility</a>. Recurring orders enable continuous buying low and selling high, automatically accumulating tokens and compounding profits with zero reliance on 3rd parties such as Keepers. Not only that, but strategy makers incur zero trading and gas costs when their strategies are traded against and their orders are filled.</li><li><a href="https://medium.com/carbondefi/a-new-way-to-lp-on-carbon-defi-92ed219d59a1"><strong>Overlapping Liquidity</strong></a>: The newest feature, a sophisticated advancement of concentrated liquidity, allows users to create positions within any price range in a gas efficient manner. In contrast to prototypical concentrated liquidity models, which have preset fee tiers, overlapping liquidity allows its creators to choose their own spread (AKA Fee).</li></ul><h4><strong>An Innovative, Hybrid Approach to Onchain Market Making and Efficient Order Execution</strong></h4><p>Bancor’s <a href="https://bancor.network/arbfastlane">Arb Fast Lane Protocol</a>, an integral component of <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=Carbon+Medium&amp;utm_campaign=LiveOnBase">Carbon DeFi</a> on Ethereum, has also expanded to its first Layer 2, making its way to <a href="https://base.org/">Base</a> alongside <a href="https://graphene.velocimeter.xyz/">Graphene</a>. This innovative, <a href="https://medium.com/bancor/turbocharging-defi-arbitrage-with-10x-speed-boosts-the-arb-fast-lane-evolution-25063d023f69">open-source arbitrage bot</a>, is already integrated with multiple liquidity sources on Base, including Graphene. The Arb Fast Lane not only <a href="https://medium.com/bancor/revolutionizing-arbitrage-in-defi-with-the-arb-fast-lane-protocol-12c9de61c543">democratizes arbitrage trading</a> by merging advanced technology with user-friendly functionality, but with its strategic design, ensures efficient order execution on <a href="https://graphene.velocimeter.xyz/">Graphene</a>, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=Carbon+Medium&amp;utm_campaign=LiveOnBase">Carbon DeFi</a>, and <a href="https://blog.bancor.network/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">future third party deployments</a> powered by <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=Carbon+Medium&amp;utm_campaign=LiveOnBase">Carbon DeFi</a>’s smart contracts.</p><p>The <a href="https://bancor.network/arbfastlane">Arb Fast Lane</a> aligns Graphene’s liquidity with prevailing market rates, and by requiring less technical expertise than traditional methods, invites the Base community to execute sophisticated arbitrage, earning nearly 50% of the trade, across various <a href="https://base.org/">Base</a> DEXes, including:</p><ul><li>Velocimeter</li><li>Uniswap v3</li><li>Balancer</li><li>PancakeSwap v2 and v3</li><li>SushiSwap v2 and v3</li><li>Aerodrome</li><li>Alien Base v2 and v3</li><li>Base Swap v2 and v3</li><li>SwapBased v2</li><li>Scale Exchange</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ez2scg5_y9JVSO2U" /></figure><blockquote><strong>Dr. Mark Richardson, Bancor Project Lead</strong></blockquote><blockquote>“Velocimeter’s launch of Graphene on Base transforms the liquidity landscape. I understand users who refuse to relinquish their agency to the prescriptive trading strategy represented by the AMM paradigm. Velocimeter’s Graphene gives back your individuality and the most basic of financial freedoms — the ability to value your own property however you like.”</blockquote><p>Only a month in, and this year in crypto is already an eventful one, with Bitcoin’s ETF approval <em>and</em> block reward halving event signaling an oncoming bull market for many. However, Bitcoin isn’t the only one making big moves this year. The deployment of <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=Carbon+Medium&amp;utm_campaign=LiveOnBase">Carbon DeFi</a>’s smart contracts onto Base marks the beginning of an important shift for <a href="http://bancor.network/">Bancor</a>, paving the way for a multi-chain presence and introduction of automated trading functionalities to different DeFi ecosystems through strategic <a href="https://blog.bancor.network/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">licensing</a> of its products to talented teams like <a href="https://www.velocimeter.xyz/">Velocimeter</a>.</p><p>Stay safe, stay strategic, and trade well with Graphene on <a href="https://base.org/">Base</a>.</p><h4>For the Ethereum Enthusiasts: Carbon DeFi</h4><ul><li><a href="http://app.carbondefi.xyz/">Create a Strategy</a></li><li><a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=ArbFastLaneLiveOnBase">Website</a></li><li><a href="https://faq.carbondefi.xyz/">FAQ</a></li><li><a href="https://twitter.com/carbondefixyz">Twitter/X</a></li><li><a href="https://t.me/CarbonDeFixyz">Community Telegram</a></li></ul><h4>For the L2 Lovers: Graphene on Base</h4><ul><li><a href="https://graphene.velocimeter.xyz/">Create a Strategy</a></li><li><a href="https://twitter.com/VelocimeterDEX">Twitter/X</a></li><li><a href="https://t.co/VDKq3r1Wns">Discord</a></li></ul><h4>For the Arbitragoors:</h4><ul><li><a href="https://bancor.network/arbfastlane">Website</a></li><li><a href="https://github.com/bancorprotocol/fastlane-bot">Fast Lane Github</a></li><li><a href="https://t.me/BancorDevelopers">Bancor Developers Telegram</a></li></ul><p>For additional information on <a href="http://bancor.network/">Bancor</a> technologies, or obtaining a <a href="https://medium.com/bancor/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">license</a> of your own, please reach out at contact@Bancor.network.</p><p>Disclaimer: Users are advised to exercise caution and conduct their own due diligence before engaging with any DeFi projects. Bancor does not control the deployments or operations of 3rd parties who license Bancor technology, and although Carbon DeFi has undergone three comprehensive audits, there is no guarantee that the code itself or the protocols using the technology will function as intended. Bancor does not guarantee the safety or security of, and this announcement is not an endorsement of, any protocol.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01330854bfba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/now-live-on-base-01330854bfba">Now Live on Base!</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A 24/7 Trading Strategy: Catching ZZZs and Dips with Automated Trading]]></title>
            <link>https://medium.com/carbondefi/the-exhausted-traders-guide-to-restful-nights-5a06c7e050d4?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/5a06c7e050d4</guid>
            <category><![CDATA[trading-bot]]></category>
            <category><![CDATA[limit-order]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[range-trading]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Wed, 17 Jan 2024 21:17:33 GMT</pubDate>
            <atom:updated>2024-04-09T17:51:42.529Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qERPC-B5uL5cUY-FpAPxRw.png" /></figure><p>Unlike the cryptocurrency markets, humans must [occasionally] cease trading. This is because nature has burdened our species with an <a href="https://blogs.scientificamerican.com/observations/why-do-we-sleep/">inexplicable</a> need to be unconscious for roughly 8 of every 24 hours, or one third of its life. Tragically, it seems biology has not yet caught up to the demonstrable fitness advantages of remaining alert, 24/7, to the price movements of Crypto, which presents the trader with an impossible ultimatum:</p><p><em>Should I choose to die from sleep deprivation, or missed trade opportunities?</em></p><p>Make no mistake — the causal connection between missing a scalp trade and premature death is <a href="https://documents1.worldbank.org/curated/en/099826507292238069/pdf/IDU0dcf0c5150431e048e30af2b01041f1ae62d3.pdf">equally well established</a> as the link between missing sleep and <a href="https://academic.oup.com/qjmed/advance-article-abstract/doi/10.1093/qjmed/hcad237/7311739">a plethora of physiological and psychological dysfunctions</a>.</p><p><a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> is clinically proven to extend the life expectancy of a trader.[citation needed] This effect is attributed to its ability to continue to execute trades on behalf of the trader at precise, pre-defined price targets while the trader sleeps.</p><h4><strong>Carbon DeFi: Marrying Sleep and Successful Trading with Advanced Orderbook-like Functionality</strong></h4><p><a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> has redefined the realm of <a href="https://medium.com/carbondefi/trading-bots-transformed-the-new-era-of-automated-trading-on-the-horizon-05544ef74016">automated trading</a>. With its novel <a href="https://medium.com/carbondefi/a-carbon-comparison-to-traditional-limit-orders-6bbd98b1028b">orderbook-like features</a>, <a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> empowers users to craft intricate (and adjustable!) trading strategies by merging the functionalities of a sophisticated trading protocol and a <a href="https://www.coindesk.com/sponsored-content/dex-trading-bots-custom-automated-trading-strategies-are-finally-coming-to-defi/">trading bot</a>, including and especially through its integration with the <a href="https://medium.com/bancor/turbocharging-defi-arbitrage-with-10x-speed-boosts-the-arb-fast-lane-evolution-25063d023f69">Arb Fast Lane</a> (another <a href="http://bancor.network/">Bancor</a> product).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*-SIvruH3FxarHz1_" /></figure><p><a href="https://medium.com/carbondefi/true-dex-limit-orders-carbon-vs-existing-solutions-58cd955098fd"><strong>Limit Orders</strong></a>: Set your target buy or sell price based on your market predictions, and then comfortably head to bed. These <a href="http://carbondefi.xyz/orders">orders</a> operate on automated precision trading, executing trades based on your pre-defined criteria. The trader can rest easy knowing that there are no additional costs — on <a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> there is no slippage and no trading fees or gas fees when your orders are filled.</p><p><a href="https://medium.com/carbondefi/trading-defi-narratives-with-carbon-range-orders-75ddb355b95b"><strong>Range Orders</strong></a>: No one wants to time the market and it is damn near impossible to call the exact top or bottom. Range orders eliminate these obstacles by filling <a href="http://carbondefixyz.xyz/orders">orders</a> within specific price ranges for individual buy and sell orders. For instance, you could set an order like “Only sell ETH when it’s between $2500-$2700” — regardless of whether or not you are awake at the time.</p><p><a href="https://medium.com/carbondefi/automated-recurring-limit-orders-explained-8a137b8bb206"><strong>Recurring Orders</strong></a>: By linking buy and sell orders, <a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> constantly rotates your liquidity once your orders are filled. This fully automated feature is native to the protocol and eliminates the need for Keepers, performing like an efficient <a href="https://medium.com/carbondefi/trading-bots-transformed-the-new-era-of-automated-trading-on-the-horizon-05544ef74016">trading bot</a>. Recurring orders are perfect for continuous <a href="https://medium.com/carbondefi/buy-low-sell-high-repeat-c6b0c64bc953">buying low and selling high</a>, similar to <a href="https://medium.com/carbondefi/carbons-limit-order-grid-trading-strategies-fda64a289f31">grid trading</a>, automatically accumulating tokens and compounding profits.</p><p><a href="https://medium.com/carbondefi/a-new-way-to-lp-on-carbon-defi-92ed219d59a1"><strong>Overlapping Liquidity</strong></a>: The latest feature in <a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a> allows you to create concentrated liquidity positions efficiently, unlike the one-size-fits-all approach of typical concentrated liquidity models. You have the freedom to select your own spread (aka the “fee tier”) ameliorating the usual fixed tier limitations.</p><h4><strong>Money never sleeps. It doesn’t mean you shouldn’t. — Carbon DeFi</strong></h4><p>Shift the focus from constant market monitoring to strategic, decision-making and automated order fulfillment. <a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Carbon DeFi</a>’s suite of tools is like a magical trading wand, allowing you to juggle market activities and life’s other commitments (including that elusive, almost mythical creature known as ‘a good night’s sleep’) knowing your trading strategy is customized, optimized, and continuously at work.</p><h4>Create your custom trading strategy and sleep like a boss; let Carbon DeFi handle the night shift.</h4><ul><li><a href="http://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=MergingRestAndRiches">Website</a></li><li><a href="https://faq.carbondefi.xyz/">FAQ</a></li><li><a href="https://twitter.com/carbondefixyz">Twitter/X</a></li><li><a href="https://t.me/CarbonDeFixyz">Community Telegram</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*_REmBDnP5U4BEuPpaSu-zQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a06c7e050d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/the-exhausted-traders-guide-to-restful-nights-5a06c7e050d4">A 24/7 Trading Strategy: Catching ZZZs and Dips with Automated Trading</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A New Way to LP on Carbon DeFi]]></title>
            <link>https://medium.com/carbondefi/a-new-way-to-lp-on-carbon-defi-92ed219d59a1?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/92ed219d59a1</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[liquidity-provider]]></category>
            <category><![CDATA[trading-system]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[limit-order]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 13:21:54 GMT</pubDate>
            <atom:updated>2024-10-04T03:00:19.798Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introducing Concentrated Liquidity 2.0</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaSR-nLHaTmPQ5MsPOuUBQ.png" /></figure><p>At the heart of decentralized finance, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a> stands out as a beacon for LPs and traders, offering a comprehensive and sophisticated suite of tools specifically designed to meet their needs. With the introduction of Concentrated Liquidity, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a> adds concentrated positions, reinforcing it as the ultimate destination for those looking to master DeFi liquidity with ease and efficiency.</p><h4><strong>Understanding Carbon DeFi’s Rich Suite of Order Types</strong></h4><p><a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a>’s robust platform is engineered to support a variety of strategies, each tailored to meet the diverse needs of the DeFi community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*L3Pu9tzjCHrj_BsUI6cc4w.gif" /></figure><ul><li><a href="https://medium.com/carbondefi/true-dex-limit-orders-carbon-vs-existing-solutions-58cd955098fd"><strong>Limit Orders</strong></a><strong>:</strong> This classic tool enables traders to set exact buy or sell prices. No trading fees or gas fees on filled orders.</li><li><a href="https://medium.com/carbondefi/trading-defi-narratives-with-carbon-range-orders-75ddb355b95b"><strong>Range Orders</strong></a>: A standout feature exclusive to <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi </a>— enables trades within specific price ranges, ideal for <a href="https://officialcarbon.medium.com/crypto-trading-101-scaling-in-and-out-16f2ef27373d">scaling in/out</a> of a position.</li><li><a href="https://medium.com/carbondefi/automated-recurring-limit-orders-explained-8a137b8bb206"><strong>Recurring Orders</strong></a><strong>:</strong> <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a>’s exclusive feature streamlines trading by linking buy and sell orders with a single liquidity source, simplifying complex scenarios and <a href="https://medium.com/carbondefi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4">maximizing on market volatility</a>. It enables continuous buying low and selling high, allowing for token accumulation and profit compounding.</li><li><strong>Concentrated Liquidity: </strong>Enables traders and DAOs to manage concentrated liquidity positions within specific price ranges easily and efficiently onchain. Drawing from Automated Market Maker (AMM) models, this tool allows for direct customization of your spread.</li></ul><h4><strong>Tailored Management Features for the Modern Maker: Customizable Bid-Ask Spread and More</strong></h4><p>In contrast to prototypical concentrated liquidity models, which have a preset bid-ask spread parameter (aka the “fee” level), <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a>’s overlapping liquidity allows its creators to choose their own spread, free from implementation specific constraints, such as tick boundaries.</p><ul><li><strong>Choose your price range:</strong> “I want to make the market for ETH/USDC between $1,500 and $3,000”.</li><li><strong>Choose your spread:</strong> “My asking price is 10% higher than my bidding price; I’ll let ETH sellers take my USDC at $2,000 but ETH buyers can take my ETH at $2,200.”</li><li><strong>Choose your market depth:</strong> “I will provide a total of $10,000 in ETH and USDC to this market.”</li></ul><p><a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a> is not just about diverse trading strategies; it’s also about offering users unparalleled control and efficiency in managing their trades with no trading or gas fees on filled orders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*M8P8SL-guhZmKLFmNooBPg.gif" /></figure><h4><strong>The Maker’s Choice: Carbon DeFi</strong></h4><p>With the introduction of Concentrated Liquidity and a relentless dedication to innovation, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a> solidifies its status as the premier protocol for makers in the decentralized finance realm. This latest enhancement enriches <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a>’s already sophisticated suite of trading tools, blending traditional methods with groundbreaking order types and abilities, all backed by intuitive management features. It’s not just a trading platform; it’s a meticulously crafted hub designed for those who seek to master the nuances of DeFi trading. Join the ranks of savvy LPs and traders who choose <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Carbon DeFi</a> for its unmatched capabilities, and experience a new standard in decentralized trading.</p><h3>For more on Carbon DeFi</h3><ul><li><a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=OverlappingLiquidity">Website</a></li><li><a href="https://faq.carbondefi.xyz/">FAQ</a></li><li><a href="https://twitter.com/carbondefixyz">Twitter/X</a></li><li><a href="https://t.me/CarbonDeFixyz">Community Telegram</a></li><li><a href="https://medium.com/bancor/bancors-innovative-technology-licensed-to-power-defi-protocols-across-multiple-layer-2s-fe67ce9e3aaa">Licensing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92ed219d59a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/a-new-way-to-lp-on-carbon-defi-92ed219d59a1">A New Way to LP on Carbon DeFi</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 2023 Pre-Christmas PlayStation 5 (Blu-Ray Edition) eBay Bonding Curve]]></title>
            <link>https://medium.com/carbondefi/the-2023-pre-christmas-playstation-5-blu-ray-edition-ebay-bonding-curve-79e7a713148a?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/79e7a713148a</guid>
            <category><![CDATA[automatic-market-maker]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[liquidity-pool]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Mark Richardson]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 16:32:03 GMT</pubDate>
            <atom:updated>2023-12-18T16:32:03.633Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VR0gKQBsOY7gNCBRuRSURA.png" /></figure><p>The emergence of DeFi has introduced a wave of marketing language that is both creatively enthusiastic and, in many cases, ultimately devoid of substance. Terms that once held well-defined meanings, such as “capital efficiency”, “fees”, “loss versus rebalancing”, and “toxic flow”, have become embroiled in the hubris of DeFi’s marketing hive mind. It is conspicuous that much of the industry’s success can be attributed to social media, where appeals to emotion and the distinctly human desire to be a member of the tribe are the primary focus. Consequently, it should come as no surprise that very simple financial concepts have taken on unnecessary ambiguity as communities in DeFi repurpose them to attract more tribe members. In this context, the precise communication of a financial concept becomes secondary to its emotional and social resonance.</p><p>Moreover, a notable aspect of this dynamic is the attitude of the DeFi users themselves. There is a discernible demand for access to sophisticated financial protocols, coupled with a resistance to engaging with the educational efforts necessary to use these tools effectively. Users often seek the benefits of DeFi participation without investing the time to understand the underlying principles. This paradoxical expectation has led to a form of communication within the DeFi space that prioritizes social engagement and often deliberately overlooks the more substantive, albeit less glamorous, foundational aspects of DeFi protocols.</p><p>The irony is that, while mundane, the underlying concepts are not at all challenging. However, I suspect that the added level of abstraction afforded by their context inside of the blockchain narrative can make it difficult to see the forest for the trees. To strip away the layers of ambiguity and social influence standing in the way of what should be accessible knowledge, I am going to focus on a more comfortable and practical analogy: the eBay market for the PlayStation 5 Blu-Ray Edition. This comparison with respect to the “Buy It Now” feature for merchants on eBay is quite nearly perfect; however, for the bidding prices we are going to take some poetic license by imagining a restructuring of eBay that, quite frankly, would bring some interesting new functionality to their platform. This approach aims to offer a more objective understanding of the core principles of exchange protocols, untangled from the tribalism and postmodern subjection of the communities that wield them.</p><h4>The PlayStation 5 (Blu-Ray Edition) eBay Market</h4><p>I am deliberately constraining the scope of eBay’s market for PlayStation 5’s (on the maker side) to something relatively straight-forward. I have no intention of aggregating this in any meaningful sense; the objective of this discussion is to arrive at a useful understanding of blockchain exchange primitives, not to embark on a thorough investigation of secondary consumer electronics markets. To collect a homogenous sample, I am focusing on the Blu-Ray Edition for the sole reason that there are more of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5LKVsXrnxDlZHDw_WcDxhw.png" /><figcaption>Figure 1: eBay PlayStation 5 market search.</figcaption></figure><p>I checked each listing to confirm that it was what it claimed; in some cases the disc drive needed to be selected from a dropdown menu to get the correct quote price. At least half of these listings are bundled together with a game. Anecdotally, whether a game is included with the bundle has zero correlation with the unit price. For each listing I recoded the quote and shipping value, and the number of units still for sale. There were two instances where a purchase of more than one console resulted in a discounted price on a per-unit basis. For these I assumed buying all the listed stock, thereby achieving the maximum discount. In another two instances, the number of units for sale was simply listed as “more than ten”. In these cases, I recorded the number of units as 11 and moved on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hIR6wAeqsKc7NQQa6bZquQ.png" /><figcaption>Figure 2: Typical eBay PlayStation 5 seller’s page.</figcaption></figure><h4><strong>The PlayStation 5 (Blu-Ray Edition) eBay Depth Chart</strong></h4><p>Imagine that we live in a world where market takers (i.e. people buying PlayStation 5s) are rational, and consistently make good decisions. Completely divorced from reality though this may be, it is a necessary concession when analyzing the available market. We therefore assume that when interacting with the market, all else being equal, the taker will elect to purchase the most inexpensive PlayStation 5 first. After the transaction is made, that stock is removed from the marketplace. If there are more units available at the same price, the next consumer is unaffected; however, if the stock at the lowest price is depleted, then the next consumer is forced to interact with the next available unit at whatever its listing price is.</p><p>This situation is absolutely within the grasp of everyone using DeFi:</p><ul><li>There are a limited number of PlayStation 5s on the market.</li><li>They are spread out over a range of asking prices by vendors.</li><li>If you want to buy a PlayStation 5, it is sensible to buy one at the lowest available asking price.</li><li>After all the PlayStation 5s available at a single price point are consumed,</li><li>the next available asking price will be greater than the one that was just exhausted.</li></ul><p>It is reasonable to ask how much retail business the PlayStation 5 market on eBay can sustain at a certain price level, or all price levels. To investigate, imagine buying each PlayStation 5 listed on eBay one by one, beginning from the lowest listing price and working your way up. As you perform each transaction, record the listing price for the PlayStation 5 you just bought, and the running total of all the money you have spent purchasing them. The plot of this data is called a market depth chart.</p><p>The eBay PlayStation 5 market depth is an important characteristic, because it reports how much the asking price of a PlayStation 5 is likely to increase given a surge in consumer demand. For example, imagine that you were tasked with buying a bunch of PlayStation 5s for Santa Claus to deliver to well-behaved human offspring at Christmas. Santa’s instructions are that you can only purchase a PlayStation 5 if it costs $1,200.00 AUD or less. From the chart below, you can tell immediately that you are going to spend $131,126.32 AUD buying PlayStations (including postage!); although, since the depth is reported in dollars it is not immediately clear precisely how many PlayStations you are buying. All you know is that after you are done, the first available price to the next consumer will be &gt;$1,200.00 AUD. Therefore, market depth charts are more concerned with cash flow than the commodity it is paired with.</p><p>Again, I posit that this is not a challenging concept for DeFi users:</p><ul><li>From examination of the depth chart, we can conclude that:</li><li>a purchase of $131,126.32 AUD worth of PlayStation 5s from eBay will</li><li>move the asking price from $720.95 AUD to &gt; $1,200 AUD,</li><li>(i.e. &gt; +66.45%).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aoZ6BFljFsGYyC5I_1lwA.png" /><figcaption>Figure 3: eBay PlayStation 5 asking depth.</figcaption></figure><h4><strong>The PlayStation 5 (Blu-Ray Edition) eBay Bonding Curve</strong></h4><p>To determine how many PlayStation 5s will be adorning the televisions of deserving children (within budget), we can simply plot the loss of PlayStation 5 inventory by eBay merchants as a function of the increase in their cash balances. The starting PlayStation 5 inventory is 181 units, and the remaining inventory as the collective cash balance of the merchants approaches $131,126.32 AUD is 54 units; therefore, only 181–54 = 127 special children are receiving a PlayStation 5 for Christmas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrBYBquotBtRtLmH9vBGyw.png" /><figcaption>Figure 4: eBay PlayStation 5 asking bonding curve.</figcaption></figure><p>This kind of plot has become known as a “bonding curve” throughout DeFi. Notice that in this form the price data is sacrificed, so by itself is not especially useful. However, paired with the depth chart, the two together provide a phenomenally detailed snapshot of the current market. That is, assuming you are considering buying a <a href="https://phys.org/news/2010-12-air-playstation-3s-supercomputer.html">suspicious quantity</a> of PlayStations from eBay in a short timeframe. This is an important point: these kinds of analyses assume that you are buying all units at once before the vendors have time to react. If you are buying PlayStation 5s one-at-a-time, slowly over the course of hours or days, it is reasonable to expect that the vendors might move their prices up in anticipation of the oncoming demand. This kind of market reaction does not apply to AMMs, and so is outside the scope of the discussion.</p><p>While Santa’s instructions were to only purchase PlayStation 5s under the predicate that each one cost $1,200.00 AUD or less, we have still only spent a total of $132,126.32 AUD and acquired 127 consoles, which is an average of $1,032.49 AUD per unit. If we interpret Santa’s instructions to mean that we should spend no more than an <em>average</em> of $1,200.00 AUD per PlayStation 5, then we can afford to take the entire PlayStation 5 market at an average price per unit of $1,096.02 and still be under budget.</p><p>While this is a more common depiction in DeFi, I suspect that it is still a source of confusion for many:</p><ul><li>The bonding curve is a plot of the eBay merchant’s PlayStation 5 inventory versus their cash balances.</li><li>As PlayStation 5s are sold, they are removed from the inventory (i.e. -ΔPlayStation 5)</li><li>and $AUD is added to the cash balance (i.e. +ΔAustralian Dollars).</li><li>The average price per PlayStation 5 when buying multiple units is simply the total units received from the vendor divided by the total cash paid.</li></ul><h4><strong>The eBay We All Deserve but Can’t Have</strong></h4><p>As it stands, eBay allows consumers to interact with vendors in a variety of ways.</p><ol><li>The most common is the situation already explored in the previous section, where vendors list their PlayStation 5s with specific asking prices, and consumers can browse the available asking prices before deciding to purchase.</li><li>Long ago, the most common interaction was via the auction mechanic, where the vendor provides the item and consumers bid against each other.</li><li>The third and final supported interaction is where the vendor may elect to accept offers — meaning that the item is listed with a certain asking price, but the consumer can negotiate a lower price.</li></ol><p>Imagine a fourth mode of interaction, where consumers could list their cash with the “price” being an item they wish to purchase. Distinct from the third type of interaction, instead of offering cash to only the vendors who have elected to allow price negotiations, you could offer cash to <em>all</em> vendors, simultaneously. Such a system would align well with free market ideals; allowing consumers to list cash offers could lead to a more competitive and efficient market for PlayStation 5s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2MhRB98EWW37nH0Ai9iqdw.png" /><figcaption>Figure 5: Imagined eBay PlayStation 5 bidding page.</figcaption></figure><p>While this fourth type of interaction is currently absent (eBay, if you are reading this — call me), the auction component of the system for which they were once known is still alive and well, albeit <a href="https://community.ebay.com.au/t5/eBay-Announcements-and-Seller/Ebay-is-no-longer-relavent-as-an-Auction-site/td-p/2024951">much less popular</a> than it was in its glory days. The auction mechanics are recorded and apparently freely auditable directly via the page wherein an auction is taking place (although, a login is required). I expanded the scope of the PlayStation 5 market probe to include those listings currently being actively bid on, and scraped their bidding history to get an idea of what the other side of the market might look like, were those without a PlayStation allowed to offer their cash directly to those with one, on their own terms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pf-WBZWoSlk3hwYqCuOCA.png" /><figcaption>Figure 6: Typical eBay PlayStation 5 bidding history.</figcaption></figure><p>I didn’t spend a huge amount of time on this — nor could I if I wanted to. At the time of writing there were only five relevant auctions, and only two of them were being bid on, and only by 12 different users. The other three auctions had their commencing bids (i.e. the one requested by the merchant) set well out of the money with respect to the market already available, which explains the lack of activity. Regardless, I collected 30 data points that represent individual prices that users had expressed an interest in transacting at. Never mind that we are demonstrably double counting the cash market; just pretend that each bid was from a unique user and that their offers were posted as listings on eBay proper, instead of being asked to compete for the same items in a live-auction format.</p><p>Thus, we can construct a depth chart as we have previously, but this time on the bids side. Imagine selling PlayStation 5s into this market, where consumers are offering cash via an eBay listing. Start by selling your PlayStation 5 inventory, one by one, beginning from the highest available bidding price and working your way down. As with the previous exercise, as you perform each transaction, record the bidding price for the PlayStation 5 you just sold and the running total of all the cash you have collected from consumers in the process. Since PlayStation 5 sellers taking this market are motivated to get the highest price, the bidding depth chart is mirrored relative to the asking depth chart; the market depth to sell PlayStation 5s improves as we approach lower prices.</p><p>Nothing surprising or difficult here, either:</p><ul><li>There are a limited amount of cash offers on the market.</li><li>They are spread out over a range of bidding prices by consumers.</li><li>If you want to sell a PlayStation 5, it is sensible to sell it at the highest available bidding price.</li><li>After all the cash offers at a single price point have been taken,</li><li>the next available bidding price will be less than the one that was just exhausted.</li></ul><p>This depth chart may be of interest if you have a large stockpile of PlayStation 5s, as it reports how much cash you could obtain quickly if you had to liquidate your inventory. For example, imagine <a href="https://www.ccn.com/news/ftx-liquidation-plan-protect-market/">you are tasked with liquidating Santa’s reserves of PlayStations</a> after the <a href="https://en.wikipedia.org/wiki/Sam_Bankman-Fried">United States Department of Justice charges him</a> with wire fraud, money laundering, and conspiracy thereof. Your instructions are to not relinquish any PlayStations for less than $600.00 AUD apiece. Again, the depth chart self-reports that you will be able to liquidate $7,054.50 AUD worth of consoles, but it doesn’t tell you how many consoles that equates to.</p><p>To determine how many PlayStation 5s will be unloaded onto the market, we can simply plot the loss of Australian Dollars by consumers as a function of function of their increase in PlayStation 5s. Consumers begin with $16,673.50 in bidding liquidity, and their PlayStation 5 inventory approaches 10 as we take $7,054.50 AUD of their market. Therefore, we can afford to liquidate 10 PlayStation 5s without selling one beneath the $600 per unit mandate. As before, if we interpret our instructions as meaning an average of $600 AUD per unit, we can afford to take $12,725.95 of the cash market for an average of $606.00 AUD per console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wYkw2edfXDivDyE4hs24g.png" /><figcaption>Figure 7: eBay PlayStation 5 bidding depth.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAJxgRPBoyFgjkMd4Nb0ig.png" /><figcaption>Figure 8: eBay PlayStation 5 bidding bonding curve.</figcaption></figure><h4><strong>Taking Both Sides of eBay’s PlayStation 5 Market</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k6kFApxud2dT1i3Q3DnFRg.png" /></figure><p>It might be reasonable to expect that between holiday seasons the demand for PlayStation 5s could begin to wane — but the overheads of operating a retail electronics outlet remain consistent. When business is slow and with the tax season approaching, there could be an opportunity to squeeze the retailers for their precious PlayStation 5 inventory. Consider this: in a market that’s not as buoyant, the urgency to maintain cash flow might compel some retailers to turn to the cash offers in our re-imagined version of eBay, and this is where a discerning trader finds their niche.</p><p>Imagine then, strategically acquiring PlayStation 5s from these retailers when they’re most eager to sell. The real opportunity unfolds as the year progresses towards December, a time traditionally marked by a surge in demand, often driven by parents seeking to fulfill holiday wishes.</p><p>Now suppose that you could refuse delivery on the PlayStations you acquire and can instead opt to warehouse them free-of-charge in eBay’s depots. Then, after each transaction your eBay page immediately and automatically lists the console you just bought with more optimistic holiday season prices. Later, when you find a buyer at your asking price, the cash you receive immediately goes back on your eBay page, again offering cash for PlayStation 5s at a lower bidding price, in cycles, ad infinitum.</p><p>This is not as absurd as you might think. This practice of taking both sides of a market simultaneously, and the profit motive for doing so, is the business of <a href="https://en.wikipedia.org/wiki/Market_maker">professional market makers</a>, typically large financial institutions or firms. However, in our context, both with respect to the PlayStation 5 on eBay and exchange primitives for cryptocurrency tokens on a blockchain, the scaled-down version of professional market making is nearly indistinguishable from the business of a pawn broker. I concede that the scale, regulatory environment, and nature of transactions (individual consumer goods vs. standardized financial instruments) are quite different, but the profit mechanism is literally identical:</p><ul><li>Offer cash at a bidding price for something while</li><li>simultaneously offer the thing you are bidding on at a higher asking price.</li></ul><p>I know it sounds trite — but there really is only one way to make money trading: <a href="https://medium.com/carbondefi/buy-low-sell-high-repeat-c6b0c64bc953">Buy Low, Sell High, Repeat</a>. It’s all there is, it’s all we’ve got, it’s not complicated, and it never was. Whether it is buying and selling PlayStation 5s on eBay via the warehousing method described above or providing token liquidity to a decentralized exchange, the financial fundamentals are indistinguishable. And I can prove it.</p><h4><strong>Using eBay as an Automatic Market Maker for PlayStation 5s</strong></h4><p>The canonical automatic market maker hasn’t changed at all since its inception in 2017. Its most familiar form is the one consisting of exactly two assets with equal portfolio weights, also known as the “constant product” or the <em>xy</em> = <em>k</em> pricing algorithm. This is the context where most DeFi users will have first encountered the concept of a “fee”; the common understanding is that use of their liquidity incurs additional charges from market participants, which accumulates to the value of their portfolio. Unfortunately, this description completely obfuscates the true nature of their activities. There is no such thing as a “fee” on a decentralized exchange, any more than there is on eBay. In fact, there is nothing stopping us from re-creating the <em>xy</em> = <em>k</em> AMM on our improved version of eBay (i.e. delivery refusal, warehousing, and the ability to list cash in exchange for goods).</p><p>For this exercise, we will begin with a PlayStation 5 inventory of 100 units, and $158,000 AUD in cash. Assume that the mid-market price for a new console is $1,580.00 AUD, and that we acquired all consoles in the inventory at this price. Using the <em>xy</em> = <em>k </em>pricing algorithm with a <em>δ </em>term of 0.2 (aka the “fee” parameter; 0.2 is unusually high but it doesn’t matter here), we would list our first PlayStation 5 for $2,000 AUD, and we would list our first cash offer at $1,251.49 AUD. Meaning, we are offering to buy a PlayStation 5 from anyone who would wish to sell one to us for $1,251.49 AUD and, simultaneously, we are offering to sell a PlayStation 5 to anyone who wants one for $2,000 AUD, thereby achieving a bid-ask spread of $2,000.00 AUD — $1,251.49 AUD = $748.51 AUD. Those are just our highest bidding and lowest asking prices; we have 99 more consoles in our inventory and another $156,748.50 AUD in cash reserves with which to create a market:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EYd3A858vbWsIXRICIOvWw.png" /><figcaption>Table 1: The PlayStation 5 xy = k AMM bids and asks table.</figcaption></figure><p>Due to a quirk of the <em>xy</em> = <em>k</em> pricing algorithm, the last PlayStation 5 in the inventory is priced at infinity dollars, and the second to last unit carries an asking price of more than a third of a billion dollars. However, our cash bids are limitless; the 5189th consecutive bid is the last time we offer the market more than $1.00 AUD for a PlayStation 5.</p><p>I have shown these rows for completeness’ sake only. It is obvious that some of these prices are absurd. If we limit our market making to the first five rows, then we would only need $6,042.47 AUD and five PlayStation 5s, which would emulate an “amplified liquidity” position (also known as “concentrated liquidity”), meaning that despite having significantly less inventory and cash reserves, it continues to behave as though it contains 100 units and $158,000 AUD with respect to the <em>xy</em> = <em>k</em> model. The amplified version simply restricts the available market depth to whatever cash and inventory is provided without affecting the bidding and asking prices. Therefore, with fewer resources you could service the same market — provided it doesn’t overwhelm your bidding and asking prices. The DeFi community has somewhat misleadingly co-opted the term “<a href="https://www.mosaic.tech/financial-metrics/capital-efficiency">capital efficiency</a>” to describe this behavior, perhaps to invoke ideas of financial growth and profitability. “However, it can be inferred from its usage that the appropriation of the term in DeFi specifically compares one pricing model to another:</p><ul><li>One pricing model is more capital efficient than another if</li><li>by default it offers higher bidding prices and lower asking prices</li><li>normalized to the same inventory and cash balances.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOv_ZvwHoz-oqodu4hR7Hw.png" /><figcaption>Figure 9: xy = k AMM PlayStation 5 bidding and asking depth.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U3kIjTs4PzvhuZKr1fQScQ.png" /><figcaption>Figure 10: Concentrated AMM PlayStation 5 bidding and asking depth.</figcaption></figure><p>Since our eBay store is adopting the prototypical Concentrated AMM pricing model, it is important to acknowledge that as the market takes PlayStation 5s from our inventory (i.e. as our asking prices are taken), our cash reserves are increasing, but also our bidding prices are updated. In a continuous liquidity situation the spread between the marginal bid and ask is a constant proportion, and is simple to calculate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KR43prWqhf0JSfDpcL3lWQ.png" /></figure><p>However, since customers are expecting to transact in whole PlayStation 5s, instead of fractions of a PlayStation 5, we will need to correct for price slippage, which in turn requires the relative amplification of our inventory to be appropriately accounted for (i.e. the reduced slippage of the concentrated position):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMxmSKzyF3USOK_X8FUEWw.png" /></figure><p>where:</p><ul><li><em>x</em> is the remaining PlayStation 5 inventory,</li><li><em>x</em><a href="https://www.bing.com/ck/a?!&amp;&amp;p=5aa8e0d009ea5882JmltdHM9MTcwMTgyMDgwMCZpZ3VpZD0yYzFiYTQ1Mi1kYmVmLTYwZjEtMzgxOS1iNjBkZGFmZjYxMDAmaW5zaWQ9NTIzNQ&amp;ptn=3&amp;ver=2&amp;hsh=3&amp;fclid=2c1ba452-dbef-60f1-3819-b60ddaff6100&amp;psq=subscript+0+character&amp;u=a1aHR0cHM6Ly93d3cuaG90c3ltYm9sLmNvbS9zeW1ib2wvc3Vic2NyaXB0LXplcm8&amp;ntb=1">₀</a> is the initial PlayStation 5 inventory (i.e. 5, in this example),</li><li><em>δ </em>is the [unhelpfully named] “fee” parameter, in our case set to 0.2, and</li><li><em>A</em> is the amplification coefficient, in this case 100/5 = 20.</li></ul><p>Again, this is not difficult. I am aware that an equation or two may inspire fear and anxiety for many — but hear me out; all we are doing is establishing the rules for our eBay page(s) that:</p><ul><li>adjust the bidding prices <em>up</em> as buyers take our PlayStation 5 market;</li><li>adjust the asking prices <em>down</em> as sellers take our cash market.</li></ul><p>This gets easier with illustration. Suppose that after setting up our five asking prices and five bidding prices (Table 1) we make our first transaction: a PlayStation 5 seller takes our highest bidding price; our PlayStation inventory increases by one and we lose $1,251.49 AUD from the cash reserves. The other cash listings are unaffected; the next highest bid remains at $1,229.40. However, as the newly acquired PlayStation 5 is added to our store inventory, not only is it appended to the existing asks, but every single asking price is also adjusted according to the general spread formula.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zGxlrw5zGOj6RYxtYH6IyA.png" /><figcaption>Table 2: The PlayStation 5 bids and asks table after taking the first bid.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ot42arlL-V4GbDy0g3pOhQ.png" /><figcaption>Figure 11: Updates to the asking depth after taking the first bid.</figcaption></figure><p>Assume that the PlayStation 5 seller’s appetite continues to increase, and they begin to accept the lower bidding prices, until there is only 1 PlayStation 5 left in the inventory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_thviZldQcC58FODJdZcOg.png" /><figcaption>Table 3: The PlayStation 5 bids and asks table after taking the first four bids.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccYlwihyKodcv8Q5ABdc1g.png" /><figcaption>Figure 12: Updates to the asking depth after taking the first four bids.</figcaption></figure><p>At this stage, all we have done is acquire four additional PlayStation 5s at an average of cost of $1,218.95 AUD per unit. Note that the model here is 1:1 with an AMM on the blockchain, save for some minor implementation-specific details. We listed five PlayStation consoles at five different prices, and four of them were bought. As a specialist PlayStation 5 pawn broker on eBay, and equally, as a token liquidity provider to a decentralized exchange, there are only two things you care about:</p><ul><li>The acquisition costs and</li><li>the sale price,</li><li>not necessarily in that order.</li></ul><p>This is the critical realization, and what I believe to be the most thoroughly misunderstood concept in all DeFi: the question as to what the fee earnings are up to this point. The short answer is that there is no fee; <em>liquidity providers to AMMs do not charge fees</em>, and so the “fee earnings” calculation is devoid of meaning. A better question — one which is more founded in financial reality, is whether the <em>trading strategy</em> is profitable. The answer is that before we can claim to have turned a profit, we need to sell the PlayStation 5 inventory back to the market at a higher price than it was acquired for.</p><p>That is really all there is to this. Bid low on PlayStation 5s when sellers are getting anxious and ask high when the market demand is increasing. There is no other profit mechanism.</p><p>Suppose that sometime after the market takes most of our cash reserves, the nine PlayStation 5s we have listed start to receive some interest. Then, finally, a PlayStation 5 buyer takes our lowest asking price; our PlayStation inventory decreases by one and our cash reserves recover by $1,862.82 AUD. The other PlayStation 5 listings are unaffected; the next lowest ask remains at $1,904.02 AUD. However, as the cash comes in, it is immediately added to cash listings and the bidding prices are updated according to the general spread formula. This is the exact reverse of the situation where our cash market was being taken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i01Es0KEBotvVeKC38AHCQ.png" /><figcaption>Table 4: The PlayStation 5 bids and asks table after taking the first ask.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMIo9z78zd_VzgqsCRB-kA.png" /><figcaption>Figure 13: Updates to the bidding depth after taking the first ask.</figcaption></figure><p>Assume that interest in the PlayStation 5 market continues to develop, and buyers begin to accept the higher asking prices until there are only four PlayStations left in the inventory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjqrXR8LlX1RuI2wtjEUOQ.png" /><figcaption>Table 5: The PlayStation 5 bids and asks table after taking the first five asks.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHRwyDYTMDajiivSmw3QTQ.png" /><figcaption>Figure 14: Updates to the bidding depth after taking the first five asks.</figcaption></figure><p>There is exactly one correct way to evaluate the performance of this trading strategy, and there is nothing subjective about it:</p><ul><li>We started with $13,942.47 AUD in cash,</li><li>exchanged $7,900.00 AUD for five PlayStation 5s at the mid-market rate ($1,580.00 AUD), then</li><li>used the remaining $6,042.47 AUD to set up a cash market on eBay for an additional five consoles, while</li><li>simultaneously making the market for PlayStation 5s starting at an asking price of $2,000.00 AUD.</li><li>We acquired four additional consoles at an average price of $1,218.96 AUD per console, then</li><li>sold five consoles at an average price of $1,947.93 AUD.</li><li>The final balance sheet is $10,906.28 AUD in cash, and</li><li>four PlayStation 5s with a combined nominal value of $8,143.20 <em>if we trust the last unit sale price</em>,</li><li>culminating in a portfolio value of $19,049.48 and an unrealized profit of $5,107.01 (36.6%).</li></ul><p>Note that the profit here is still unrealized. The starting cash balance was $13,942.47 and we still only have $10,906.28 in reserve. The four unsold consoles are still an outstanding liability until their value is consolidated back into Australian Dollars.</p><p>This is literally everything you ever needed to know about providing liquidity to a market — be it for PlayStation 5s, or via the ETH/USDC liquidity pool on your favourite AMM. My ambition with this illustration is not only to demonstrate that the common understanding of the “fee” parameter on an AMM is dangerously removed from reality, but also to bring attention to the fact of the matter — <em>liquidity provisioning is a trading strategy</em>. There is no ambiguity, no benefit of the doubt, nothing is left to interpretation.</p><p>Some things simply <em>are</em>, regardless of how we feel about it.</p><h4><strong>The Hubris of the Defeated</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5a2rHkpoTEPdJp99VpIsA.jpeg" /></figure><p>As with the misappropriation of the term “capital efficiency”, use of the term “toxic flow” (image related) in DeFi has become all but meaningless. That is not to say that toxic flow is not a real phenomenon — it absolutely is, and its effects range from a market nuisance to financial devastation. I’d like to extend my appreciation to the original author of <a href="https://theforexgeek.com/toxic-order-flow/"><em>Toxic Order Flow</em></a> on theforexgeek.com for providing some much needed clarity, and from whom I have paraphrased the following bullets regarding what constitutes legitimate toxic order flow.</p><ul><li><strong>Spoofing</strong>: This involves a trader placing an order without any intention of letting it execute. Their goal is to falsely signal strong demand or supply, manipulating the asset’s price. After the price shifts favorably, they retract their order, capitalizing on this artificial movement.</li><li><strong>Layering</strong>: Like spoofing, layering consists of setting up several orders at varied price points. This creates an illusion of significant trading activity, swaying the asset’s price. The trader then withdraws these orders, benefiting from the resultant price shift.</li><li><strong>Marking the Close</strong>: Here, a trader executes a substantial order at or near the market’s closing time. This strategy aims to affect the closing price, which can also misrepresent the asset’s demand or supply, influencing its price.</li><li><strong>Order Stuffing</strong>: This tactic involves flooding the market with numerous orders in a brief timeframe. The overload can cause processing delays and disrupt the normal pricing of the asset.</li><li><strong>Front Running</strong>: In this scenario, a trader exploits advance knowledge of an impending order. By acting on this information, they position themselves to profit from the price changes that will follow once the large order is executed.</li><li><strong>Insider Trading</strong>: This is trading based on confidential, non-public information. For instance, a company insider might buy stock before a positive announcement, aiming to sell it post-announcement for a profit.</li></ul><p>In contrast, the concept of toxic flow in DeFi is, for lack of a better description, an imagined external tormentor that is summoned by those who end up on the losing side of bad trade (by providing liquidity to it). It is a convenient scape goat for bad businesses who get upset when they exit from their PlayStation 5 inventory only to see those same units for sale the following day at mark-up. Or, conversely, the pawn brokers who bought those PlayStations only to find that it is impossible to flip them for a profit later.</p><p>I speculate that there is, in fact, a good reason for this term to have entered the DeFi vocabulary in the context of AMMs and liquidity provisioning. Consider that despite my best efforts to make the material presented here as accessible as possible, for many DeFi users the subject matter is simply not interesting (no judgement!). My suspicion is that the people that belong to this category share a significant part of their Venn Diagram with those who don’t understand why their LP positions are losing money. Armed with only the dangerous half-knowledge afforded them by the paid shills on Twitter and YouTube, failure to perform financially could seem deeply mysterious. Together with the common misconception that losses on an LP position can be partially or wholly attributed to the actions of arbitrageurs, a crowd-sourced vision of the bogeyman on whom we can pin our accusations of unfair practices does emerge.</p><p>But this is a mistake.</p><p>The analysis in the previous section is perfectly valid on its own and does not require any additional context. In short, your trading profits and losses are what they are, irrespective of the motivations that drive eBay’s buyers and sellers to trade with you. The true toxic flow is not from those who interacted with a market you created — it is from those who would prefer the convenience of selling you on the idea of “capital efficiency” and “fees” and then never explain to you what either of those things really mean.</p><h4><strong>Conclusion</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zoMHwf4a8xqZozlhDKO89A.png" /></figure><p>In this examination, the tangible case of eBay’s PlayStation 5 market has been utilized to elucidate the financial principles underlying liquidity provision in Automated Market Makers (AMMs). This analysis, while comprehensive and perhaps somewhat technical, demonstrates that these concepts are accessible to individuals engaging with DeFi primitives on the blockchain.</p><p>The DeFi sector is often characterized by the use of marketing buzzwords and emotive narratives. While these elements play a role in fostering enthusiasm and driving adoption, they can also veil the true nature of the financial decisions inherent in these protocols. An examination of eBay’s market dynamics offers a clear parallel to the activities of DeFi liquidity providers, particularly in the context of market making and pawn brokering. The fundamental principles of buying low and selling high are universally applicable, transcending specific claims about the uniqueness of any given protocol, regardless of its tokenomics.</p><p>The notion of ‘toxic flow’, frequently misunderstood or misapplied in the context of DeFi, is critically assessed. It is often cited as a rationale for losses in unfavorable trades or as a placeholder for a user’s misunderstanding of the pricing algorithm to which they are subscribed. In contrast, traditional market manipulations such as spoofing, layering, and insider trading represent genuinely toxic activities, though they are not typically the focus when ‘toxic flow’ is discussed within DeFi circles.</p><p>As the DeFi industry progresses, it becomes essential to engage with target audiences under the premise that they seek to remain informed and critical. Rapid and efficient user onboarding processes should not eclipse the responsibility of protocol developers to offer adequate resources for self-education to those of reasonable intelligence. The aim of this article is to demonstrate that the financial theories underpinning DeFi exchange primitives are straightforward enough that the lack of basic understanding among many users is somewhat inexplicable and we, the industry leaders, should have a plan to address that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79e7a713148a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/the-2023-pre-christmas-playstation-5-blu-ray-edition-ebay-bonding-curve-79e7a713148a">The 2023 Pre-Christmas PlayStation 5 (Blu-Ray Edition) eBay Bonding Curve</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crypto Trading 101: Scaling In and Out]]></title>
            <link>https://medium.com/carbondefi/crypto-trading-101-scaling-in-and-out-16f2ef27373d?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/16f2ef27373d</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[trading-system]]></category>
            <category><![CDATA[crypto-trading]]></category>
            <dc:creator><![CDATA[Carbon]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 03:26:58 GMT</pubDate>
            <atom:updated>2023-12-15T18:51:38.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLgY3uB5zm5K9tr_6Rpw_w.png" /></figure><p>Trading cryptocurrency presents unique opportunities and challenges, particularly in the context of the market’s inherent volatility. One effective strategy for navigating this environment is “scaling,” which includes both “scaling in” (gradually accumulating tokens as the market value decreases) and “scaling out” (gradually distributing tokens as the market value increases).</p><h4><strong>Considering a Uniform Selling Strategy</strong></h4><p>A uniform trading strategy involves placing all your bids and/or asks at a single price point. This approach simplifies the decision-making process but hinges on the token reaching that specific price. For example, if you anticipate ETH dropping to $1,350 before a rally, you might place a buy order at this price. Conversely, if you expect it to rise to $2,750, you might set a sell order at that price. While this strategy is straightforward, it carries the risk of missing market movements if the price never hits the target. <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> supports this streamlined approach, offering valuable tools particularly useful for easily setting and quickly managing uniform price points.</p><h4><strong>Developing a Diversified Trading Plan</strong></h4><p>Establishing specific price ranges for buying (scaling in) or selling (scaling out) and determining the trade quantity is crucial, especially considering market volatility. A diversified trading plan, involving a tiered trading approach with staggered price points, can help to mitigate the risk of abrupt market turnarounds. For instance, for scaling in, you might buy 0.5 ETH at $1,500, 0.5 ETH at $1,350, and 0.5 ETH at $1,215. Conversely, for scaling out, you might consider selling 0.5 ETH at $2,500, 0.5 ETH at $2,750, and 0.5 ETH at $3,025. This strategy aims to achieve a balanced “geometric average” buying and selling price, which means the average price of your trades will not be simply arithmetic but adjusted based on the rate of change in each transaction. <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> facilitates this approach by allowing a straightforward setup of trades at predetermined price ranges, making it much simpler to execute a complex, tiered strategy.</p><h4><strong>Leveraging Carbon DeFi: Fine-Tuning Your Strategy with Infinite Fractional Token Orders</strong></h4><p><a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> recognizes that ERC20 tokens, like ETH, are divisible, allowing for detailed control over your trading strategy. You can distribute your holdings across multiple orders at varying prices, enhancing your chances of capitalizing on different market levels. The protocol’s “range orders” feature stands out by enabling the setting of a continuous range of prices, akin to placing a vast number of discrete limit orders populated with the smallest indivisible unit of a token. This method offers unmatched efficiency and flexibility, allowing for a sophisticated and nuanced execution of your trading strategy.</p><h4><strong>Adapting to Market Changes</strong></h4><p>A significant advantage of <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> is its ability to modify your trading strategy in real-time. This adaptability is crucial in the fast-paced world of cryptocurrency trading, enabling you to respond promptly to market changes and new information. For example, if market trends shift unexpectedly, you can quickly adjust your orders on <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> to align with the new market conditions.</p><h4><strong>Conclusion: Carbon DeFi as Your Strategic Partner</strong></h4><p>In conclusion, effectively managing entry (scaling in) and exit (scaling out) strategies requires careful planning and a deep understanding of market dynamics. <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> offers advanced tools that provide precision in managing your onchain trades. While no trading strategy is without risk, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a>’s range of tools and real-time adaptability provide the flexibility and control needed to navigate the complex world of cryptocurrency trading with confidence and clarity. Whether you’re a seasoned trader or new to the crypto market, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=CarbonMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a>’s tiered selling approach and range orders can help you strategically place your holdings at different price levels, creating a staggered selling plan that not only averages out your selling price but also adapts to market dynamics, potentially maximizing your returns.</p><p><em>For further insights, see related discussions in our companion articles:</em> ‘<a href="https://medium.com/@mark.richardson87/bitcoin-the-original-indie-rage-game-phenomenon-ab17faeb754c">Bitcoin’, the Original Indie Rage Game Phenomenon</a> <em>and</em> <a href="https://medium.com/@Jen_Here2DeFi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4">Maximize Market Gains: Scaling In and Out</a>. <em>These pieces complement the themes explored here, offering extended analysis on cryptocurrency trading and risk management strategies.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f2ef27373d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/crypto-trading-101-scaling-in-and-out-16f2ef27373d">Crypto Trading 101: Scaling In and Out</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximize Market Gains: Scaling In and Out]]></title>
            <link>https://medium.com/carbondefi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/30ea3a99c6b4</guid>
            <category><![CDATA[trading-ideas]]></category>
            <category><![CDATA[limit-order]]></category>
            <category><![CDATA[automated-trading-systems]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Jen Albert]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 23:15:13 GMT</pubDate>
            <atom:updated>2024-08-30T17:19:51.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZnlbUmH0GBaduMs7WUPSLw.png" /></figure><p>In the world of trading, particularly in volatile markets like crypto, the strategies of scaling in and out are vital. These methods allow traders to manage risk and capitalize on market opportunities more effectively.</p><h4>What is Scaling In?</h4><p>Scaling in is the process of gradually entering a trading position rather than committing all your capital at once. It involves buying or selling assets in increments as the price moves in your desired direction.</p><h4>Benefits of Scaling In:</h4><ul><li><strong>Risk Management</strong>: By not committing all your funds at one price point, you reduce the risk of entering a position at an unfavorable time.</li><li><strong>Market Adaptation</strong>: It allows you to adapt to market changes. If the market moves against your position initially, you haven’t invested all your capital and can adjust your strategy.</li><li><strong>Improved Entry Price</strong>: Over time, this can lead to a better average entry price, enhancing potential profits.</li></ul><h4>What is Scaling Out?</h4><p>Scaling out is the opposite process, where you gradually exit a position. Instead of selling all your holdings at once, you sell in portions as the price hits your target levels.</p><h4>Benefits of Scaling Out:</h4><ul><li><strong>Profit Taking</strong>: It helps in locking in profits incrementally, rather than risking everything on the market’s continued movement in your favor.</li><li><strong>Risk Reduction</strong>: Reduces the impact of sudden market reversals. By taking profits incrementally, you’re not as exposed if the market suddenly turns.</li><li><strong>Emotional Balance</strong>: Helps in managing the emotional aspect of trading by reducing the pressure of finding the perfect exit point.</li></ul><h4>The Carbon DeFi Edge</h4><p>After understanding the basics of scaling in and out, it’s important to look at how <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a>’s features can further optimize these strategies.</p><ul><li><strong>Range Limit Orders</strong>: Set a range of prices for entering and exiting the market and let <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> do the rest — automatically allocating funds within the set price range. This reduces manual effort and ensures a balanced and strategic approach to entry and exit, thus improving trade effectiveness and efficiency.</li><li><strong>No Trading or Gas Fees for Strategy Makers</strong>: Enhance cost-effectiveness and maximize returns without extra costs.</li><li><strong>Modify Pricing Feature</strong>: Quickly adjust your entry or exit prices in response to market changes without the cost and hassle associated with canceling and re-creating orders.</li><li><strong>Partial Withdrawals</strong>: Ideal for scaling out, this feature lets you withdraw a portion of your investment, allowing you to take profits or reduce exposure while maintaining a market position.</li><li><strong>Add Funds</strong>: Enhances scaling in by allowing you to add to your position at different price points, making your entry strategy more dynamic and responsive to market conditions.</li><li><strong>Pause and Unpause Trading</strong>: Offers the ability to temporarily halt or resume trading, providing greater control over your market engagement and risk exposure.</li></ul><h4>Conclusion</h4><p>Scaling in and out are essential strategies for effective trading, especially in the cryptocurrency market. By using these techniques, traders can manage risk, adapt to market conditions, and potentially improve their profitability. <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a>’s innovative features further empower traders, providing tools that make scaling strategies more efficient, flexible, and responsive to market dynamics. Whether you’re a seasoned trader or new to the game, leveraging these strategies with <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=JensMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> can significantly enhance your trading journey.</p><p><em>For further insights, see related discussions in our companion articles:</em> Trading <a href="https://medium.com/carbondefi/crypto-trading-101-scaling-in-and-out-16f2ef27373d">Crypto 101: Scaling In and Out</a> <em>and</em> <a href="https://medium.com/@mark.richardson87/bitcoin-the-original-indie-rage-game-phenomenon-ab17faeb754c">‘Bitcoin’, the Original Indie Rage Game Phenomenon</a>. <em>These pieces complement the themes explored here, offering extended analysis on cryptocurrency trading and risk management strategies.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30ea3a99c6b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4">Maximize Market Gains: Scaling In and Out</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[‘Bitcoin,’ the Original Indie Rage Game Phenomenon]]></title>
            <link>https://medium.com/carbondefi/bitcoin-the-original-indie-rage-game-phenomenon-ab17faeb754c?source=rss----bce9c4b6cf23---4</link>
            <guid isPermaLink="false">https://medium.com/p/ab17faeb754c</guid>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[Mark Richardson]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 23:11:19 GMT</pubDate>
            <atom:updated>2023-12-18T14:29:58.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JAFrz_niHEbJ8u8WDePiQ.jpeg" /></figure><p>I heard you have some BTC, and you are looking to scale-out this cycle. Oh, you have never heard the term “scale-out”? It basically means you are done hodling your bags and plan to flip them into a <a href="https://koinly.io/au/">tax obligation</a> as the market rallies to the upside.</p><p>The premise is simple: set your bidding (or asking) price, and the number units you are willing to trade with. Think Bitcoin is going to $600,000? Why wait — throw it up on the order book with a $600,000 price tag and when the market is ready, <a href="https://x.com/saylor/status/1730226879125160426?s=20">Mike Saylor will buy it from you</a>.</p><p>But what if BTC doesn’t make it to $600,000? What if the market careers up to $590,000 and stalls? Surely it is going to top out at least near $500,000, right? Right? […] Maybe you aren’t sure. Alice in accounting said that she doesn’t expect Bitcoin to go much further than $200,000 this cycle. And you heard her friend, Bob, thinks that it will get rejected off the $70,000 level, forming a macro “double top”, whatever that is.</p><p>Okay, let’s back up. You have collected a few bitcoins over the years, so think carefully about how you might want to take profits on them. Let’s put one of your Bitcoins up for sale for $600,000 (hopefully we get there). I guess it would be sad if Bob was right, and the market turned around at only $70,000 — but how upset are you going to be if you sold nothing there, and hodled your bag back down to $12,000? Maybe, sell one of your Bitcoins at $70,000? It’s up to you — but you should know that Bob lost it all shorting $DOGE. Are you really going to listen to that hack?</p><p>One Bitcoin left. Alice thinks $200,000 is reasonable, and her job is <em>literally counting money</em>; we should consider her opinion. Ok, so if all your price targets are met to the upside, you will sell:</p><pre>1 BTC @ $70,000<br>1 BTC @ $200,000<br>1 BTC @ $600,000<br>Total: 3 BTC @ $290,000 (average)</pre><p>That’s going to wreak havoc on your OCD. You know, if you bump up that first number just a little, you can get the total to be a much nicer looking, even $300,000?</p><pre>1 BTC @ $100,000<br>1 BTC @ $200,000<br>1 BTC @ $600,000<br>Total: 3 BTC @ $300,000 (average)</pre><p>Wait, does that mean you should just put all 3 BTC in the book at $300,000? I mean, you would get the same result overall, and you wouldn’t even need BTC to go to $600,000 anymore.</p><pre>1 BTC @ $300,000<br>1 BTC @ $300,000<br>1 BTC @ $300,000<br>Total: 3 BTC @ $300,000 (average)</pre><p>Ah, but now you won’t get anything unless BTC makes it all the way to $300,000. I guess that’s the risk you are taking, putting all your chips down at exactly one price point. We should think about systematizing this. For example, what if you put 1 BTC at $300,000, and 1 BTC 20% below, and 1 BTC 20% above?</p><pre>1 BTC @ $250,000<br>1 BTC @ $300,000 (i.e. $250,000 + 20%)<br>1 BTC @ $360,000 (i.e. $300,000 + 20%)<br>Total: 3 BTC @ $303,333.3333…. (average)</pre><p>That’s weird. The steps seem right: $250k -&gt; (+ 20%) -&gt; $300k -&gt; (+ 20%) -&gt; $360k, but the average price is $303k, not $300k (your OCD be damned). It’s like a different kind of average price. They should really give it <a href="https://en.wikipedia.org/wiki/Geometric_mean">its own name</a>.</p><p>Anyway, does this feel better? Would you be happy if you only got to sell 1 BTC at $250,000? What if the price only went to $299,999.99! Can you imagine! Just one more cent and you might have sold one more BTC at the top. If only you had more BTC — then you could put a bunch of orders in the book, instead of only three.</p><p>Oh! BTC is actually composed of <a href="https://bitcoin.stackexchange.com/questions/114/what-is-a-satoshi">100,000,000 satoshis</a>. So then, why don’t you split those BTC up and spread them out a little more? Then you don’t have to worry about missing the next price step so much. Something like:</p><pre>0.5 BTC @ $250,000<br>0.5 BTC @ $268,913 (i.e. $250,000 + 7.57%)<br>0.5 BTC @ $289,258 (i.e. $268,913 + 7.57%)<br>0.5 BTC @ $311,141 (i.e. $289,258 + 7.57%)<br>0.5 BTC @ $334,680 (i.e. $311,141 + 7.57%)<br>0.5 BTC @ $360,000 (i.e. $334,680 + 7.57%)<br>Total: 3 BTC @ $303,333.3333…. (average)</pre><p>So if BTC gets all the way to the target of $360,000, there is no difference — you still get an average price of $303k and change. At least now you will be better off if whales start dumping at $299,999.99, because you will have already sold half your BTC before then. But, wait a second. What if the market turns around at $268,912.99? Then you only get to sell 0.5 BTC. You could split it up further, I guess. After all, you have three hundred million satoshis. Potentially, you could set up three hundred million limit orders:</p><pre>0.00000001 BTC @ $250,000.000000000<br>0.00000001 BTC @ $250,000.000000304 (i.e. $250,000.000000000 + 0.0000000012%)<br>(Repeat this three hundred million times. I’ll wait.)<br>0.00000001 BTC @ $359,999.999562428 (i.e. $359,999.999124857 + 0.0000000012%)<br>0.00000001 BTC @ $360,000.000000000 (i.e. $359,999.999562428 + 0.0000000012%)<br>Total: 3 BTC @ $303,333.3333….</pre><p>Perfect! Now you won’t miss a beat. Try to be fast, though. If you can set up 1 order per second, it will only take you 9.5 years to get everything ready. I’m sure the BTC markets will wait for you. It’s a shame you are only using an antiquated blockchain and centralized exchanges. If you were autistic enough to be on Ethereum, you could set up exactly this in roughly the time it takes to quote Mike Saylor’s investment thesis, “buy Bitcoin”.</p><p>On <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> this is called a “range order” — it’s like an infinite number of limit orders. You just tell it the start ($250,000) and end ($360,000) prices and put your tokens up for sale. Yes, you’re right! It’s <em>exactly</em> like DDOSing eBay with hundreds of millions of Beanie Babies listings. Except <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> is built to handle continuous pricing — so while billions of limit orders would tank your t̶o̶t̶t̶e̶r̶i̶n̶g̶ booming centralized exchange, it is not a problem for DEXes. Although, occasionally a few dozen cartoon JPEGS of cats can <a href="https://www.bbc.com/news/technology-42237162">gridlock</a> the entire Ethereum network. Blockchains are weird.</p><p>Yes, you can modify your position on <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> very easily. When the market starts creeping up to your price targets, you can choose to keep moving them away forever and never sell anything. Or, you can panic after lunch with Bob and choose to sell everything right now at whatever price your favorite TA guy tweets about. You can take some out and keep hodling it, put more in, move the price range — all from a UI that even your zoomer offspring would find appealing.</p><p>You’ll be fine. Have fun with it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtrLFVOta0XNxwERj-fPwA.jpeg" /></figure><p><em>Hello! I’m the Moai Monitor, your digital guide here to distill complex ideas into clear insights below.</em></p><p>This article is a satirical and somewhat technical piece on cryptocurrency trading strategies, specifically focusing on Bitcoin (BTC). It uses humor and sarcasm to discuss the complexities and uncertainties of setting price targets for selling Bitcoin.</p><p>The article starts by discussing the concept of “scaling out” of a position, which means selling off assets (in this case, Bitcoin) in increments at different price points. It humorously references the unpredictability of Bitcoin’s price, poking fun at the wide range of predictions from different people.</p><p>The writer uses a hypothetical scenario where a Bitcoin holder sets various ambitious price targets ($70,000, $200,000, and $600,000) for selling their Bitcoins. This reflects the real dilemma faced by traders in setting realistic yet profitable price targets. The writer also plays with the idea of averaging the selling price and aligning it with a neat figure ($300,000) for the sake of satisfying one’s OCD (Obsessive-Compulsive Disorder). This part satirizes how traders might overthink or overcomplicate their strategies for psychological satisfaction.</p><p>The dilemma of setting trading targets, as illustrated in the article, is indeed a significant concept in the world of trading, particularly in the volatile and unpredictable cryptocurrency markets.</p><ul><li><strong>Predicting Market Movements:</strong> One of the core challenges in trading is the difficulty of accurately predicting market movements. Cryptocurrency markets, known for their high volatility, exacerbate this challenge. Setting trading targets requires a trader to anticipate future price levels, which is inherently uncertain.</li><li><strong>Balancing Greed and Fear:</strong> The article touches on the emotional aspects of trading — greed and fear. Traders often struggle with the decision of when to sell: too early, and they might miss out on potential gains (greed); too late, and they might lose their profits or even incur losses (fear). Setting and sticking to predetermined targets can help manage these emotions.</li><li><strong>Influence of External Opinions:</strong> The article humorously references opinions from ‘Alice in accounting’ and ‘Bob’, who have different, somewhat arbitrary predictions for Bitcoin’s price. This highlights how traders might be influenced by others’ opinions, which can be unreliable or biased, or may not be based on sound analysis. This highlights the importance of developing one’s own informed trading strategy rather than relying on hearsay or following the crowd.</li><li><strong>Complexity of Trading Strategies:</strong> The article also satirizes the complexity that can be involved in setting trading targets. While a sophisticated strategy can be beneficial, overcomplicating things can lead to analysis paralysis or errors in execution.</li><li><strong>Adaptability and Flexibility:</strong> The dynamic nature of the market means that traders need to be adaptable. However, constantly changing targets or strategies in reaction to market movements can be a double-edged sword — it can either lead to better outcomes or result in poor decision-making under pressure.</li><li><strong>Technological Tools and Platforms:</strong> The discussion about <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> and range orders points to the evolving technological tools available to traders. These tools can offer more sophisticated ways to set and execute trading strategies.</li></ul><p>The laddered order structure mentioned in the article is a geometric sequence, which accumulates a geometric average price as each order is executed. In finance and trading, a geometric sequence or progression is a sequence of numbers where each term after the first is found by multiplying the previous term by a fixed, non-zero number called the ratio. This concept is often used in trading strategies like the one described in the article.</p><ul><li><strong>Starting Point:</strong> The sequence begins with an initial selling price. In the article, this is $250,000 for 0.5 BTC.</li><li><strong>Fixed Ratio:</strong> Each subsequent selling price is determined by multiplying the previous price by a fixed ratio. The article suggests a 7.57% increase each time, which is the ratio in this case.</li><li><strong>Application in Orders:</strong> This leads to a series of orders placed at increasing prices. Each price is 7.57% higher than the last. For example, if the first order is at $250,000, the next would be $250,000 multiplied by 1.0757, and so on.</li><li><strong>Advantages in Trading:</strong> This strategy can be advantageous in markets with high volatility and unpredictability, like cryptocurrencies. By setting up a laddered, geometric sequence of sell orders, a trader can potentially capture profits at various levels as the price rises, without trying to predict a single ‘top’ price.</li><li><strong>Risk Management:</strong> Such a strategy also helps in risk management. By not committing to a single exit price, traders can mitigate the risk of missing out on potential gains if the price doesn’t reach their single target price. It also helps in systematically taking profits while still leaving room for upside potential.</li><li><strong>Geometric Sequence Formula:</strong> Mathematically, a geometric sequence is described by the formula:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KedKlKmJPxgX52xgSI6Y5g.png" /></figure><p>The article concludes with a mention of <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a>, the most recent product from Bancor, highlighting its capability to facilitate a laddered trading strategy efficiently. This part of the article points to the evolving landscape of blockchain trading products and the unique advantages of <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> over traditional centralized exchanges.</p><ul><li><strong>Range Orders:</strong> In traditional centralized exchanges, placing many orders (like a laddered strategy with many incremental steps) can be cumbersome and time-consuming. However, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> is designed to handle such strategies more efficiently. It can automate the process, allowing for the placement of quasi-infinite orders across a range without the need to manually set each one. This feature allows traders to specify a start and end price for their orders, and the system automatically creates a series of orders within this range.</li><li><strong>Smart Contracts and Automation:</strong> <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> leverages blockchain technology and smart contracts. Smart contracts can automate the execution of trades based on predefined criteria, such as the laddered price points in a geometric sequence. This reduces the manual workload and potential for human error.</li><li><strong>Accessibility and Flexibility:</strong> <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> is more accessible and flexible compared to traditional exchanges; it offers a wider range of tools and customizable options for traders, catering to both novice and experienced users.</li><li><strong>Decentralization Benefits:</strong> Being decentralized, <a href="https://www.carbondefi.xyz/?utm_source=Medium&amp;utm_medium=MarksMedium&amp;utm_campaign=ScalingInOut">Carbon DeFi</a> is not controlled by any single entity, which can offer advantages in terms of reduced counterparty risk, potentially lower fees, and resistance to censorship.</li></ul><p><em>For further insights, see related discussions in our companion articles: </em><a href="https://medium.com/carbondefi/crypto-trading-101-scaling-in-and-out-16f2ef27373d">Crypto Trading 101: Scaling In and Out</a><em> and </em><a href="https://medium.com/@Jen_Here2DeFi/maximize-market-gains-scaling-in-and-out-30ea3a99c6b4">Maximize Market Gains: Scaling In and Out</a><em>. These pieces complement the themes explored here, offering extended analysis on cryptocurrency trading and risk management strategies.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab17faeb754c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/carbondefi/bitcoin-the-original-indie-rage-game-phenomenon-ab17faeb754c">‘Bitcoin,’ the Original Indie Rage Game Phenomenon</a> was originally published in <a href="https://medium.com/carbondefi">CarbonDeFi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>