TPRO Documentation
  • TPRO Network Documentation
  • Abstract
  • Introduction
  • Managing Risks
  • Objectives and Design Considerations
  • Proposed Solutions
  • Economic Simulations
  • TPRO Public API
  • $TPRO Pool
Powered by GitBook
On this page
  • Liquidity Pool - Balancer
  • Dynamic Fee
  • Mechanism parameters
  • Mechanisms mathematical specification
  • Impermanent Loss Protection Mechanism
  • Mechanism parameters
  • Mechanisms mathematical specification
Edit on GitHub

$TPRO Pool

PreviousTPRO Public API

Last updated 4 months ago

Innovative Liquidity Pool with Impermanent Loss protection and Yield generation.

The TPRO Network has developed a innovative liquidity pool system designed to maximize support for all network participants. This innovative approach optimizes earnings for liquidity providers, reduces impermanent loss, and enhances the system’s resilience to market fluctuations.

The 80/20 Weighted Liquidity Pool, pioneered by Balancer, lowers entry barriers for liquidity providers, driving higher Total Value Locked (TVL) while minimizing impermanent loss. The Dynamic Fee Mechanism further boosts profitability by optimizing fees generated from the pool, and an Impermanent Loss Protection mechanism ensures additional security for liquidity providers, significantly enhancing the overall yield from investments.

All of the information presented is at the in progress stage, so the final technical implementation could change.

Liquidity Pool - Balancer

The TPRO Network team evaluated four different types of Balancer pools to optimize liquidity management and ensure economic efficiency. The pools under consideration were as follows:

  • Standard 50/50 Pool - A classic Balancer pool where liquidity is equally distributed between two assets, providing balanced exposure and straightforward liquidity provisioning.

  • 80/20 Weighted Pool - A pool with an asymmetric weight distribution, designed to minimize impermanent loss for a primary asset while still enabling efficient trading and liquidity. This structure is particularly suitable for projects aiming to support a dominant asset.

  • Multi-Asset Pool - A flexible pool that can support multiple tokens with custom weightings. It offers a diversified approach to liquidity management, allowing for broader asset exposure within a single pool.

  • Boosted Pool - An advanced pool that integrates with external yield protocols (e.g., Aave) to generate additional returns on idle liquidity while maintaining trading efficiency. This approach combines liquidity provisioning with yield optimization.

The TPRO Network team carefully evaluated four different types of Balancer pools to optimize liquidity management and ensure economic efficiency. After thorough analysis and simulations, we selected the 80/20 Weighted Pool as the optimal solution.

This pool offers a modern and secure approach to liquidity provisioning, addressing key challenges faced by liquidity providers:

  • Reduced Impermanent Loss: The asymmetric 80/20 weight distribution minimizes the impact of price volatility on the primary asset, ensuring a safer environment for liquidity providers.

  • Lower Entry Barrier: The reduced requirement for reserve contributions makes it easier for participants to become liquidity providers, increasing accessibility.

  • Increased Attractiveness: By offering enhanced security and efficiency, the 80/20 Weighted Pool provides a compelling alternative to traditional liquidity models.

Furthermore, the 80/20 Weighted Pool is designed to increase the Total Value Locked (TVL) within the liquidity pool, surpassing the current performance on Uniswap. This makes it an innovative and appealing choice for both the project and its community of liquidity providers.

The implementation of this pool underscores our commitment to fostering economic efficiency, accessibility, and safety in liquidity management.

Dynamic Fee

The dynamic fee mechanism in the liquidity pool aims to create a more efficient, fair and secure trading environment. Unlike static fee models, this mechanism adapts to changing market conditions, providing flexibility to the system.

The primary objectives of the dynamic fee mechanism include:

  • Fairness in Fee Structure: By calculating fees separately for buy and sell transactions, the mechanism addresses the distinct dynamics of each trade type. This ensures fees are proportional to the market impact of individual transactions.

  • Adaptability to Market Volatility: The system incorporates market volatility into its calculations, adjusting fees based on the volatility of Ethereum. During periods of heightened volatility, fees increase to mitigate risks, while in stable conditions, fees decrease to encourage trading activity.

  • Protection for Liquidity Providers: The dynamic fee mechanism shields all liquidity providers by increasing their income when impermanent loss rises due to volatility. Additionally, part of the collected fees funds a dedicated protection mechanism for providers who are most concerned about impermanent loss, further reducing their risk.

  • Support for Ecosystem Stability and Growth: By balancing the interests of traders and liquidity providers, the dynamic fee system fosters a sustainable ecosystem. Traders benefit from context-aware fees, while liquidity providers gain assurance of fair compensation and additional protection.

This dynamic approach ensures that the fee structure evolves with market conditions and participant behavior, creating a fair and adaptive framework. The hedging mechanism for impermanent loss, which complements the dynamic fee system, is discussed in detail in a separate section.

Mechanism parameters

The table below shows the key parameters of the dynamic fee mechanism. Table 1. Dynamic Fee Parameters

Parameter

Description

Value

min_fee_buy

Minimum fee on $TPRO token purchase transaction.

0.01 (1%)

max_fee_buy

Maximum fee at the transaction of purchase of $TPRO.

0.05 (5%)

min_fee_sell

Minimum fee at $TPRO sale transaction.

0.01 (1%)

max_fee_sell

Maximum fee at the $TPRO sale transaction.

0.1 (10%)

min_price_tolerance_buy

The percentage change in the $TPRO price that triggers the raising of the fee on purchase transactions.

0.2 (20%)

max_price_tolerance_buy

Percentage change in the price of the $TPRO token, beyond which the maximum fee on purchase transactions.

0.5 (50%)

eth_price_min_tolerance

Percentage change in the price of ETH that triggers the mechanism for raising fees on sales transactions.

0.07 (7%)

eth_price_max_tolerance

The percentage change in the price of ETH, after which the maximum sales transaction fee is charged.

0.15 (15%)

eth_component_weight

The weight of the component reflects the volatility of the ETH price throughout the fee for sale transactions.

0.5 (50%)

min_price_tolerance_sell

Percentage change in the price of the $TPRO that triggers fee raising on sales transactions.

0.01 (1%)

max_price_tolerance_sell

The percentage change in the price of the $TPRO, beyond which the maximum fee on sales transactions.

0.05 (5%)

protection_fee_rate

The portion of the fee that is charged on from the collected fee on protection mechanism.

0.2 (20%)

Based on the above parameters, the mathematical specification of the mechanism is defined.

Mechanisms mathematical specification

The mechanism for dynamic fee adjustment is divided into several components. The first component handles the fee for TPRO purchase transactions. Two key metrics are defined to support the mechanism, calculated using the following formulas:

price−buymin=avg−price−24hbefore⋅(1+min−price−tolerance−buy)price_-buy_{min} = avg_-price_-24h_{before} \cdot (1 + min_-price_-tolerance_-buy) price−​buymin​=avg−​price−​24hbefore​⋅(1+min−​price−​tolerance−​buy)
price−buymax=avg−price−24hbefore⋅(1+max−price−tolerance−buy)price_-buy_{max} = avg_-price_-24h_{before} \cdot (1 + max_-price_-tolerance_-buy)price−​buymax​=avg−​price−​24hbefore​⋅(1+max−​price−​tolerance−​buy)

Formula 1. Dynamic Price Thresholds for TPRO Purchase Transactions

where:

  • price−buyminprice_-buy_{min}price−​buymin​ is the TPRO price that triggers the raising of the fee on purchase transactions,

  • price−buymaxprice_-buy_{max}price−​buymax​ is the price of the TPRO, beyond which the maximum fee on purchase transactions,

  • avg−price−24hbeforeavg_-price_-24h_{before}avg−​price−​24hbefore​ is the average TPRO price over the last 24 hours preceding the update fee,

  • min−price−tolerance−buymin_-price_-tolerance_-buymin−​price−​tolerance−​buy is a parameter describing the percentage change in the TPRO price that triggers the raising of the fee on purchase transactions,

  • max−price−tolerance−buymax_-price_-tolerance_-buymax−​price−​tolerance−​buy is a parameter describing the percentage change in the price of the TPRO, beyond which the maximum fee on purchase transactions.

Based on these key metrics, the fee for TPRO purchase transactions is calculated as follows:

Feebuy={min−fee−buy,if pricecurrent≤price−buyminmax−fee−buy,if pricecurrent≥price−buymaxmin−fee−buy+max−fee−buy−min−fee−buyprice−buymax−price−buymin⋅(pricecurrent−price−buymin),otherwise.Fee_{buy} = \begin{cases} min_-fee_-buy, &\text{if } price_{current} \leq price_-buy_{min} \\ max_-fee_-buy, &\text{if } price_{current} \geq price_-buy_{max} \\ min_-fee_-buy + \frac{max_-fee_-buy - min_-fee_-buy}{price_-buy_{max} - price_-buy_{min}} \cdot (price_{current} - price_-buy_{min}), &\text{otherwise}. \end{cases}Feebuy​=⎩⎨⎧​min−​fee−​buy,max−​fee−​buy,min−​fee−​buy+price−​buymax​−price−​buymin​max−​fee−​buy−min−​fee−​buy​⋅(pricecurrent​−price−​buymin​),​if pricecurrent​≤price−​buymin​if pricecurrent​≥price−​buymax​otherwise.​

Formula 2. Dynamic Fee for TPRO Buying Transactions

where:

  • FeebuyFee_{buy}Feebuy​ is the fee applied to a TPRO buying transaction,

  • min−fee−buymin_-fee_-buymin−​fee−​buy is a parameter describing the minimum fee applied to TPRO buying transactions,

  • max−fee−buymax_-fee_-buymax−​fee−​buy is a parameter describing the maximum fee applied to TPRO buying transactions,

  • pricecurrentprice_{current}pricecurrent​ is the current price of the TPRO,

  • price−buyminprice_-buy_{min}price−​buymin​ is the TPRO price that triggers the raising of the fee on purchase transactions,

  • price−buymaxprice_-buy_{max}price−​buymax​ is the price of the TPRO, beyond which the maximum fee on purchase transactions.

The chart below illustrates an example of how the fee value varies with the TPRO price.

Figure 1. Buy transaction fee.

In the case of the fee for TPRO sales, the mechanism is more elaborate. Its first component works on a similar basis. Based on the parameters and the average price of the previous day, the following metrics are determined:

price−sellmin=avg−price−24hbefore⋅(1−min−price−tolerance−sell)price_-sell_{min} = avg_-price_-24h_{before} \cdot (1 - min_-price_-tolerance_-sell)price−​sellmin​=avg−​price−​24hbefore​⋅(1−min−​price−​tolerance−​sell)
price−sellmax=avg−price−24hbefore⋅(1−max−price−tolerance−sell)price_-sell_{max} = avg_-price_-24h_{before} \cdot (1 - max_-price_-tolerance_-sell)price−​sellmax​=avg−​price−​24hbefore​⋅(1−max−​price−​tolerance−​sell)

Formula 3. Dynamic Price Thresholds for TPRO Sale Transactions

where:

  • price−sellminprice_-sell_{min}price−​sellmin​ is the TPRO price that triggers the raising of the fee on sale transactions,

  • price−sellmaxprice_-sell_{max}price−​sellmax​ is the price of the TPRO, beyond which the maximum fee on purchase transactions,

  • avg−price−24hbeforeavg_-price_-24h_{before}avg−​price−​24hbefore​ is the average TPRO price over the last 24 hours preceding the update fee,

  • min−price−tolerance−sellmin_-price_-tolerance_-sellmin−​price−​tolerance−​sell is a parameter describing percentage change in the price of the TPRO that triggers fee raising on sales transactions,

  • max−price−tolerance−sellmax_-price_-tolerance_-sellmax−​price−​tolerance−​sell is a parameter describing the percentage change in the price of the TPRO, below which the maximum fee on sales transactions.

These key metrics are used to determine the first component of fee.

Feesellprice={min−fee−sell,if pricecurrent≥price−sellminmax−fee−sell,if pricecurrent≤price−sellmaxmin−fee−sell+max−fee−sell−min−fee−sellprice−sellmax−price−sellmin⋅(pricecurrent−price−sellmin),otherwise.Fee_{sell}^{price} = \begin{cases} min_-fee_-sell, & \text{if } price_{current} \geq price_-sell_{min} \\ max_-fee_-sell, & \text{if } price_{current} \leq price_-sell_{max} \\ min_-fee_-sell + \frac{max_-fee_-sell - min_-fee_-sell}{price_-sell_{max} - price_-sell_{min}} \cdot (price_{current} - price_-sell_{min}), & \text{otherwise.} \end{cases}Feesellprice​=⎩⎨⎧​min−​fee−​sell,max−​fee−​sell,min−​fee−​sell+price−​sellmax​−price−​sellmin​max−​fee−​sell−min−​fee−​sell​⋅(pricecurrent​−price−​sellmin​),​if pricecurrent​≥price−​sellmin​if pricecurrent​≤price−​sellmax​otherwise.​

Formula 4. Dynamic Fee for TPRO Sale Transactions Based on $TPRO Price

where:

  • FeesellpriceFee_{sell}^{price}Feesellprice​ is the fee component for TPRO selling transactions based on price,

  • min−fee−sellmin_-fee_-sellmin−​fee−​sell is a parameter describing the minimum fee applied to TPRO selling transactions,

  • max−fee−sellmax_-fee_-sellmax−​fee−​sell is a parameter describing the maximum fee applied to TPRO selling transactions,

  • pricecurrentprice_{current}pricecurrent​ is the current price of the TPRO,

  • price−sellminprice_-sell_{min}price−​sellmin​ is the TPRO price that triggers the raising of the fee on sale transactions,

  • price−sellmaxprice_-sell_{max}price−​sellmax​ is the price of the TPRO, beyond which the maximum fee on purchase transactions.

Figure 2. Sale transactions fee (price component)

The second component of the fee for selling TPRO is influenced by fluctuations in the ETH price over the past 7 days. To account for this, the fee is calculated based on these price changes as follows:

eth−price−adjusted−fee=eth_-price_-adjusted_-fee = eth−​price−​adjusted−​fee=
(average−eth−price−24haverage−eth−price−7d−1−eth−price−max−tolerance)⋅max−fee−sell−min−fee−selleth−price−max−tolerance−eth−price−min−tolerance+max−fee−sell\left( \frac{average_-eth_-price_-24h}{average_-eth_-price_-7d} - 1 - eth_-price_-max_-tolerance \right) \cdot \frac{max_-fee_-sell - min_-fee_-sell}{eth_-price_-max_-tolerance - eth_-price_-min_-tolerance} + max_-fee_-sell(average−​eth−​price−​7daverage−​eth−​price−​24h​−1−eth−​price−​max−​tolerance)⋅eth−​price−​max−​tolerance−eth−​price−​min−​tolerancemax−​fee−​sell−min−​fee−​sell​+max−​fee−​sell

Formula 5. Fee Adjustment Based on ETH Price

where:

  • eth−price−adjusted−feeeth_-price_-adjusted_-feeeth−​price−​adjusted−​fee is the fee adjusted for TPRO selling transactions based on changes in ETH price,

  • average−eth−price−24haverage_-eth_-price_-24haverage−​eth−​price−​24h is the average ETH price over the last 24 hours,

  • average−eth−price−7daverage_-eth_-price_-7daverage−​eth−​price−​7d is the average ETH price over the last 7 days,

  • eth−price−max−toleranceeth_-price_-max_-toleranceeth−​price−​max−​tolerance is a parameter describing the maximum tolerance for changes in ETH price,

  • eth−price−min−toleranceeth_-price_-min_-toleranceeth−​price−​min−​tolerance is a parameter describing the minimum tolerance for changes in ETH price,

  • max−fee−sellmax_-fee_-sellmax−​fee−​sell is a parameter describing the maximum fee applied to TPRO selling transactions,

  • min−fee−sellmin_-fee_-sellmin−​fee−​sell is a parameter describing the minimum fee applied to TPRO selling transactions.

This component is subject to specific limitations, outlined in the formula below:

Feeselleth={min−fee−sell,if average−eth−price−24haverage−eth−price−7d−1≤eth−price−min−tolerance,max−fee−sell,if average−eth−price−24haverage−eth−price−7d−1≥eth−price−max−tolerance,eth−price−adjusted−fee,otherwise.Fee_{sell}^{eth} = \begin{cases} min_-fee_-sell, & \text{if } \frac{average_-eth_-price_-24h}{average_-eth_-price_-7d} - 1 \leq eth_-price_-min_-tolerance, \\ max_-fee_-sell, & \text{if } \frac{average_-eth_-price_-24h}{average_-eth_-price_-7d} - 1 \geq eth_-price_-max_-tolerance, \\ eth_-price_-adjusted_-fee, & \text{otherwise.} \end{cases}Feeselleth​=⎩⎨⎧​min−​fee−​sell,max−​fee−​sell,eth−​price−​adjusted−​fee,​if average−​eth−​price−​7daverage−​eth−​price−​24h​−1≤eth−​price−​min−​tolerance,if average−​eth−​price−​7daverage−​eth−​price−​24h​−1≥eth−​price−​max−​tolerance,otherwise.​

Formula 6. ETH Price Component of the Fee for TPRO Sale Transactions

where:

  • FeesellethFee_{sell}^{eth}Feeselleth​ is the ETH price component of the fee applied to TPRO selling transactions,

  • max−fee−sellmax_-fee_-sellmax−​fee−​sell is a parameter describing the maximum fee applied to TPRO selling transactions,

  • min−fee−sellmin_-fee_-sellmin−​fee−​sell is a parameter describing the minimum fee applied to TPRO selling transactions,

  • average−eth−price−24haverage_-eth_-price_-24haverage−​eth−​price−​24h is the average ETH price over the last 24 hours,

  • average−eth−price−7daverage_-eth_-price_-7daverage−​eth−​price−​7d is the average ETH price over the last 7 days,

  • eth−price−max−toleranceeth_-price_-max_-toleranceeth−​price−​max−​tolerance is a parameter describing the maximum tolerance for changes in ETH price,

  • eth−price−min−toleranceeth_-price_-min_-toleranceeth−​price−​min−​tolerance is a parameter describing the minimum tolerance for changes in ETH price,

  • eth−price−adjusted−feeeth_-price_-adjusted_-feeeth−​price−​adjusted−​fee is the fee adjusted for TPRO selling transactions based on changes in ETH price.

Figure 3. Sale transactions fee (ETH component)

Considering both components, the final fee for TPRO token sales is determined using the following formula:

Feesell=(1−eth−weight)⋅Feesellprice+eth−weight⋅FeesellethFee_{sell} = (1 - eth_-weight) \cdot Fee_{sell}^{price} + eth_-weight \cdot Fee_{sell}^{eth}Feesell​=(1−eth−​weight)⋅Feesellprice​+eth−​weight⋅Feeselleth​

Formula 7. Dynamic Fee for TPRO Sale Transactions

where:

  • FeesellFee_{sell}Feesell​ is the fee applied to TPRO selling transactions,

  • eth−component−weighteth_-component_-weighteth−​component−​weight is a parameter describing the weight of the ETH component throughout the fee for sale transactions,

  • FeesellpriceFee_{sell}^{price}Feesellprice​ is the fee component based on TPRO price changes,

  • FeesellethFee_{sell}^{eth}Feeselleth​ is the fee component based on ETH price changes.

A primary objective of the dynamic fee mechanism is to allocate fees toward the impermanent loss protection mechanism. At a given moment ttt, when a purchase transaction occurs, the collected fee is distributed as follows:

fee−protection−etht=protection−fee−rate⋅fee−collected−ethtfee_-protection_-eth_{t} = protection_-fee_-rate \cdot fee_-collected_-eth_{t}fee−​protection−​etht​=protection−​fee−​rate⋅fee−​collected−​etht​
fee−lp−etht=fee−collected−etht−fee−protection−ethtfee_-lp_-eth_{t} = fee_-collected_-eth_{t} - fee_-protection_-eth_{t}fee−​lp−​etht​=fee−​collected−​etht​−fee−​protection−​etht​

Formula 8. Fee Allocation for ETH pool in the Protection Mechanism

where:

  • fee−protection−ethtfee_-protection_-eth_{t}fee−​protection−​etht​ is the portion of ETH fees allocated to the protection mechanism pool at time ttt,

  • protection−fee−rateprotection_-fee_-rateprotection−​fee−​rate is a parameter describing the portion of the fee that is charged on from the collected fee on protection mechanism,

  • fee−collected−ethtfee_-collected_-eth_{t}fee−​collected−​etht​ is the total ETH fees collected at time ttt,

  • fee−lp−ethtfee_-lp_-eth_{t}fee−​lp−​etht​ is the portion of ETH fees allocated to liquidity providers at time ttt.

A similar mechanism occurs for sales transactions, where a TPRO fee is charged. This division is determined by the following formula:

fee−protection−tokent=protection−fee−rate⋅fee−collected−tokentfee_-protection_-token_{t} = protection_-fee_-rate \cdot fee_-collected_-token_{t}fee−​protection−​tokent​=protection−​fee−​rate⋅fee−​collected−​tokent​
fee−lp−tokent=fee−collected−tokent−fee−protection−tokentfee_-lp_-token_{t} = fee_-collected_-token_{t} - fee_-protection_-token_{t}fee−​lp−​tokent​=fee−​collected−​tokent​−fee−​protection−​tokent​

Formula 9. Fee Allocation for TPRO tokens pool in the Protection Mechanism

where:

  • fee−protection−tokentfee_-protection_-token_{t}fee−​protection−​tokent​ is the portion of TPRO fees allocated to the protection mechanism pool at time ttt,

  • protection−fee−rateprotection_-fee_-rateprotection−​fee−​rate is a parameter describing the portion of the fee that is charged on from the collected fee on protection mechanism,

  • fee−collected−tokentfee_-collected_-token_{t}fee−​collected−​tokent​ is the total TPRO fees collected at time ttt,

  • fee−lp−tokentfee_-lp_-token_{t}fee−​lp−​tokent​ is the portion of TPRO fees allocated to liquidity providers at time ttt.

Impermanent Loss Protection Mechanism

The protection mechanism is a key feature of the liquidity pool, offering additional safeguards against impermanent loss for liquidity providers.

Key aspects of the mechanism include:

  • Fee-Based Funding: A portion of the fees collected from the dynamic fee mechanism is allocated to the protection mechanism, ensuring consistent funding for collateral payouts.

  • Token-Based Participation: Liquidity providers can deposit additional TPRO tokens into the collateral pool. These deposits represent shares in the pool, and the provider’s participation is determined by the amount of TPRO deposited, regardless of the liquidity they initially contributed.

  • Flexible Withdrawal with Lock-In Period: Deposited TPRO tokens can be withdrawn at any time but are subject to a 14-day lock before they can be collected. Previously accumulated collateral remains intact even after TPRO tokens are withdrawn.

  • Coverage of Impermanent Loss: When liquidity is removed, the mechanism calculates impermanent loss as the difference between the value of the liquidity pool and a hold strategy. The collateral is used to offset all or part of the loss, compensating liquidity providers.

  • Management of Excess Collateral: If the collateral collected is greater than the calculated loss, the excess is redistributed. A portion of the excess is allocated as a success fee for the creators of the mechanism, while the remainder is returned to the collateral pool to benefit other participants in the program.

This protection mechanism minimizes exposure to impermanent loss while fostering a collaborative and incentivized environment for liquidity providers. Its efficient handling of surplus collateral and performance-based fee structure ensures alignment between creators and participants, promoting trust and long-term engagement.

Mechanism parameters

Table 2. Impermanent Loss Protection Mechanism Parameters

Parameter

Description

Value

success_fee

Part of the unrealized protection for the liquidity provider charged as remuneration on effective protection against impermanent loss.

0.1 (10%)

Based on the above parameters, the mathematical specification of the mechanism is defined.

Mechanisms mathematical specification

Fees collected by the liquidity pool for the protection mechanism are collected in separate pools of ETH and TPRO tokens. Each time a liquidity provider joins, leaves the protection program, or increases its deposit, the collected funds are redistributed to users to ensure a fair allocation of collateral. We define tit_iti​ as the moments when the distribution of pool shares changes due to user actions. Let ti−1t_{i-1}ti−1​ represent the previous moment of such a change, and t0t_0t0​ denote the initial moment of the pool's creation. The amount of collected assets is calculated using the following formulas:

protection−eth−poolti=∑t=ti−1tifee−protection−ethtprotection_-eth_-pool_{t_{i}} = \sum_{t = t_{i-1}}^{t_{i}} fee_-protection_-eth_{t}protection−​eth−​poolti​​=t=ti−1​∑ti​​fee−​protection−​etht​
protection−token−poolti=∑t=ti−1tifee−protection−tokentprotection_-token_-pool_{t_{i}} = \sum_{t = t_{i-1}}^{t_{i}} fee_-protection_-token_{t}protection−​token−​poolti​​=t=ti−1​∑ti​​fee−​protection−​tokent​

Formula 10. Accumulated Protection Fees in ETH and TPRO

where:

  • protection−eth−pooltprotection_-eth_-pool_{t}protection−​eth−​poolt​ is the accumulated ETH fees in the protection pool by time ttt,

  • protection−token−pooltprotection_-token_-pool_{t}protection−​token−​poolt​ is the accumulated TPRO fees in the protection pool by time ttt,

  • fee−protection−ethtfee_-protection_-eth_{t}fee−​protection−​etht​ is the ETH fee allocated to the protection mechanism pool at time ttt,

  • fee−protection−tokentfee_-protection_-token_{t}fee−​protection−​tokent​ is the TPRO fee allocated to the protection mechanism pool at time ttt.

Both TPRO and ETH are distributed following the same principles. Let lplplp describe a specific liquidity provider, the amount of ETH and TPRO reserved for liquidity provider lplplp, at time tit_{i}ti​ describes the formula:

protection−ethtilp=tokens−depositedlp∑k=1Ntokens−depositedk⋅protection−eth−pooltiprotection_-eth_{t_{i}}^{lp} = \frac{tokens_-deposited^{lp}}{\sum_{k=1}^{N} tokens_-deposited^{k}} \cdot protection_-eth_-pool_{t_{i}}protection−​ethti​lp​=∑k=1N​tokens−​depositedktokens−​depositedlp​⋅protection−​eth−​poolti​​
protection−tokentilp=tokens−depositedlp∑k=1Ntokens−depositedk⋅protection−token−pooltiprotection_-token_{t_{i}}^{lp} = \frac{tokens_-deposited^{lp}}{\sum_{k=1}^{N} tokens_-deposited^{k}} \cdot protection_-token_-pool_{t_{i}}protection−​tokenti​lp​=∑k=1N​tokens−​depositedktokens−​depositedlp​⋅protection−​token−​poolti​​

Formula 11. Allocation of Protection Pool to Liquidity Providers

where:

  • protection−ethtlpprotection_-eth_{t}^{lp}protection−​ethtlp​ is the portion of the ETH protection mechanism pool allocated to the liquidity provider lplplp at time tit_{i}ti​,

  • protection−tokentlpprotection_-token_{t}^{lp}protection−​tokentlp​ is the portion of the TPRO protection mechanism pool allocated to the liquidity provider lplplp at time tit_{i}ti​,

  • tokens−depositedlptokens_-deposited^{lp}tokens−​depositedlp is the number of TPRO deposited by the specific liquidity provider,

  • tokens−depositedktokens_-deposited^{k}tokens−​depositedk is the total number of TPRO deposited by liquidity provider kkk,

  • protection−eth−pooltprotection_-eth_-pool_{t}protection−​eth−​poolt​ is the total ETH in the protection pool by time tit_{i}ti​,

  • protection−token−pooltiprotection_-token_-pool_{t_{i}}protection−​token−​poolti​​ is the total TPRO in the protection pool by time tit_{i}ti​,

  • NNN is the total number of liquidity providers with some deposit in the protection mechanism.

As long as the liquidity provider remains active and the collateral is not utilized, these funds remain secured for the provider and continue to accumulate throughout the entire period their TPRO are locked in deposit.

The withdrawal of TPRO and ETH designated for liquidity providers within the protection mechanism occurs only when the user removes liquidity.

Initially, the portion of liquidity being withdrawn by the user is determined. To achieve this, a variable is calculated to represent the proportion of the user's total liquidity being withdrawn:

withdrawal−ratio=lp−tokens−withdrawnsum−lp−tokenswithdrawal_-ratio = \frac{lp_-tokens_-withdrawn}{sum_-lp_-tokens}withdrawal−​ratio=sum−​lp−​tokenslp−​tokens−​withdrawn​

Formula 12. Withdrawal Ratio for Liquidity Provider

where:

  • withdrawal−ratiowithdrawal_-ratiowithdrawal−​ratio is the proportion of liquidity withdrawn by the liquidity provider,

  • lp−tokens−withdrawnlp_-tokens_-withdrawnlp−​tokens−​withdrawn is the number of liquidity provider tokens withdrawn by the specific liquidity provider,

  • sum−lp−tokenssum_-lp_-tokenssum−​lp−​tokens is the total number of liquidity provider tokens in the pool.

A key step in calculating impermanent loss is estimating the hold position of a given liquidity provider. This involves tracking the assets contributed by the user to the liquidity pool at the time of adding liquidity. When liquidity is withdrawn, the hold position is adjusted by reducing it proportionally to the fraction of liquidity removed. This process is expressed mathematically as follows. Let tit_{i}ti​ denote the moment at which liquidity is added or withdrawn. By t0t_{0}t0​ is meant the first addition of liquidity by a liquidity provider, then:

hold−positionti={hold−positionti−1+eth−providedti+tokens−providedti⋅spot−pricetiif liquidity is added(1−withdrawal−ratio)⋅hold−positionti−1if liquidity is withdrawnhold_-position_{t_{i}} = \begin{cases} hold_-position_{t_{i-1}} + eth_-provided_{t_{i}} + tokens_-provided_{t_{i}} \cdot spot_-price_{t_{i}} & \text{if liquidity is added} \\ (1 - withdrawal_-ratio) \cdot hold_-position_{t_{i-1}} & \text{if liquidity is withdrawn} \end{cases}hold−​positionti​​={hold−​positionti−1​​+eth−​providedti​​+tokens−​providedti​​⋅spot−​priceti​​(1−withdrawal−​ratio)⋅hold−​positionti−1​​​if liquidity is addedif liquidity is withdrawn​

Formula 13. Liquidity Provider's Estimated Hold Position

where:

  • hold−positionthold_-position_{t}hold−​positiont​ is the total hold position value of the liquidity provider at time tit_{i}ti​, expressed in ETH,

  • eth−providedtieth_-provided_{t_{i}}eth−​providedti​​ is the amount of ETH provided by the liquidity provider at time tit_{i}ti​,

  • tokens−providedtitokens_-provided_{t_{i}}tokens−​providedti​​ is the amount of TPRO provided by the liquidity provider at time tit_{i}ti​,

  • spot−pricetispot_-price_{t_{i}}spot−​priceti​​ is the price of the TPRO at time tit_{i}ti​, expressed in ETH/TPRO,

  • withdrawal−ratiowithdrawal_-ratiowithdrawal−​ratio is the proportion of liquidity withdrawn by the liquidity provider.

Note: the hold_−positionhold\_-positionhold_−position is updated after the entire withdrawal mechanism is completed, as its value before the withdrawal is required to determine the amount of funds to be withdrawn by the user.

The next step is to calculate the liquidity provider's position, which takes into account the assets withdrawn from the pool and the fees charged. During the liquidity withdrawal process, the entire fee charged to the liquidity provider is allocated. In addition, the system tracks the total fees paid since the user last withdrew liquidity. The lp position is calculated as follows:

lp−position=(withdrawn−tokens+fee−collected−tokens)⋅spot−price+withdrawn−eth+fee−collected−ethlp_-position = (withdrawn_-tokens + fee_-collected_-tokens) \cdot spot_-price + withdrawn_-eth + fee_-collected_-ethlp−​position=(withdrawn−​tokens+fee−​collected−​tokens)⋅spot−​price+withdrawn−​eth+fee−​collected−​eth

Formula 14. Liquidity Provider's Position

where:

  • lp−positionlp_-positionlp−​position is the total value of the liquidity provider's position, expressed in ETH,

  • withdrawn−tokenswithdrawn_-tokenswithdrawn−​tokens is the number of TPRO withdrawn by the liquidity provider in current withdrawal,

  • fee−collected−tokensfee_-collected_-tokensfee−​collected−​tokens is the number of TPRO collected as fees by the liquidity provider since the last liquidity withdrawal,

  • spot−pricespot_-pricespot−​price is the current TPRO price, expressed in ETH/TPRO,

  • withdrawn−ethwithdrawn_-ethwithdrawn−​eth is the amount of ETH withdrawn by the liquidity provider in current withdrawal,

  • fee−collected−ethfee_-collected_-ethfee−​collected−​eth is the amount of ETH collected as fees by the liquidity provider since the last liquidity withdrawal.

Using the estimated hold position and the liquidity provider's position, the loss incurred from providing liquidity, as opposed to simply holding TPRO and ETH, is calculated. This calculation is expressed by the following formula:

loss=lp−position−hold−position⋅withdrawal−ratioloss = lp_-position - hold_-position \cdot withdrawal_-ratioloss=lp−​position−hold−​position⋅withdrawal−​ratio

Formula 15. Liquidity Provider's Loss

where:

  • losslossloss is the loss incurred by the liquidity provider compared to the hold strategy, expressed in ETH,

  • lp−positionlp_-positionlp−​position is the total value of the liquidity provider's position, expressed in ETH,

  • hold−positionhold_-positionhold−​position is the total hold position value of the liquidity provider, expressed in ETH,

  • withdrawal−ratiowithdrawal_-ratiowithdrawal−​ratio is the proportion of liquidity withdrawn by the liquidity provider.

Once the user's loss is determined, the process of collateral payout begins. This payout occurs only if the calculated loss is greater than zero. A negative loss value indicates that the liquidity provider has not experienced any loss relative to their hold position, and therefore, no compensation is issued. In order to disburse funds, the following metrics are defined:

full−value−protection=protection−eth+protection−token⋅spot−pricefull_-value_-protection = protection_-eth + protection_-token \cdot spot_-pricefull−​value−​protection=protection−​eth+protection−​token⋅spot−​price
value−protection=full−value−protection⋅withdrawal−ratiovalue_-protection = full_-value_-protection \cdot withdrawal_-ratiovalue−​protection=full−​value−​protection⋅withdrawal−​ratio

Formula 16. Value of Protection for Liquidity Provider

where:

  • full−value−protectionfull_-value_-protectionfull−​value−​protection is the total value of protection available for a liquidity provider, expressed in ETH,

  • protection−ethprotection_-ethprotection−​eth is the ETH allocated as protection,

  • protection−tokenprotection_-tokenprotection−​token is the TPRO allocated as protection,

  • spot−pricespot_-pricespot−​price is the price of the TPRO, expressed in ETH/TPRO,

  • value−protectionvalue_-protectionvalue−​protection is the final value of protection applied to the liquidity provider's withdrawn liquidity.

The liquidity provider receives both TPRO and ETH, with the amounts of each asset calculated using the following formula:

received−protection−eth={protection−ethif loss≥full−value−protection,withdrawal−ratio⋅protection−eth⋅lossvalue−protectionif loss≤value−protection,protection−eth⋅lossfull−value−protectionotherwise.received_-protection_-eth = \begin{cases} protection_-eth & \text{if } loss \geq full_-value_-protection, \\ withdrawal_-ratio \cdot protection_-eth \cdot \frac{loss}{value_-protection} & \text{if } loss \leq value_-protection, \\ protection_-eth \cdot \frac{loss}{full_-value_-protection} & \text{otherwise.} \end{cases}received−​protection−​eth=⎩⎨⎧​protection−​ethwithdrawal−​ratio⋅protection−​eth⋅value−​protectionloss​protection−​eth⋅full−​value−​protectionloss​​if loss≥full−​value−​protection,if loss≤value−​protection,otherwise.​
received−protection−token={protection−tokenif loss≥full−value−protection,withdrawal−ratio⋅protection−token⋅lossvalue−protectionif loss≤value−protection,protection−token⋅lossfull−value−protectionotherwise.received_-protection_-token = \begin{cases} protection_-token & \text{if } loss \geq full_-value_-protection, \\ withdrawal_-ratio \cdot protection_-token \cdot \frac{loss}{value_-protection} & \text{if } loss \leq value_-protection, \\ protection_-token \cdot \frac{loss}{full_-value_-protection} & \text{otherwise.} \end{cases}received−​protection−​token=⎩⎨⎧​protection−​tokenwithdrawal−​ratio⋅protection−​token⋅value−​protectionloss​protection−​token⋅full−​value−​protectionloss​​if loss≥full−​value−​protection,if loss≤value−​protection,otherwise.​

Formula 17. Received Protection for Liquidity Provider

where:

  • received−protection−ethreceived_-protection_-ethreceived−​protection−​eth is the amount of ETH received as protection by the liquidity provider,

  • received−protection−tokenreceived_-protection_-tokenreceived−​protection−​token is the amount of TPRO received as protection by the liquidity provider,

  • protection−ethprotection_-ethprotection−​eth is the ETH allocated to the liquidity provider for protection,

  • protection−tokenprotection_-tokenprotection−​token is the TPRO allocated to the liquidity provider for protection,

  • losslossloss is the loss incurred by the liquidity provider compared to the hold strategy, expressed in ETH,

  • full−value−protectionfull_-value_-protectionfull−​value−​protection is the total value of protection available for a liquidity provider, expressed in ETH,

  • value−protectionvalue_-protectionvalue−​protection is the value of part of protection applied based on the withdrawal ratio.

Since the mechanism aims to offset the loss relative to the hold position, the amount of TPRO and ETH received may exceed the loss incurred. In such cases, a surplus is calculated, which is then split into a fee for the creators and a contribution to the protection pool. The surplus for both TPRO and ETH is determined using the following formula:

protection−surplus−eth={withdrawal−ratio⋅protection−ethif loss≤0,withdrawal−ratio⋅protection−eth⋅1−lossvalue−protectionif loss≤value−protection,0otherwise.protection_-surplus_-eth = \begin{cases} withdrawal_-ratio \cdot protection_-eth & \text{if } loss \leq 0, \\ withdrawal_-ratio \cdot protection_-eth \cdot \frac{1 - loss}{value_-protection} & \text{if } loss \leq value_-protection, \\ 0 & \text{otherwise.} \end{cases}protection−​surplus−​eth=⎩⎨⎧​withdrawal−​ratio⋅protection−​ethwithdrawal−​ratio⋅protection−​eth⋅value−​protection1−loss​0​if loss≤0,if loss≤value−​protection,otherwise.​
protection−surplus−token={withdrawal−ratio⋅protection−tokenif loss≤0,withdrawal−ratio⋅protection−token⋅1−lossvalue−protectionif loss≤value−protection,0otherwise.protection_-surplus_-token = \begin{cases} withdrawal_-ratio \cdot protection_-token & \text{if } loss \leq 0, \\ withdrawal_-ratio \cdot protection_-token \cdot \frac{1 - loss}{value_-protection} & \text{if } loss \leq value_-protection, \\ 0 & \text{otherwise.} \end{cases}protection−​surplus−​token=⎩⎨⎧​withdrawal−​ratio⋅protection−​tokenwithdrawal−​ratio⋅protection−​token⋅value−​protection1−loss​0​if loss≤0,if loss≤value−​protection,otherwise.​

Formula 18. Protection Surplus

where:

  • protection−surplus−ethprotection_-surplus_-ethprotection−​surplus−​eth is the surplus ETH that remains after covering the loss,

  • protection−surplus−tokenprotection_-surplus_-tokenprotection−​surplus−​token is the surplus TPRO that remains after covering the loss,

  • protection−ethprotection_-ethprotection−​eth is the ETH allocated to the liquidity provider for protection,

  • protection−tokenprotection_-tokenprotection−​token is the TPRO allocated to the liquidity provider for protection,

  • losslossloss is the loss incurred relative to the hold position,

  • value−protectionvalue_-protectionvalue−​protection is the value of protection applied based on the withdrawal ratio,

  • full−value−protectionfull_-value_-protectionfull−​value−​protection is the total value of protection available for a liquidity provider, expressed in ETH,

  • withdrawal−ratiowithdrawal_-ratiowithdrawal−​ratio is the proportion of liquidity withdrawn by the liquidity provider.

Based on the surplus, a fee for the TPRO Network is calculated. The calculation is performed as follows:

success−fee−eth=protection−surplus−eth⋅success−feesuccess_-fee_-eth = protection_-surplus_-eth \cdot success_-feesuccess−​fee−​eth=protection−​surplus−​eth⋅success−​fee
success−fee−token=protection−surplus−token⋅success−feesuccess_-fee_-token = protection_-surplus_-token \cdot success_-feesuccess−​fee−​token=protection−​surplus−​token⋅success−​fee

Formula 19. Success Fee

where:

  • success−fee−ethsuccess_-fee_-ethsuccess−​fee−​eth is the success fee in ETH deducted from the protection surplus,

  • success−fee−tokensuccess_-fee_-tokensuccess−​fee−​token is the success fee in TPRO deducted from the protection surplus,

  • protection−surplus−ethprotection_-surplus_-ethprotection−​surplus−​eth is the surplus ETH that remains after covering the loss,

  • protection−surplus−tokenprotection_-surplus_-tokenprotection−​surplus−​token is the surplus TPRO that remains after covering the loss,

  • success−feesuccess_-feesuccess−​fee is the parameter describing the percentage of the protection surplus taken as a fee.

The remaining surplus is allocated to two pools within the protection mechanism and will be distributed among all liquidity providers in the future. Fee for protection pools from surplus is calculated as follows:

fee−protection−eth=protection−surplus−eth−success−fee−ethfee_-protection_-eth = protection_-surplus_-eth - success_-fee_-ethfee−​protection−​eth=protection−​surplus−​eth−success−​fee−​eth
fee−protection−token=protection−surplus−token−success−fee−tokenfee_-protection_-token = protection_-surplus_-token - success_-fee_-tokenfee−​protection−​token=protection−​surplus−​token−success−​fee−​token

Formula 20. Surplus Protection Fee

where:

  • fee−protection−ethfee_-protection_-ethfee−​protection−​eth is the ETH fee allocated to the protection mechanism pool,

  • fee−protection−tokenfee_-protection_-tokenfee−​protection−​token is the TPRO fee allocated to the protection mechanism pool,

  • protection−surplus−ethprotection_-surplus_-ethprotection−​surplus−​eth is the surplus ETH that remains after covering the loss,

  • protection−surplus−tokenprotection_-surplus_-tokenprotection−​surplus−​token is the surplus TPRO that remains after covering the loss,

  • success−fee−ethsuccess_-fee_-ethsuccess−​fee−​eth is the success fee in ETH deducted from the protection surplus,

  • success−fee−tokensuccess_-fee_-tokensuccess−​fee−​token is the success fee in TPRO deducted from the protection surplus.

From the funds allocated to the liquidity provider in the protection mechanism are deducted received−protection−eth,received−protection−token,protection−surplus−eth,protection−surplus−tokenreceived_-protection_-eth, received_-protection_-token, protection_-surplus_-eth, protection_-surplus_-tokenreceived−​protection−​eth,received−​protection−​token,protection−​surplus−​eth,protection−​surplus−​token.

LP graphic
fee_buy_price_component.png
fee_sell_price_component.png
eth_price_sell_component.png