Skip to content

TTSWAP

Next Generation Decentralized Exchange

No Intermediary • Low Slippage • No Impermanent Loss • Role-Based Commission • Low Gas

Constant Value Trading Protocol Introduction

Value before commodity exchange=Value after commodity exchange\text{Value before commodity exchange} = \text{Value after commodity exchange} \\

The reason for exchange is the mismatch between quantity and value, automatically matched through market mechanisms

🔹 Step 1: Definition Introduction

Let:

  • VaV_a: Current total value of Token A (unit: e.g., USD)
  • QaQ_a: Current total quantity of Token A
  • VbV_b, QbQ_b: Total value and quantity of Token B
  • ΔaΔa: Quantity of A that the user wants to invest
  • ΔVΔV: Value transferred in this exchange (from A to B)
  • ΔbΔb: Quantity of B exchanged from the pool based on value transfer

🔹 Step 2: Formula Under Equal Value Conditions

Δb=QbQa+ΔaΔaΔb = \frac{Q_b}{Q_a + Δa} \cdot Δa

Split commodity b according to the quantity of a, then exchange Δa portions


🔹 Step 3: Derivation of Exchange Formula Under Unequal Value Conditions

ΔV=VaQa+Δa2ΔaΔV = \frac{V_a}{Q_a + {{Δa}\over 2}} \cdot Δa \\

Δb=QbVb+ΔV2ΔVΔb = \frac{Q_b}{V_b + {{ΔV}\over 2}} \cdot ΔV \\


🔹 Step 4: Update Token A and B Values and Quantities After Trading

Token AToken B
ValueVaV_aVbV_b
QuantityQa+ΔaQ_a + ΔaQbΔbQ_b - Δb

🔹 Step 5: New Exchange Ratio After Trading

  • After trading completion, new marginal values:

Panew=VaQa+Δa,Pbnew=VbQbΔbP_a^{\text{new}} = \frac{V_a}{Q_a + Δa} \quad , \quad P_b^{\text{new}} = \frac{V_b}{Q_b - Δb}

  • New exchange ratio:

Rab=PanewPbnewR_{a \to b} = \frac{P_a^{\text{new}}}{P_b^{\text{new}}}

Contact Information

Twitter:@ttswapfinance
Telegram:@ttswapfinance
Email:bussiness@ttswap.io
Discord:ttswap
Github:ttswap
Website:ttswap.io

Welcome everyone to join our community

Power by TTSWAP