How to Build Your Own SCP App: A Prototype for Next-generation Blockchainless DEXs
Decentralized applications do not have to be built on a public blockchain like Ethereum.
When we are talking about DEXs, we generally refer to smart contract programs that run on Ethereum like Uniswap. This post will describe how to build a DEX in a new way that combines the automated market-making capabilities of Uniswap and the same security properties as blockchains. Even better, the new DEX model provides nearly infinite scalability without the risk of MEV.
How Uniswap Works
The concept of automated market making originates from Uniswap. Hence, a new type of DEXs cannot be built in isolation from the design philosophy behind Uniswap, that is, using the simplest algorithm in combination with a blockchain to allow every user to be a market maker in place of specialized agencies.
The overall architecture of Uniswap v3 is shown in the figure above. The smart contracts of Uniswap v3 are executed in the EVM, which is run by every geth node. Hence, the computation process of v3 is performed by thousands of nodes, which reach a consensus via the PoW mechanism.
Take a closer look at the smart contracts of Uniswap v3. What Uniswap v3 essentially does is to aggregate NFTs by using the Router. Behind each of the NFTs is a liquidity pool provided by an individual user who sets a specific bonding curve and a price range for market-making. When a user sends a quote request to a v3 smart contract, the Router will generate the current best price by performing an aggregation computation. The user will sign a transaction at that price and send it to the Uniswap contract for execution. The transaction will lead to synchronous update of multiple NFTs, ensuring that the swap functionality of Uniswap is secure and reliable for users.
The Prototype of the Next-generation DEXs
Before creating a prototype, you need to learn about everPay and its bundle transaction. everPay is a blockchain-based financial infrastructure that combines Arweave and SCP. By offering real-time transfers and a verifiable ledger, everPay allows users and developers to conduct token settlement in real time.
In everPay, a bundle transaction is a type of opAction. It allows a many-to-many transfer that requires the signatures of all transfer parties. If any of the subtransactions in a bundle transaction fails, the entire bundle transaction will be rolled back. Generally speaking, a bundle transaction is a many-to-many transactional transfer functionality.
Now that you have learnt about how Uniswap v3 works, you can build a new generation of DEXs on top of the SCP basics and everPay’s bundle transactions.
Firstly, the Router Contract in Uniswap v3 can be replaced by router nodes. A router node is a routing gateway node that can be deployed by anyone to collect the information of liquidity providers (LPs). Similar to the Router in v3, a router node can obtain the best price and swap path by performing aggregation computations when receiving a quote request.
Secondly, the NFTs in Uniswap v3 can be replaced by LP nodes, which are in control of a private key and an automated signature program. The LP node program will make quotations and sign bundle transactions according to the user-defined curve and price range. When an LP node starts, it will connect with router nodes and submit quote information to them. Router nodes will send valid bundle transactions to LP nodes, which will sign the ones in compliance with their own market-making rules. The successfully signed transactions will be sent back to router nodes.
Transaction process:
- A user sends a quote request to a router node.
- The router node generates the best quote and swap path with information gathered from multiple liquidity providers.
- An instance of a bundle swap path: UserA transfers tokenA to lpB, lpB transfers tokenB to lpC, lpC transfers tokenC to userA.
- If the user agrees with the quote, he will sign the transaction. And then the route node will ask all the LP nodes involved to sign it. The quote also needs to be confirmed by the LP nodes.
- The router node will submit the bundle transaction to everPay for execution after it gathers all the signatures required.
Benefits of the Next Generation of DEXs:
- A fully distributed P2P network that cannot be disrupted or shut down. Anyone can deploy a router node or an LP node in the network;
- Infinite scalability. Every router node can connect with hundreds of LP nodes and provide aggregation services for tens of thousands of users. An unlimited number of router nodes can be deployed in the network.
- No MEV. A user will be paid exactly the same price at which he signs the bundle transaction. If any of the LP nodes fails to pay the corresponding tokens, the entire bundle transaction will be rolled back, which means it does not happen at all.
- Ultrahigh asset security. Since LP nodes have their own private key and assets in hand, hackers have to attack them one by one to steal their assets, which means the attack vectors are highly distributed.
Such a network offers an optimal user experience. You only need to access the UI that connects to a router node and then sign your transaction at the price provided by the router node. Since the router node communicates with all the LP nodes that connect to it by using websocket, the transaction can be signed in seconds and then executed by everPay in real time. In addition to the high-speed transaction processing, you can also benefit from no slippage because the quote you are offered is what you finally get. In this way, you do not need to worry about any MEV extraction conducted by flashbots, which is commonly seen on Ethereum.
The only drawback is that becoming an LP needs to run a node, but there are workarounds. For example, your mobile wallet can be an LP node. As long as you set a price range and select a market-making curve on your phone, you can utilize the idle assets in your wallet for automated arbitrage. You can participate in the DEX’s swap network as if you were playing online games, and the program on your phone will stay online and conduct automated market-making according to your custom rules.
Conclusion
As is shown in the prototype above, we can build a decentralized application without any on-chain smart contract at an extremely low cost. Such a development mode conforms to the mindset of Web2 developers. We can expect that the rise of the Web3 era will go beyond blockchains and EVM and bring out more paradigms for building Web3 applications. The SCP proves to be an excellent option for Web3 development by providing applications with the immutability and traceability of blockchains as well as the scalability of large-scale systems.
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
您可能感兴趣
-
Oasis 协议基金会启动 ROFL 主网:面向 AI 应用的 TEE 可验证链下计算框架
2024 年 7 月 2 日 — 专注于人工智能和隐私保护的 Oasis Layer 1 区块链的治理机构 Oasis 协议基金会,正式宣布推出 Runtime Offchain Logic(ROFL
-
稳定币不是Web3专属,传统企业全面入场
1.背景:稳定币需求持续增长过去,稳定币仅被视为加密世界的重要工具,主要用于链上交易和资产避险等。如今,稳定币的角色正在发生深刻转变。稳定币总市值自 2018 年年末的 6.5 亿美金,至 2025
-
亏损必赔 0费率:BitMart重构交易保障范式
2025 上半年的加密市场,是一场高波动性与用户流失压力并存的生存竞赛。据 CoinGecko 数据,大部分中心化交易所现货交易量萎缩,创下 2024 年以来最大季度跌幅。在比特币主导地位攀升的“吸血
-
不赔偿国内受害者,FTX 的破产律师自己赚了多少钱?
谁在做决定、依据何种标准行事、最终受益者又是谁?作者:Sleepy,BlockBeats2025 年 7 月 4 日,FTX 债权人代表 Sunil 在社交平台发布了一份 FTX 破产清算的文件截图,
-
Lorenzo 推出测试网产品 USD1 OTF,率先落地基于 USD1 的链上真实收益基金
深潮 TechFlow 消息,7 月 4 日,链上资产管理平台 Lorenzo 正式推出其首个 OTF(On-chain Traded Fund)测试网产品 —— USD1 OTF,也是其首个以 U
-
Matrixport:比特币或将突破关键阻力位,迈向新交易区间
深潮 TechFlow 消息,7 月 4 日,据Matrix on Target最新周度报告显示,比特币价格虽持续横盘于窄幅震荡区间,但多项技术指标和市场数据暗示其可能即将突破关键趋势线阻力,迈向新的
-
AI赛道下一个大叙事?盘点值得关注的vibe coding项目
今年初开始,「vibe coding 氛围编码」逐渐成为 AI 圈热门的讨论方向之一。而在币圈,随着比特币保持强势,大家对于山寨季的渴望也愈来愈强。币圈的 AI 赛道经过 AI meme 和 AI A
-
Hotcoin Research | 链上炒股时代来临:股票代币化热潮解析与展望
本文将围绕股票代币化的基本原理、优势、代表平台以及其对加密市场和传统金融格局的影响展开详细解析,并探讨股票代币化未来可能的发展路径。作者:Hotcoin Research一、引言随着加密资产ETF和R
- 成交量排行
- 币种热搜榜