# Botanix Interaction with Arch -- Native DEX of the Spider Ecosystem (English Version)                                                  ![image](https://hackmd.io/_uploads/BksUJgSCyg.png) [TOC] ## 1. Introduction to Arch     **Arch** is a native decentralized exchange (DEX) using the industry's leading DEX protocol [algebra](https://algebra.finance/) (the name itself sounds pretty advanced 😄), designed to provide liquidity for the Botanix ecosystem's Btcfi. Arch utilizes Botanix's cutting-edge Spiderchain technology to unlock Bitcoin liquidity for EVM-based applications.     Let's first talk about the differences between DEX and CEX. When we purchase tokens like BTC/ETH on centralized exchanges such as Binance or OKX, it is done through an order book model, similar to how stock exchanges work, where someone must sell for you to buy, and vice versa. In centralized exchanges, your assets are held by the exchange, and when you want to trade, users place orders, and the exchange's order book matching engine completes the transactions. What are the benefits of this? It's simple and efficient. The downside, however, is platform risk. If a platform suddenly has issues, where do you go to file a complaint? Plus, with the introduction of KYC, it goes against the original ethos of Web3.     How does a decentralized exchange (DEX) work then? The logic behind a DEX is that your funds are always in your own wallet, and when you need to trade, the distributed exchange uses an Automated Market Maker (AMM) algorithm to automatically price and complete the transaction. Users directly exchange assets with a smart contract. This is the trading logic behind well-known DEXs like Uniswap, Curve DEX, PancakeSwap, and Balancer. *    Here’s a thought. There’s a question that puzzled me: with so many DEXs (***I checked, and according to data from DeFiLlama as of 2025-04-10, there are already 1643 DEX protocols***), why do they all need to provide liquidity? After thinking about it, I realized it's similar to the stock market, where there is only one exchange, but there are many securities firms. The logic becomes clearer (this is just for understanding, as DeFi and the real world are quite different). First, DEXs are the core engine of DeFi. Second, there’s a natural need for market diversification and competition. Third, in the DeFi space, the biggest driving force is liquidity, and risk management is necessary. Without liquidity, an ecosystem cannot function on its own.* --- this is purely my personal understanding.     Now, let's return to the topic. What exactly is AMM behind DEX? To understand AMM, let's start from the simplest: - ***At first, with just one trading pair, it's simple*** *We set up a primitive trading platform (the early form of DEX). Someone provides liquidity, for example:* 1 BTC to 10 USDT (wishful thinking 🤭) *They provide a 50% BTC + 50% USDT asset pool. The liquidity provider injects assets into the pool, and according to an algorithm (e.g., Uniswap V2 x x y=k), traders can always exchange based on the current pool price.* *Traders pay a 0.3% fee (default for Uniswap). This fee is distributed among the liquidity providers (LP).* *The platform may also issue tokens to reward LPs (e.g., UNI, CAKE).* - ***From one trading pair to multiple trading pairs*** *BTC/USDT ETH/USDT UNI/ETH DOGE/SHIB (crazy)* *This involves the management of many DEX mechanisms:* *Each pool has its own liquidity, fee strategy.* *Each trading pair may cause “slippage.”* *Cross-pair trading involves “pathfinding” (e.g., USDT → BTC → ETH).* - ***A bit more complicated, with multi-chain and multi-DEX/CEX involved*** *Different chains have their own DEXs (Uniswap on Ethereum, Pancake on BSC, TraderJoe on Avalanche), and each has independent liquidity pools. There are also decentralized CEXs like Binance, OKX...* *You want to swap USDT from BSC to ETH on Ethereum?* *This involves:* - Cross-chain bridges (Bridge) - Asset mapping (Wrapped Tokens) - Price synchronization mechanisms (Oracles) - MEV issues (Arbitrageurs might manipulate paths) - Aggregated trading (e.g., 1inch, Paraswap) - Fragmented liquidity - Aggregated trading vs user experience - More complex incentives and governance mechanisms     To implement all these complex logics, the core is AMM (Automated Market Maker), which is an automated pricing and trading model. ***My personal understanding is that the ultimate or ideal state of AMM should be using algorithms and protocols, combined with smart contracts, to integrate the different token pairs across various chains and provide a unified, real-time exchange quote system***. > Algebra is a groundbreaking AMM and a centralized liquidity protocol for decentralized exchanges. It operates with adaptive fees and serves over 30 decentralized exchanges in DeFi. Algebra's cumulative trading volume has surpassed $70 billion, with a 24-hour trading volume of $679 million and a total value locked (TVL) of $251 million. > Algebra’s DEX protocol is recognized as the 7th largest fork protocol on DeFiLlama.     The information above comes from the official Algebra website. If you're interested, you can check out the [Algebra](https://algebra.finance/) official site.     I tried to find the relevant data on DeFiLlama but couldn’t find the answers I was looking for. However, we can look at the official ecosystem. At least many DEXs use its protocol, including our very own ***Arch***, which I believe proves the point. ![algerbra](https://hackmd.io/_uploads/rk5P20eCke.jpg)     In summary, ***Arch*** is built on trusted algorithm models (V3/V4 liquidity models) and reliable protocols (algebra + arch), constructed on a trusted chain through (***Botanix Spiderchain*** + BTC), forming a full lifecycle of reliability and security based on decentralized distributed systems. What we want is a reliable, secure, and decentralized trading platform, so we can sleep soundly and feel at ease. Whether we make money or not, it doesn’t matter 🙂, yes, this is it!     I’m a beginner myself, and implementing AMM/DEX protocols involves many algorithms and ecosystems, such as ALM (Automated Liquidity Management, the fund managers of DeFi), Aggregators (DeFi’s version of ebay), Cross-Chain Bridges, Blockchains (e.g., BTC, ETH), and of course, our ***Botanix***, Auditors (compliance auditors in DeFi). After integrating these complex ecosystems, we form a platform that may appear simple on the front end but requires much professional work behind the scenes. So, what can we ordinary investors or users do on this platform? If you’re still not convinced, you can check out the [Algebra](https://algebra.finance/) V3/V4 documentation, or Uniswap’s V3/V4, but I won’t go into more details. The more I talk, the less I understand 😓😓😓 ### What Can We Ordinary Investors Do on Arch? ***1. Regular Trades (Swap)***     SWAP is simple to understand; the DEX backend does all the hard work for you. You simply exchange between two tokens supported by the DEX, just like how you trade on centralized exchanges like Binance or OKX, except instead of matching buyers and sellers via an order book, here the AMM mechanism handles the transaction for you. ***2. Provide Liquidity (Earn Fees and Platform Token Arch)***     Since DEXs operate through AMM, liquidity providers (LP) are needed. But why would anyone do that if there’s no benefit? That’s where we come in. When you provide liquidity to a liquidity pool like BTC/PUSD, you’re essentially providing liquidity to that token pair. The benefits come from transaction fees and platform rewards. Arch’s platform token is Arch, which is mainly used to reward LPs, helping to offset some impermanent loss. What’s impermanent loss, you ask? When you provide liquidity to a decentralized exchange (DEX), the price fluctuations of assets can lead to losses compared to just holding those assets. If you want to learn more, you can check out some resources on impermanent loss in the links provided later.     For a big trading pair, the liquidity provided by retail investors alone wouldn’t be enough, and the pool could dry up (just like a real-world run on the bank). In the DeFi ecosystem, liquidity relies on various automatic mechanisms, professional arbitrage bots, DEX aggregators, ALMs, staking, liquidity mining, and more. Theoretically, as long as the pool doesn't dry up, the liquidity will remain.     But LP (Liquidity Pools) is difficult to understand. Let’s use Uniswap as an example. Most liquidity pools today use the Uniswap V3 protocol, which improves liquidity efficiency by allowing users to set custom price ranges. Here's a table that explains Arch’s liquidity range settings better: | Mode | Price Range | Potential Profit | Risk of Missing Profits | Frequency of Adjustments | Asset Ratio | Suitable Users | |--------|-----------------------|------------------|-------------------------|--------------------------|-------------|---------------------------------------| | Narrow | 75K ~ 79K (close to current price) | ⭐⭐⭐⭐ (very high) | ✅ Yes, price moves could cause you to miss profits | ✅ Yes, needs monitoring | 60% BTC + 40% USDT (or 50/50) | Users who monitor the market and are willing to adjust | | Common | 70K ~ 85K (common range) | ⭐⭐⭐ (high) | ⚠️ Occasionally, profits might be missed | ⚠️ Sometimes adjustment needed | 55% BTC + 45% USDT | Users who want medium-high returns but don't want to watch the market all the time | | Wide | 50K ~ 100K (wide range) | ⭐⭐ (average) | ❌ Less likely to miss profits | ❌ Doesn't need adjustments | 65% BTC + 35% USDT | Conservative users looking for stable long-term returns | | Full | Unlimited (all prices) | ⭐ (lowest) | ❌ Always effective | ❌ No adjustments required | 50% BTC + 50% USDT | Beginners, or users who don’t want to worry about configurations |     That’s about it for now. As for the technical details, I believe Arch’s ultimate goal is to integrate Algebra’s modular architecture in V4 Integral, directly competing with Uniswap V4. Compared to V3, there are significant improvements, such as: * **Modular Architecture** * **Customizable Plugins** * ***Dynamic Fee Plugin***: No need to monitor manually, it will automatically optimize your liquidity range. * ***On-chain Farming Plugin***: Can implement liquidity mining on DEX? * ***Limit Orders Plugin*** * ***Oracles for TWAP and Volatility*** * **Single Pool Architecture for Each Trading Pair**: Reduces liquidity fragmentation, simplifies the optimal path for swaps, and simplifies liquidity management for LPs. * **Lower Gas Fees** By improving the security and stability of the platform, these features enhance the LPs' earnings, thereby boosting liquidity. For more details, feel free to explore the [Arch official documentation](https://docs.arch.fi/protocol/core-logic). ## 2. Third-party Task Websites * Galxe [Arch Testnet: Enter the Spiderchain!](https://app.galxe.com/quest/AAAdNKfsWmWNBCnGuGYxcY/GCZ4etoNJ4) [Arch Testnet: Learn & Earn](https://app.galxe.com/quest/AAAdNKfsWmWNBCnGuGYxcY/GCFcTt1yGs) Since this project is part of the Botanix ecosystem, completing other Botanix tasks is necessary. If you haven’t participated before, refer to my other article [Botanix Testnet Interaction](https://x.com/xuemiaolan/status/1901789656922083772). ## 3. Social Tasks ### Common Tasks * [X](https://x.com/intent/follow?screen_name=arch_swap) * [Discord](https://discord.gg/S6pacMN2) * No TG found yet ### Community Roles (DC) * No specific information yet, will be updated later. ## 4. Testnet Interaction * **SWAP Transactions** No need to explain much, you swap two tokens, just as you would on any centralized exchange. ![image](https://hackmd.io/_uploads/B17GpWWAJe.png) * **Pool Operations** * ***Add Liquidity*** By now, you should have a basic understanding of what liquidity is. There are four preset price ranges for you to choose from, based on the current price. After selecting any range, you can also manually adjust the min and max price ranges for liquidity. Try adjusting it and see how the APR and the token pair ratio change. * ***Narrow*** * ***Common*** * ***Wide*** * ***Full*** ![image](https://hackmd.io/_uploads/S1rwJbrA1l.png) ![image](https://hackmd.io/_uploads/ryW-gbHAJg.png) ![image](https://hackmd.io/_uploads/rJpUxbrR1l.png) * ***Add Liquidity*** Nothing complicated here, just adding more funds to your existing liquidity pool to earn more profits. ![image](https://hackmd.io/_uploads/Sy_p-WHAkl.png) ![image](https://hackmd.io/_uploads/S17EMbS0yg.png) Two operations are required to complete this: first approve, then add. * ***Remove Liquidity*** This is simply withdrawing liquidity from the pool, you can choose to withdraw all or a part of it. ![image](https://hackmd.io/_uploads/Sk-G7-BAke.png) ![image](https://hackmd.io/_uploads/H1c4m-r01l.png) * ***Create New Pool*** This is like creating a pool that didn’t exist before, but I haven’t found a method for it yet. If anyone has, please give it a try. ![image](https://hackmd.io/_uploads/BJoGNbB0Jg.png) ## 5. Conclusion     I’m also a beginner in Web3, and writing this article was a challenge for me. However, I truly believe in diving into the Web3 space, and it’s worth it. **Back to the essence. Stay real. Documenting every step on-chain.** I like the formula shared by "Lonely Brother," I don’t like trees, I like the color of trees. I’m grateful for the spiders that helped me grow.     Even though I’ve just joined the community recently, I want to thank the teachers in the DC group, especially ***(Lonely is a disease, needs treatment) aifei1 [X](https://x.com/chen150805)*** for their witty humor, and **zzzzztai** [X account](https://x.com/pengyuyuan123) and leader **Wade [BotanixLabsCN](https://x.com/BotanixLabsCN)** for their guidance and promotion. ## Botanix Testnet Series Articles More coming soon. Follow [Twitter](https://twitter.com/xuemiaolan) for updates: * **English Verion** 1. **[Botanix Testnet Faucet Collection (English Version)](https://x.com/xuemiaolan/status/1908682212171801059)** 2. **[Botanix Testnet Interaction Guide (English Version)](https://x.com/xuemiaolan/status/1910711696962052446)** * **Chinese Version** 1. **[botanix 测试网领水(faucet)汇总](https://x.com/xuemiaolan/status/1908504291478036505)** 2. **[Boanix 测试网交互](https://x.com/xuemiaolan/status/1901789656922083772)** 3. **[Botanix 交互之生态篇--Palladium 去中心化的稳定币发行协议 ](https://x.com/xuemiaolan/status/1902332151217172862)** 4. **[Botanix 之生态交互终级篇:一口气带你做完与蜘蛛合作的七个生态,50+TX 交互](https://x.com/xuemiaolan/status/1904520725836546197)** 5. **[Botanix 交互 系列之 Arch –蜘蛛生态原生DEX(去中心化交易所)](https://x.com/xuemiaolan/status/1910608268105572802)** ## Join the Botanix Community [Botanix Labs & Friends](https://x.com/i/communities/1772214299731062832) An open group for the Spiderchain community to learn, chat, and stay updated on the latest from Botanix Labs. ## Reference Links **Dynamic Fees:** [Dynamic Fees](https://algebra.finance/static/Algerbra%20Tech%20Paper-15411d15f8653a81d5f7f574bfe655ad.pdf) **Impermanent Loss (IL):** [Understanding Impermanent Loss on Quickswaps V3](https://blog.quickswap.exchange/posts/understanding-impermanent-loss-on-quickswaps-v3) [Arch FAQ on Impermanent Loss](https://docs.arch.fi/start/common-questions/impermanent-loss) **Impermanent Loss (IL) Simulators:** [Uniswap V3 Simulator](https://defi-lab.xyz/uniswapv3simulator) **DEX Ultimate Solution Algebra:** [The Ultimate Algebra Solution for DEXs vs. Uniswap V3](https://medium.com/@crypto_algebra/the-ultimate-algebra-solution-for-dexs-vs-uniswap-v3-4832a39d8d82) ****** ![image](https://hackmd.io/_uploads/BJGfeprnkx.png) Write by Xuemiaolan | [Twitter](https://twitter.com/xuemiaolan) *Botanix Sequoia Ambassador* Date: April 10, 2025