Skip to main content

Liquidity Locking Guide

In the ever-evolving landscape of decentralized finance (DeFi), ElectroSwap stands out with its commitment to security and stability. One of the key features enabling this is our liquidity locking mechanism. This guide will walk you through the process of locking your liquidity provider (LP) tokens on ElectroSwap, ensuring liquidity providers contribute to a safer, more stable trading environment.

Understanding Liquidity Locking

Before diving into the process, let's understand what liquidity locking means. When you lock your LP tokens, you're committing your liquidity to a pool for a predetermined period. This act of locking helps prevent sudden liquidity withdrawals, contributing to the overall stability and trustworthiness of the platform.

Step-by-Step Guide to Locking Your LP Tokens

Step 1: Add Liquidity to a Pool

Before you can lock your LP tokens, you need to have LP tokens. You get those when you add liquidity to a pool by either creating a pool or adding liquidity to an existing pool.

  1. Go to the Add liquidity page and choose the pair you'd like to add liquidity for.
  2. For the sake of this guide, let's assume your adding liquidity for the BOLT/ETN pair
  3. You may need to Approve the ElectroSwap Router to access your BOLT, so it can add it to the liquidity pool. Confirm this transaction in your wallet.

Adding Liquidity

  1. Click "Supply", and confirm the transaction in your wallet.

Step 2: Approve the LP Locker to Access Your LP Tokens

Before you can lock your LP tokens, you need to grant the LP locking contract permission to access your tokens. This is done through the approve function of your LP token pair.

  1. Go to the Electroneum blockchain explorer and search for your wallet's address.
  2. Navigate to the 'Tokens' tab, and find the ElectroSwap LP token you would have received from Step 1.
  3. Click on the link for your LP token in the 'Contract Address' column

ElectroSwap LP

  1. On the 'Read Contract' tab of the ElectroSwap LP contract, find the balanceOf function, insert your wallet's address and click Query. The returned value is the number of LP tokens you have (not considering decimals). Copy the returned value, we're going to use it in the next step

ElectroSwap LP Read Contract

  1. On the 'Write Contract' tab of your ElectroSwap LP contract
    1. If you're not already connected, click on Connect Wallet button.
    2. Find the approve function. You'll need to enter the LP locking contract address 0x9F683983b99c73aD8B85a093F2312887cFAF5167 as the spender
    3. Assuming you want to lock all your LP tokens, paste the number you copied from the prior step in the value field.
    4. Click the Write button for the approve function.

ElectroSwap LP Write Contract

  1. Confirm the transaction in your wallet.

Step 3: Lock Your LP Tokens

Once the approve transaction has been confirmed, you can proceed to lock your LP tokens.

  1. Navigate to the ElectroSwapLocker Contract in the blockchain explorer.
  2. Access the lock function within the LP locking contract.
    1. In the _pairAddress field you will need to paste the address of your ElectroSwap LP pair from the previous steps.
    2. In the _duration field you will need specify how long you'd like to lock your ElectroSwap LP tokens in seconds (one day is 86400 seconds)
    3. In the _amountToLock field you will need enter the same number (or less) that you approved in the previous steps.
    4. In the _feeInETN field you will need specify eith true or false. If true, you will be charged 1000 ETN to create the lock, if false you will be charged 1000 BOLT (if paying in BOLT, make sure to approve the ElectroSwapLocker contract access to 1000 BOLT)
    5. In the value(ETN) field specify 1000 if paying in ETN, or 0 if paying in BOLT.
    6. Click the Write button

ElectroSwapLocker Write Contract

  1. Confirm the transaction in your wallet.

Important Considerations

  • Locking Duration: Choose your locking duration wisely, and make sure that you've entered the time in seconds. Once locked, you cannot access your LP tokens until the specified period has elapsed.
  • Liquidity Fees: Be aware of fees when executing these operations. There is a flatrate fee of 1000 ETN or 1000 BOLT for locking. There is also a 1% liquidity fee, which gets transferred to the ElectroSwap team wallet at the time the LP lock is created.
  • Security Practices: Always double-check contract addresses and transaction details before confirming to prevent any mistakes and/or malicious activity.

Conclusion

Locking your liquidity on ElectroSwap is a advanced process, but it significantly contributes to the ecosystem's health and security. By following these steps, you're not only protecting your investment but also supporting the stability of the platform, benefiting all users.

For further assistance or more detailed instructions, please contact an ElectroSwap admin via Telegram or Discord.

Note: This guide is intended for informational purposes only. Please conduct your own research and consult with a financial advisor before making any investment decisions.