📖 TTSWAP Technical Whitepaper
TTSWAP is a decentralized token trading platform that enables users to swap tokens quickly and securely without relying on centralized exchanges.
1. Overview
TTSWAP (Token-Token Swap) is an Automated Market Maker (AMM) protocol built on EVM-compatible blockchains. The protocol executes automatically via smart contracts, eliminating the need for centralized institutions or individuals to match trades. Its core mechanism facilitates price discovery by automatically triggering market value transfers based on user trading behavior.
TTSWAP innovatively constructs a Constant Value-based Trading Protocol (Constant Value AMM). Compared to traditional AMMs, this protocol maintains mathematical model robustness while significantly reducing Gas fees by avoiding complex exponential operations.
This whitepaper will elaborate on the design logic of TTSWAP:
- Token Trading: Users can directly swap between any tokens, supporting native ETH trading without the need for WETH wrapping.
- Value Tokens & Normal Tokens: Distinguishes between mainstream value assets and long-tail assets to build a tiered liquidity market.
- Liquidity Management: Users can invest (provide liquidity) and divest at any time, with the system automatically handling fees and returns.
- Fee Generation & Distribution: A refined fee distribution mechanism incentivizes Liquidity Providers (LPs), promoters, community builders, and other roles.
- Fair Launch: The tokenomics model aims to protect the rights of all holders, ensuring long-term project development through a price-driven unlocking mechanism.
In summary, TTSWAP is dedicated to building an efficient, secure, and low-Gas decentralized trading and payment protocol, providing a concise, transparent, and efficient trading experience for DeFi and PayFi users.
2. Features
-
Constant Value AMM The core idea of the protocol is to ensure "Value Conservation" during the trading process. This model is mathematically compatible with the mainstream CPMM (Constant Product Market Maker, Uniswap) model and supports asymmetric weighted liquidity similar to Balancer, but avoids high Gas consumption through optimized algebraic algorithms.
-
Concentrated Liquidity & Direct Trading After users add token liquidity to the protocol, this liquidity can be shared with any other token within the protocol. Users can achieve direct token-to-token swaps, effectively avoiding liquidity fragmentation caused by multi-hop routing in traditional DEXs, significantly enhancing trading depth.
-
Liquidity Amplification The protocol dynamically configures liquidity amplification coefficients based on token stability characteristics. A unit of capital provided by users can generate multi-fold effective liquidity depth, significantly improving capital efficiency and yield levels (similar to Curve's amplification principle but extended to general tokens).
-
Low Slippage Trading Through liquidity amplification and concentrated liquidity design, TTSWAP significantly reduces trading slippage. Even large trades can achieve excellent price execution.
-
Impermanent Loss Protection The protocol protects Liquidity Providers (LPs) from Impermanent Loss (IL) at the architectural level through a specific value anchoring algorithm and a three-tiered defense mechanism, enabling LPs to better maintain their original asset value when withdrawing liquidity.
-
Extremely Low Gas Fees Benefiting from streamlined algebraic logic and bit-packing storage technology, contract execution is highly efficient. Compared to similar complex protocols, TTSWAP can save 50% to 90% of Gas fees, making on-chain trading more economical.
-
Refined Fee Distribution Fees are automatically distributed according to participant roles, covering Token Administrators (Creators), Token Investors (LPs), Portal Operators, Referrers, and Users. This builds a mutually beneficial ecosystem.
-
Native ETH Support The protocol natively supports ETH for direct trading and liquidity provision in its underlying architecture. Users do not need to manually wrap it into WETH, simplifying the interaction process and optimizing user experience.
-
Proof of Investment & Liquidity Mining When users provide liquidity, the protocol automatically generates a Proof of Investment. Users can use this proof for liquidity mining to earn additional TTS token rewards.
-
Price-Driven Tokenomics The TTS token adopts an innovative unlocking model: token unlocking is pegged to price performance (price doubling unlock mechanism), combined with a community profit buyback and burn mechanism, ensuring token circulation matches project value growth.
-
X402 Payment Protocol Support The protocol has built-in support for the X402 standard. This is a mechanism that separates the "Signer" from the "Payment Executor" (similar to Account Abstraction/PayFi), greatly expanding payment application scenarios and enhancing user payment experience.
3. Principles of the Constant Value Trading Model
3.1 Core Formulas
When a user swaps amount of Token A for Token B, the protocol follows a two-step calculation:
(For the detailed derivation of the Constant Value Model core formulas, see Appendix A)
Parameter Definitions:
| Symbol | Meaning | Remarks |
|---|---|---|
| Total Market Value of Token A in protocol | Represents the token's "weight" in the protocol | |
| Current Inventory Quantity of Token A | Includes accumulated fees | |
| Token A amount input by user | Net amount after fee deduction | |
| Total Market Value of Token B in protocol | ||
| Current Inventory Quantity of Token B | Includes accumulated fees | |
| Token B amount received by user | Gross amount before output fee |
Design Philosophy: The essence of exchange is the mismatch between quantity and value. The protocol automatically balances supply and demand through market means (price slippage).
3.2 Mathematical Properties and Comparisons
3.2.1 Relationship with Uniswap (CPMM)
When the configured values of two tokens are equal (), the above formulas are mathematically equivalent to Uniswap's Constant Product formula ().
Derivation Brief: In the case of , substituting into the formula yields:
(See Appendix B for the simplification process in the case of equal value)
This is exactly the output formula of the standard CPMM model, meaning TTSWAP possesses the same market depth and pricing characteristics as Uniswap when dealing with standard token pairs.
3.2.2 Relationship with Balancer (Weighted Pools)
When , the model exhibits the characteristics of a weighted pool.
- Balancer uses exponential operations to implement different weights, which is computationally complex and gas-intensive.
- TTSWAP uses the above algebraic formulas to simulate asymmetric liquidity pools without exponential operations. This allows TTSWAP to support customized liquidity management for stablecoins (high weight) or emerging tokens (low weight) at extremely low Gas costs.
(See Appendix C for the proof of equivalence with Balancer in unequal value cases)
3.3 State Update After Trading
After the transaction is completed, the token states are updated, forming a new exchange ratio:
| (Input Side) | (Output Side) | |
|---|---|---|
| Value (Weight) | (Unchanged) | (Unchanged) |
| Quantity | (Increases) |