Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Research]: Peg Stability Module (PSM) implementation #1103

Open
3 tasks
ra9mls opened this issue Jun 20, 2024 · 8 comments
Open
3 tasks

[Research]: Peg Stability Module (PSM) implementation #1103

ra9mls opened this issue Jun 20, 2024 · 8 comments
Assignees
Labels
kensetsu Task related to a project being built on SORA: Kensetsu spike Further information is requested or research is required tech Technical task

Comments

@ra9mls
Copy link

ra9mls commented Jun 20, 2024

Problem statement

Now we have a fees during the swap DAI <-> KUSD, we need to have 0 fees to swap DAI <-> KUSD.
Discuss what can help to peg KUSD to DAI.

Description

https://manual.makerdao.com/module-index/module-psm

Definition of Done

  • Research and determine the value it will bring to users
  • Raw modelling of the solution proposed and estimation of the Level of Effort
  • Once we have determined the business value and level of effort for this task we will prioritise it on our roadmap

Requirements

No response

@ra9mls ra9mls added tech Technical task kensetsu Task related to a project being built on SORA: Kensetsu labels Jun 20, 2024
@ra9mls ra9mls added this to the Kensetsu: Phase 2 milestone Jun 20, 2024
@Tieumsan Tieumsan added the spike Further information is requested or research is required label Jun 20, 2024
@ra9mls
Copy link
Author

ra9mls commented Jun 21, 2024

Phase 3?

@ra9mls
Copy link
Author

ra9mls commented Jun 28, 2024

  1. Create public vault (pool) for stability of protocol. DAI-KUSD with 0% fees and 100% LTV. User can exchange DAI<->KUSD for free.

@AndreyKortosov
Copy link

AndreyKortosov commented Jul 8, 2024

2. Bonding Curves Mechanism

Core Concept:

A bonding curve is a mathematical curve that defines the relationship between the price of a token and its supply. It is used to determine the price at which tokens can be bought or sold, ensuring that the token's price dynamically adjusts based on its demand.

How It Works:

  1. Bonding Curve Formula:
    • The bonding curve is defined by a mathematical formula, often a polynomial or exponential function, which dictates how the price changes as the supply increases or decreases.
    • For example, a simple bonding curve might be defined by P=k×S^n, where P is the price, S is the supply, k is a constant, and n is an exponent.
  2. Token Issuance (Buying):
    • When users want to buy the stablecoin, they pay a price determined by the current position on the bonding curve. The cost increases as more tokens are issued.
    • The funds paid by the user are added to a reserve pool that backs the stablecoin.
    • Example: If the current supply is low, the price per token might be low. As more tokens are bought and the supply increases, the price per token rises.
  3. Token Redemption (Selling):
    • When users want to sell the stablecoin, they are paid according to the price determined by the bonding curve at that time.
    • The tokens are burned (removed from circulation), and the equivalent value in reserve assets is returned to the user.
    • Example: If the supply is high, the price per token might be high. As tokens are sold and the supply decreases, the price per token falls.
  4. Price Stability:
    • The bonding curve mechanism inherently encourages price stability by making it more expensive to buy tokens when demand is high (thereby dampening demand) and cheaper when demand is low (thereby encouraging demand).
    • Arbitrage opportunities arise when the market price deviates from the bonding curve price, helping to bring the price back in line.

Key Characteristics:

  • Automatic Price Adjustment: The bonding curve ensures that the price of the stablecoin automatically adjusts based on supply and demand.
  • Liquidity Provision: The reserve pool ensures that there is always liquidity for buying and selling the stablecoin.
  • Transparency: The mathematical formula provides a transparent and predictable pricing mechanism.

Examples of Bonding Curves in Practice:

  • Reserve Protocol (RSV): Uses a bonding curve to issue and redeem RSV stablecoins.
  • Bancor (BNT): Early adopter of bonding curves for its liquidity pools.
  • Uniswap (UNI): While not a traditional bonding curve, Uniswap's automated market maker (AMM) model uses a similar concept of price adjustment based on liquidity and demand.

Advantages and Challenges:

Advantages:

  • Dynamic Pricing: Adjusts prices automatically based on supply and demand, helping to maintain the peg.
  • Predictable Mechanics: Users can predict how their actions will affect prices, providing transparency.
  • Liquidity Assurance: The reserve pool ensures that there is always liquidity for transactions.

Challenges:

  • Formula: Finding the right formula is a crucial point.
  • Complexity: Understanding and implementing bonding curves can be complex.
  • Initial Setup: Requires careful calibration of the bonding curve parameters to ensure desired price behavior.
  • Market Perception: Users must trust the mechanism and understand how their buying/selling actions impact the price.

Summary:

The bonding curve mechanism provides a dynamic and transparent way to manage the supply and demand of a stablecoin. Using a mathematical formula to determine the price based on the token supply ensures that the stablecoin's price adjusts automatically, encouraging price stability. While it offers significant advantages in terms of predictability and liquidity, it also comes with challenges related to complexity and market perception.

Notes:

The potential formula can be 𝑄^𝐷 (𝑃)=𝑄^𝑆 (𝑃) where Q - quantity of tokens, D - demand, S - supply, and P = Price equilibrium should be equal to 1 because P should be close to 1. (Source)

@AndreyKortosov
Copy link

3. Redemption Mechanism

Core Concept:

The redemption mechanism ensures that the value of the stablecoin remains stable and pegged to a target value (usually $1 for USD-pegged stablecoins) by allowing users to exchange stablecoins for an equivalent value of collateral assets. This creates a floor price for the stablecoin, as users can always redeem their stablecoins for the underlying assets.

How It Works:

  1. Collateralization:
    • The stablecoin is backed by a reserve of collateral assets, which can be fiat currencies, other stablecoins, or a basket of cryptocurrencies.
    • The value of the collateral is managed to always be at least equal to the value of the outstanding stablecoins, ensuring that each stablecoin can be redeemed for its target value.
  2. Redemption Process:
    • User Redeems Stablecoins: A user holding stablecoins can initiate a redemption by sending their stablecoins to a smart contract or the issuing entity.
    • Collateral Transfer: The smart contract or issuing entity transfers the equivalent value of collateral assets to the user, effectively removing the redeemed stablecoins from circulation (burning them).
    • Example: If a user holds 100 stablecoins pegged to $1 each, they can redeem these stablecoins for $100 worth of collateral assets.
  3. Price Stability:
    • Above Peg: If the stablecoin trades above its peg (e.g., $1.05), users are incentivized to mint new stablecoins by depositing collateral (if the system allows this) and sell them in the open market, pushing the price back down toward the peg.
    • Below Peg: If the stablecoin trades below its peg (e.g., $0.95), users are incentivized to buy the stablecoins from the market and redeem them for $1 worth of collateral, pushing the price back up toward the peg.

Key Characteristics:

  • Collateral-Backed: The stablecoin is fully or over-collateralized, meaning there is always enough reserve to cover redemptions.
  • Redeemable Value: Users can always redeem the stablecoin for a guaranteed value of collateral, creating a natural price floor.
  • Supply Adjustment: The redemption process adjusts the supply of the stablecoin in circulation, helping to stabilize the price.

Examples of Stablecoins Using Redemption Mechanisms:

  • Tether (USDT): Allows redemption of USDT for USD or other assets, ensuring that each USDT can be redeemed for $1 worth of collateral.
  • USDC (USD Coin): Users can redeem USDC for USD on a 1:1 basis, backed by reserves held in regulated financial institutions.
  • Paxos Standard (PAX): Pegged to USD and fully redeemable for USD, backed by a reserve of USD held in FDIC-insured banks.

Advantages and Challenges:

Advantages:

  • Price Stability: Creates a strong price floor, as users can always redeem stablecoins for a guaranteed value of collateral.
  • User Confidence: Enhances trust in the stablecoin, as users know they can redeem their holdings for the underlying assets.
  • Automatic Supply Adjustment: Helps to manage the supply of stablecoins in response to market demand.

Challenges:

  • Collateral Management: Requires effective management and auditing of collateral reserves to ensure they always cover the outstanding stablecoins.
  • Regulatory Compliance: Collateral assets, especially fiat currencies, need to be held in regulated institutions, which can introduce regulatory and compliance challenges.
  • Liquidity Requirements: The system needs to maintain sufficient liquidity to handle large-scale redemptions, especially during market stress.

Summary:

The redemption mechanism is a robust approach to maintaining the peg of a stablecoin by allowing users to redeem their stablecoins for a guaranteed amount of collateral. This mechanism ensures price stability by creating a floor price for the stablecoin, backed by a reserve of collateral assets. While it offers significant advantages in terms of price stability and user confidence, it also requires effective collateral management, regulatory compliance, and sufficient liquidity to handle redemptions.

@AndreyKortosov
Copy link

In my opinion:

  1. To start with the public vault DAI - KUSD
  2. If there is not enough liquidity, start to think about the Bonding Curves Mechanism.
  3. Redemption Mechanism we implemented in the current solution.

@MishoKanaria
Copy link

Implementing 0% trading fees is likely to disincentivize liquidity between stablecoins. Reducing the fees for all stable pools to 0.1% (eg. USDC<>KUSD, USDT<>KUSD, DAI<>KUSD) through governance would likely produce more favourable outcomes, as it maintains incentives for liquidity providers while allowing arbitrageurs to stabilize the stablecoins more effectively.

@AndreyKortosov
Copy link

We have 2 options for vault DAI - KUSD:

  1. Private vault DAI - KUSD for each user
  2. Public vault DAI - KUSD

Private vault

Each user will have the opportunity to lock their DAI and borrow KUSD through their account in Polkaswap, without any fees and stability fees.

Pros

  • The user has a motivation to lock their assets without any taxes.
  • The vault can live a long life.
  • The protocol has the chance to have a pool with high liquidity.

Cons

  • The user can lock and repay the vault only. The user can't swap DAI - KUSD 1:1.
  • The user doesn't have the motivation to use the current vault KUSD/DAI.

Public vault

The public vault will be available for every Polkaswap user, without any fees and stability fees. The major mechanic will be as XYK pool where the user has the opportunity to swap DAI to KUSD 1:1 or vice versa KUSD to DAI 1:1.

Pros

  • The user can swap DAI - KUSD 1:1 without any taxes.
  • The vault can live a long life.

Cons

  • The protocol has the chance to have a pool with low liquidity because most of the DAI will be swapped from the vault and the protocol will have a pool with a large number of KUSD, as a result, this negatively affects the price.

@AndreyKortosov
Copy link

The suggestion is to implement private vaults of DAI - KUSD.

Steps:

  1. Implement setting up borrow tax for each vault ([Tech]: Borrow tax for each vault #1129).
  2. Update taxes for the current vault DAI - KUSD and set up 0%. (Current user debt will remain and will not increase)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kensetsu Task related to a project being built on SORA: Kensetsu spike Further information is requested or research is required tech Technical task
Projects
None yet
Development

No branches or pull requests

5 participants