♒
Aquarius Guide
  • 👋Welcome to Aquarius
  • Developers
    • Integrating with Aquarius
    • Aquarius Soroban Functions
    • Code Examples
      • Prerequisites & Basics
      • Executing Swaps Through Optimal Path
      • Executing Swaps Through Specific Pool
      • Deposit Liquidity
      • Withdraw Liquidity
      • Get Pools Info
      • Claim LP Rewards
      • Add Fees To Swap
        • Deploying a New Fee Collector
        • Executing Swaps with Provider Fees
        • Claiming & Swapping Accumulated Fees
  • Ecosystem Overview
    • 🌐What is Stellar?
      • What are Lumens (XLM)?
      • What are Anchors?
      • What are Trustlines?
      • How much are network fees on Stellar?
      • What are network reserves?
      • Where to trade Stellar assets?
    • 🧮What is Soroban?
  • AQUA tokens
    • ♒What are AQUA tokens?
      • AQUAnomics
      • AQUA Wallets
      • Where can I buy AQUA?
  • ICE
    • 🧊ICE tokens: locking AQUA and getting benefits
    • ICE boosts - how to maximize LP rewards
  • Aquarius AMMs
    • 💱What are Aquarius AMMs?
      • Pools
        • Creating a Pool
        • Deposit & Withdraw Liquidity
      • Swap
      • System limitations
        • Aquarius AMM: Limitations in Support for Fee-on-Transfer, Rebasing, and Deflationary Tokens
        • Aquarius AMM: Token Address Migration Limitations and Mitigation Strategy
  • My Aquarius
    • 👤My Aquarius
      • Main Overview
      • Balances
      • My Liquidity
      • SDEX Rewards
      • Liquidity Votes
      • Governance Votes
      • Airdrop #2
      • ICE Locks
      • Payments History
  • Aquarius AQUA Rewards
    • 🗳️Aquarius voting
      • Aquarius voting: asset Flag Restrictions
    • 🪙SDEX Rewards
    • 🤖Aquarius AMM Rewards
  • Bribes
    • 🎁What are bribes?
      • What are the advantages of protocol level bribes?
  • Aquarius Governance
    • 🧑‍⚖️Aquarius Governance: Community-Led Decision Making
  • Airdrops
    • 1️⃣The Initial Airdrop
      • Am I Eligible For the Initial Airdrop?
      • How can I see if I am eligible?
      • What are Claimable Balances?
      • How is the Initial airdrop distributed?
      • Where can I find more information?
    • 🌠Airdrop #2
      • How could I have been eligible for Airdrop #2?
      • How can I see if I am eligible?
      • When was the Airdrop #2 snapshot?
      • Were there any CEX's taking part?
      • How big was Airdrop #2?
      • How will the airdrop be distributed and for how long?
      • Could I have increased my potential reward?
      • Where can I find more information?
  • Signers Guild
    • 📜What is the signers guild?
      • What percentage of the AQUA supply will be controlled by the Signers Guild?
      • Who will be in the Signers Guild?
      • How does the Signing process work?
      • What will be expected from a guild member?
      • How can I sign up for this position?
      • What are wallets that Guild members will manage?
      • How can I learn more about this?
  • Guides
    • ❔How to use AQUA Locker tool and get ICE tokens
    • ❔How to vote for markets on Aquarius
    • How to create bribes
    • ❔How to use Aquarius Governance
      • How to make a governance vote
      • How to create a proposal
    • ❔How to earn SDEX rewards
    • ❔How to earn AMM rewards
  • Technical Documents
    • 📜Audits
    • 🪲Bug Bounties
    • 🛄Claimable Balances
    • 🗳️The Aquarius Voting Mechanism
    • 🎁SDEX v2 proposal & algorithm
    • ⏩ICE Boost Formula
  • Useful Links
    • Aquarius Home
    • Liquidity Voting
    • Liquidity Rewards
    • Aquarius Bribes
    • ICE locker
    • Aquarius Governance
    • Airdrop #2
Powered by GitBook
On this page
  1. Aquarius AMMs
  2. What are Aquarius AMMs?
  3. System limitations

Aquarius AMM: Token Address Migration Limitations and Mitigation Strategy

1. Introduction

In decentralized finance (DeFi) platforms, token contracts occasionally undergo migrations to new addresses due to upgrades, bug fixes, or protocol changes. While these migrations are essential for improving security and functionality, they present challenges for Automated Market Makers (AMMs) like Aquarius.

Aquarius liquidity pools are initialized with fixed token addresses, meaning they cannot automatically adapt when a token’s contract migrates. This document outlines the limitations of Aquarius AMM regarding token address migrations and provides a mitigation strategy for handling such cases.


2. System Limitations: Token Address Migration

2.1 Fixed Token Addresses in Liquidity Pools

When an Aquarius liquidity pool is created, the token addresses involved are hardcoded into the pool’s structure. The pool's unique address is derived from a hash of these token addresses, ensuring efficient tracking and liquidity management. However, this also means:

  • Token addresses cannot be changed once a pool is created.

  • If a token undergoes a migration to a new contract address, the pool cannot automatically recognize or switch to the new token.

2.2 Risks to Liquidity Providers (LPs)

Token migrations pose several risks to liquidity providers:

  • Locked Liquidity: Liquidity associated with a migrated token may become inaccessible, as the token is no longer recognized within the ecosystem.

  • Depreciation of Value: While withdrawals may still be possible, the old token may lose value or utility.

  • Potential Financial Loss: LPs who do not react promptly to a migration may suffer losses if their deposited tokens become obsolete.

2.3 Impact on Users

  • Liquidity Disruptions: LPs must manually withdraw and redeploy liquidity into a new pool with the updated token address.

  • Trading Interruptions: Pools with migrated tokens may experience reduced liquidity and trading disruptions as funds are withdrawn.


3. Mitigation Strategy: Handling Token Migrations

Since Aquarius AMM does not support automatic token address migration, the following mitigation strategies can help LPs minimize risks and ensure smooth transitions when token migrations occur.

3.1 Communication and Alerts for Token Migrations

To mitigate risks, Aquarius will provide timely notifications when a token migration is detected or announced. This includes:

  • Alerts and Notifications: LPs will receive UI prompts, email updates, or social media announcements regarding pending or completed migrations.

  • Warnings on Pool Creation: If a token is known to have frequent upgrades or planned migrations, users may receive a warning before creating or adding liquidity to a pool.

3.2 Manual Withdrawal and Redeployment of Liquidity

If a token migration occurs:

  • Pool Pause Option: The pool admin can pause the affected pool, preventing further deposits or trades involving the obsolete token.

    • Example: The admin issues a command to pause the pool once a token migration is detected.

  • Liquidity Withdrawal: LPs must manually withdraw liquidity from the old pool. Withdrawals will remain functional even if the token is no longer in circulation.

    • Example: An LP who deposited Token A (old) and Token B can still withdraw them even after Token A migrates.

  • New Pool Creation: A new liquidity pool can be created using the updated token address. LPs can then redeposit their liquidity into the new pool.

    • Example: Once Token A migrates to Token A (new), a new Token A (new) + Token B pool can be established.

3.3 Migration Assistance via Smart Contracts

To simplify the migration process, Aquarius may introduce a migration contract that:

  • Automatically withdraws liquidity from the old pool.

  • Deposits the equivalent liquidity into the new pool with updated token addresses.

  • Issues new LP tokens for the redeposited liquidity.

Example Pseudo-code for Migration Contract:

rustCopyEditfn migrate_liquidity(user: Address, old_pool: Address, new_pool: Address) -> Result<(), Error> {
    // Step 1: Check user’s LP balance in old pool
    let lp_balance = old_pool.share_id().balance(user);
    
    // Step 2: Withdraw user's liquidity from old pool
    let withdrawn_tokens = old_pool.withdraw(user, lp_balance)?;
    
    // Step 3: Deposit liquidity into new pool with updated token addresses
    new_pool.deposit(user, withdrawn_tokens, lp_balance)?;
    
    Ok(())
}

This contract automates the migration process, reducing manual effort and ensuring a seamless transition for LPs.

3.4 Coordination with Token Issuers

To further improve the migration process, the Aquarius team will collaborate with token issuers to:

  • Plan migration events in advance.

  • Notify LPs early and provide step-by-step migration instructions.

  • Coordinate on migration strategies to minimize disruptions and losses.


4. Recommendations for Liquidity Providers (LPs)

4.1 Stay Informed About Token Migrations

To protect against losses, LPs should:

  • Monitor official communication channels for updates from the token issuer and Aquarius protocol team.

  • Be aware of tokens that are likely to migrate due to frequent upgrades or protocol changes.

4.2 Act Quickly During Token Migrations

  • Withdraw Liquidity Promptly: Once a migration is announced, LPs should immediately withdraw liquidity from the affected pool.

  • Redeploy Liquidity: LPs can redeposit their funds into new pools with the updated token address to continue earning rewards.

4.3 Assess Migration Risks Before Providing Liquidity

When adding liquidity to a pool, LPs should:

  • Evaluate the likelihood of token migrations.

  • Understand potential risks and necessary actions in case of migration.

  • Plan ahead for possible liquidity redeployment.


Conclusion

Token migrations are an inevitable part of DeFi, but their impact on AMMs like Aquarius can be minimized through proactive communication, manual migration strategies, and smart contract automation. By staying informed and acting promptly, LPs can safeguard their assets and maintain liquidity participation with minimal disruption. 🚀

PreviousAquarius AMM: Limitations in Support for Fee-on-Transfer, Rebasing, and Deflationary TokensNextMy Aquarius

Last updated 1 month ago

💱