BTCSwap
1. Project Overview
1.1 Background:
The recent emergence of protocols like Ordinals and Runes demonstrates the market's enthusiasm for innovation on the Bitcoin blockchain. While many Bitcoin Layer 2 solutions have already launched, few have achieved widespread adoption, leading to questions about whether following Ethereum's path is suitable for Bitcoin. These developments have highlighted a critical gap: the need for effective liquidity solutions within the decentralized Bitcoin ecosystem.
1.2 Project vision and mission:
At TerpLayer, our vision is clear: Unleashing BTC Liquidity in the Decentralized World with Berachain.TerpLayer pioneers BTC liquidity on Berachain, leveraging PoL for maximum capital efficiency. We aim to be the largest BTC liquidity provider, driving seamless trading and unlocking Bitcoin-native DeFi.
1.3 Our Goals and Approach
To achieve this, TerpLayer is developing several key solutions: Stablecoins: Introducing stable,coins native to the Bitcoin chain, providing a stable medium for decentralized transactions,TerpLayer has issued the first stablecoin TPUSD based on the Runes protocol on the Bitcoin network. BTCSwap: Creating a decentralized Bitcoin trading platform with a decentralized pricing mechanism, reducing reliance on centralized exchanges. Liquidity Mining: Offering Bitcoin holders the ability to earn rewards through liquidity mining by providing liquidity to our decentralized pools. These initiatives are designed to solve one of the core challenges in the current decentralized ecosystem — unlocking liquidity while maintaining the security and decentralization that Bitcoin represents.
2. Technical architecture

How does TerpLayer achieve decentralized Bitcoin AMM trading? TerpLayer will not let BTC leave the user's wallet. We complete the transaction between BTC and TPUSD on the Bitcoin network, which is implemented based on the latest PSBT (Partially Signed Bitcoin Transaction) technology of Bitcoin. In a Bitcoin transaction, the delivery of BTC and TPUSD is achieved by interchanging UTXO (Unspent Transaction Output) between input and output. Each Bitcoin transaction will be synchronized to the AMM Oracle contract deployed on Berachain through TerpLayer's state channel. The AMM Oracle provides us with the trading price of BTC. At the same time, transactions that occur on TerpLayer will also affect the price of the AMM. To ensure the accuracy of prices in the AMM, we use a multi-party quotation method to determine the Bitcoin transaction price: 30% of the price weight comes from Chainlink, 30% from Pyth, 30% from our liquidity pool,e. The reason for introducing Curve is that considering that USDT has been decoupled from the US dollar in history. By monitoring the exchange rate between USDT and other stablecoins, our AMM Oracle can timely judge risks and send out early warning signals to ensure that liquidity providers (LPs) do not suffer losses. How can transactions between BTC and USDT be implemented on the Bitcoin mainnet? TerpLayer has issued the first stablecoin TPUSD based on the Runes protocol on the Bitcoin network. The issuance and redemption mechanism of TPUSD is implemented based on the TAS (improved cross-chain atomic swap) protocol standard. Through transaction association, it is ensured that transactions on the Bitcoin chain and EVM contract transactions either succeed simultaneously or fail simultaneously. We provide a decentralized trading gateway that allows users to exchange TPUSD at any time. So the UTXO related to BTC and TPUSD for transactions occurring on the Bitcoin mainnet. From an architectural perspective, TerpLayer's BTCSwap can be understood as follows: the actual transaction of BTC occurs on the Bitcoin mainnet, while the price formation and liquidity calculation of Bitcoin are carried out on Berachain. When users conduct transactions on BTCSwap, their behaviors will be submitted to smart contracts, and the contracts will issue additional TERP tokens to reward users according to these transaction behaviors. TerpLayer will become Berachain's asset delivery protocol on the Bitcoin chain. From the perspective of financial products, any wrapped token, such as WBTC, FBTC, etc., can be regarded as a future option of Bitcoin. Users who use these wrapped tokens conduct the delivery of ERC20 and BTC through third-party institutions. This delivery method is usually called a cross-chain bridge. In the future, institutions can issue BTC options and choose to use the trading route of BTCSwap for physical BTC delivery. For example, TerpLayer will cooperate with IVX, the expiration date option protocol on Berachain in the future. The product form of IVX is 24-hour option delivery. Suppose you buy a BTC option at a price of $60,000 at 0 o'clock. By 24 o'clock, the BTC price has risen to $65,000. At this time, users can choose to obtain a $5,000 profit or use the trading route of BTCSwap to deliver physical BTC. BTC and the DEX project on Berachain - TerpLayer. Extending the atomic swap innovation of UTXO to multiple chains, it is a DEX on the native BTC chain and runs services through a decentralized node network. The AMM Oracle is placed on Berachain and participates in Berachain's flywheel model. It is currently very popular on Berachain and has established cooperation with top validators and the Bera project team. There is a project on Berachain that focuses on BTC DeFi. Through a node network and cross-chain atomic swap technology, it introduces real BTC trading business into the Berachain ecosystem. This project mainly focuses on BTC trading business, and the market demand is clear. Through a carefully designed economic model, the project has achieved collaborative development with Berachain. At present, it has established a close cooperation relationship with top validators.
3. Function module
3.1 module:
Trade: Exchange of tBTC and TPUSD Pool: Add/remove liquidity of tBTC and TPUSD Node: Node data display
3.2 User interface and interaction:
3.2.1 Connect wallet
Currently supported networks:Bitcoin Testnet Currently supported wallets:Unisat After clicking the connect wallet button in the upper right corner or on the operation area panel, select "Unisat" on the pop-up window, and then confirm in the wallet.
3.2.2 Trade
Exchange of tBTC and TPUSD. Take selling tBTC and buying TPUSD as an example:

Enter the quantity of tBTC to be sold in the selling area. The buying area will calculate the estimated quantity of TPUSD that can be bought according to the current trading price. Click on "gas fee" to view transaction data. Hovering the mouse can show specific explanations. Slippage: 0.5% / Fee: 0.3%. Click "Standard" to select the handling fee. There are three different standards available for selection: slow, standard (default), and fast. You can also customize the handling fee. Tips:A too low handling fee will lead to a long transaction processing time or transaction failure! After completing all configurations, click the "Swap" button. After confirming that the pop-up information is correct, click the "Swap" button again, and then confirm in the wallet. Tips:Please confirm within 10 seconds, otherwise the transaction will fail! After confirmation, wait for the platform to process. After the platform processing is completed, you can click on the pop-up window to go to the block explorer to view the on-chain processing result, or view the current transaction status in the wallet. After the on-chain processing is completed, this swap transaction is completely ended.
3.3 Pool
3.3.1 Add liquidity

Click the "Add to liquidity" button to enter the liquidity addition page. Enter the quantity of tokens to be added in tBTC or TPUSD. The other token area will calculate the estimated corresponding token quantity according to the current price. Click the "Preview" button. After confirming that the pop-up information is correct, click the "Add" button After confirming in the wallet, wait for the transaction to be submitted. After the submission is successful, you can go to the blockchain explorer to view the on-chain processing result or view the transaction status in the wallet.
3.3.2 View liquidity pool data
After the on-chain processing is completed, you can see the historically added liquidity data on the Pool page.
3.3.3 Redeem liquidity
If you need to redeem the liquidity added in history, click the "Remove" button to enter the liquidity removal page. You can choose partial redemption or full redemption. When redeeming, the associated earnings will be taken back together. Click the "Remove" button and after confirming that the pop-up information is correct, click the "Remove" button again. After confirming in the wallet, wait for the transaction to be submitted. After the submission is successful, wait for on-chain processing, or view the transaction status in the wallet.
3.4. Node

Node data display. Currently, the node is located in Los Angeles. The node name is TerpLayer. Click the node to enter the details page to view detailed node data.
3.4.1 Project Team and Partners
Founded in 2022, TerpLayer has always been seeking the innovations in the BTC ecosystem. Since 2023, TerpLayer has developed a numerous of tools and services in BTC like the Runes Oracles, Launchpads and the Atomic Swap technologies, in 2024, Terplayer has developed the Bitcoin Decentralized Liquidity Protocol and aims to be the largest liquidity provider protocol in the BTC ecosystem, providing infrastructure for numerous DeFi projects. TerpLayer is at the forefront of innovation in the Bitcoin ecosystem. Since our inception in 2022, we have developed a suite of cutting-edge tools and services including Runes Oracles, Launchpads, and Atomic Swap technologies. Our flagship project, the Bitcoin Decentralized Liquidity Protocol, launched in 2024, positions us to become the premier liquidity provider in the BTC ecosystem. By offering robust infrastructure for various DeFi projects, we're not just participating in the Bitcoin revolution - we're actively shaping its future. Our mission is to enhance Bitcoin's utility and accessibility, bridging the gap between traditional finance and the decentralized world. Through our innovative solutions, we aim to unlock new possibilities for Bitcoin, enabling a more inclusive and efficient financial ecosystem.
3.4.2 Why We Chose Berachain Shared Goals:
One of the primary reasons we chose to partner with Berachain is our shared focus on liquidity and decentralization. Liquidity Incentives: Berachain has made liquidity incentives a central focus of their ecosystem, which aligns perfectly with TerpLayer's mission. By driving liquidity incentives within decentralized finance, we believe this partnership will significantly enhance liquidity in the Bitcoin ecosystem. Decentralization: Both Berachain and TerpLayer are committed to maintaining a decentralized infrastructure, ensuring that control remains in the hands of users rather than centralized entities. Expanding DeFi Beyond Ethereum: Berachain aims to bring new types of protocols and assets into their ecosystem, and TerpLayer is uniquely positioned to support this goal. While Berachain has already attracted a strong DeFi presence from Ethereum, TerpLayer will introduce decentralized Bitcoin trading into Berachain’s ecosystem, providing a bridge between the two leading blockchains. This collaboration will help Berachain diversify and expand its DeFi landscape while enabling TerpLayer to leverage Berachain’s liquidity-focused ecosystem.
Last updated