Home/Blog/
Adding Default Exchange for ERC-20 Tokens (Liquidity Pool Management)

Adding Default Exchange for ERC-20 Tokens (Liquidity Pool Management)

December 14, 2024

12 min read

ERC-20 Default Exchange inscription on a background featuring the 20lab logo with blue graphic elements.

Why Your Token Needs a Default Exchange Connection

Decentralized exchanges (DEXes) have revolutionized token trading on all major blockchain networks. Whether you're launching a token on Ethereum, BNB Chain, Polygon or other compatible chains, integrating with DEXes isn't just about enabling trading - it's about laying the foundation for advanced token functionality. By establishing a default exchange connection, token projects can implement sophisticated features such as anti-bot mechanisms, trading controls and automated market maker (AMM) interactions.

When launching a new token, one of the most important decisions is choosing which DEX will serve as your token's primary trading venue. This choice affects not only where your token can be traded, but also how your smart contract interacts with the broader DeFi ecosystem. Primarily, the default exchange connection is used to enable features that require a main liquidity pool to function properly, ensuring that your token can take advantage of advanced trading mechanics and protections.

How Default Exchange Integration Works with 20lab

Using 20lab's token generator, you can select your preferred DEX from a list of available options specific to your chosen blockchain. During the token generation phase, after connecting your wallet, you'll see the supported DEXes for your network, allowing you to choose the one that best suits your project's needs. The most popular DEXes that are available on many blockchains are Uniswap, PancakeSwap or SushiSwap.

The default exchange connection will automatically configure your token's smart contract to recognize specific AMM contracts:

  1. Adds the selected DEX's RouterV2 contract to your token's AMM list.
  2. Creates an empty liquidity pool (PairV2) contract and also adds it to the AMM list by default.

This integration is critical because it enables your token to properly identify different types of transactions - distinguishing between buys, sells and regular transfers. These contracts are automatically excluded from limits and dividends (if applicable), ensuring the smooth operation of your token's advanced features, and cannot be removed from the AMM list, even by the token owner.

Most importantly, setting up a default exchange unlocks access to powerful token features within 20lab's token generator. For example, if you want to implement anti-bot measures, the default exchange connection allows your token to track buy and sell activity per address, enabling cooldown periods and other protections. This foundation is essential for implementing features such as EnableTrading functionality and managing internal DEX transfers between recognized AMM contracts.

How to Choose Default Exchange and Create ERC-20 Token

Creating a token with default exchange functionality is simple with 20lab's token generator. This easy-to-use ERC-20 token generator streamlines the process so that even those with minimal or no coding experience can launch their own tokens in minutes. Here's a quick guide to get you started:

Step 1: Choose Token Type and Connect Wallet

Choosing ERC-20, SPL or Sui token type on 20lab

Launch your token creation journey on 20lab's token generator, where your first decision awaits - selecting the blockchain ecosystem for your project. While 20lab supports multiple token standards including SPL (Solana) and Sui tokens, the default exchange functionality is specifically designed for ERC-20 tokens. Click on "Create ERC-20 Token" to access this powerful feature and begin building your token.

With your token type selected, connect your preferred Web3 wallet - whether it's MetaMask, Coinbase Wallet, or Trust Wallet. 20lab's broad wallet support ensures a seamless connection process.

Choose your deployment network carefully: select a testnet if you're experimenting, or a mainnet when you're ready for production. The platform supports various EVM-compatible networks, allowing you to launch your token exactly where your community needs it.

Wallet successfully connected to 20lab platform

Step 2: Add General Token Information

Your token's identity and economic parameters are the foundation of your project. Start with the basics:

  1. Choose a unique and memorable token name and symbol that reflects your project's identity.
  2. Determine your initial token supply based on your token economics and distribution strategy.
  3. Configure decimal places - the default setting of 18 decimal places matches major blockchain currencies and is recommended for most projects.

Adding token name, symbol, initial supply and decimals for your ERC-20 token

Next, configure your token management structure by setting up two essential wallet addresses:

  • Supply recipient: The wallet address that will receive and hold your initial supply of tokens.
  • Token owner: The wallet address that will have administrative control over the functions of your smart contract.

For better organization, you can customize your contract name - this will help identify your token on blockchain explorers after verification. Consider using a descriptive name that matches your project's branding.

Step 3: Enable and Select Default Exchange

Navigate to the "Optional" section of the token generator, where you'll find the "Default exchange" option at the top. This critical feature comes pre-enabled, as it serves as the foundation for many advanced token functionalities. Here you can select the primary DEX where your token's liquidity pool will be created.

Selecting default exchange for ERC-20 token

The default exchange connection provides access to many powerful token features:

If you enable this feature, additional options will appear in the generator panel. These advanced features rely on the default exchange connection to function properly, as they interact directly with the RouterV2 and PairV2 contracts of your chosen DEX. This integration allows your token to monitor and control trading activity while maintaining security and efficiency.

To demonstrate how the AMM list affects token functionality, we'll also enable the auto-burn tax feature from the "Taxes" section.

Enabling auto-burn tax for ERC-20 token

Step 4: Review and Deploy

Before deploying your token, take advantage of 20lab's comprehensive "Summary" page to review all configurations. This final checkpoint displays your token's parameters, features, and settings in one clear view, helping you catch any potential issues before they become permanent on the blockchain.

View on Summary page before validation

The deployment process involves two key steps:

  1. Click "Validate" to run a technical check of your token's configuration.
  2. Hit "Deploy" to create your token, then confirm the transaction in your Web3 wallet.

Note: The platform offers a token address pattern customization option during deployment - a unique feature that allows you to personalize your token's blockchain address for better brand recognition.

Confirmation of successful token creation on Sepolia testnet

Managing Your ERC-20 with Default Exchange

Once deployed, 20lab provides a comprehensive dashboard to monitor and manage your token. This interface gives you complete control over your token's operations and the features enabled during creation.

Dashboard panel for created ERC-20 token

Token Overview and Management

At the top, the dashboard displays key information about your token:

  • Contract address and verification status,
  • Total supply,
  • Token parameters (name, symbol, decimals),
  • Ownership controls and permissions in the "Ownable" section.

Default Exchange Section

The "Main Liquidity Pool" section of your dashboard provides essential information about your token's default exchange integration:

  • RouterV2 contract address,
  • PairV2 liquidity pool address,
  • Real-time liquidity pool balance tracking your token supply.

A core feature of your token is the AMM (Automated Market Maker) list management. This system lets you control which smart contracts your token recognizes as valid DEX interactions. While your primary liquidity pool is configured automatically during deployment, you can expand trading options by adding secondary pools through the "Manage AMM contracts" interface.

AMM list configuration modal

For example, if you start with a TokenX/ETH pair on Uniswap as your main trading location, you may later want to add a TokenX/USDT pool on SushiSwap. By adding this new pool contract to your AMM list, you ensure that your token recognizes transactions from all authorized liquidity pools, while maintaining security features such as trading limits and anti-bot protection across all pools.

Testing Your DEX Integration

To effectively test how the AMM list works, we will add liquidity to 2 liquidity pools: the main one and the secondary one. Remember that no matter how many liquidity pools you want to have, you must first add liquidity to your main pool before adding it to any other pool.

Redirection modal for adding liquidity to main pool

To add liquidity for your ERC-20 token, click the "Add Liquidity" button in your dashboard. This will redirect you to your chosen DEX's interface.

Adding liquidity to main pool on UniswapV2 on Sepolia testnet

After adding liquidity, your 20lab dashboard will automatically update to show the current token balance in the main pool.

LP balance updated in DEX section of dashboard

Next, we'll create a secondary pool using the TDT/TST pair. TST is my other test token without features like auto-burn tax, making it perfect for demonstrating the difference in behavior.

Creating secondary pool on UniswapV2 for TDT/TST

Once both pools are created, locate the secondary pool address in the "Holders" tab on the block explorer.

Finding address of secondary pool on block explorer

The secondary pool contains 1000 TDT tokens. Copy its address to add this pool to your token's AMM list.

Adding second pool to AMM list

Upon successful addition, the pool's status will change to "True (Recognized)".

To test the configuration, we'll use a different wallet with TST tokens to purchase TDT and examine the transaction in the block explorer.

Buy transaction result on block explorer

The transaction demonstrates that the 1% auto-burn tax applies to trades in the secondary pool, just as it does in the main pool. Without adding the secondary pool to the AMM list, buyers would be charged the 4% transfer tax rate instead of the correct 1% buy tax. Now, potential buyers cannot avoid paying the auto-burn tax, and it will be accurately calculated when they purchase TDT tokens from any of the existing pools.

Conclusion & FAQ

Setting up a default exchange connection is a fundamental step in creating a modern ERC-20 token. This integration not only enables basic trading functionality but also serves as the foundation for implementing advanced features that protect your token and its community. Through 20lab's intuitive interface, you can easily configure this connection and manage your token's interaction with your chosen DEX.

Frequently Asked Questions

What if I don't add a secondary pool to AMM?

In this scenario, your token will treat this pool as a normal token holder:

  1. It will be included in limits and dividends (if applicable).
  2. Instead of charging buy and sell fees, your token will charge transfer fees.
  3. Instead of maximum buy and sell transaction limits, maximum transfer limits will be enforced.
  4. Anti-bot won't work on trades with this pool.
  5. The EnableTrading function won't be applied on trades with this pool.

When should I add my secondary pools to the AMM list?

Secondary pools should be added to the AMM list as soon as they are created and liquidity is added. Many DEXes perform both operations in a single transaction, so it's difficult or even impossible to add them when the pool is completely empty.

If you have EnableTrading feature in your token, we don't recommend adding liquidity to secondary pools before trading is permanently opened. Even a small delay between adding liquidity and adding the pool to the AMM list can be used by buyers to buy your token earlier than it should be possible. It's better to add liquidity to secondary pools once your token is permanently open for trading.

How are multi-pool swaps handled by token contract?

Many ask what will happen if there is liquidity on multiple pools within the same DEX eg. Uniswap. Arbitrage bots or normal traders can use your pools not only to buy your token, but also to make other trades e.g. from ETH to USDT, which intermediately goes through TokenX/ETH and TokenX/USDT pools.

In this scenario, your token will jump from the first pool to the second or vice versa. Because both pools are added to your token's AMM list, your token contracts treat this action as an "internal dex transfer". This type is a special excluded transaction from all limits and taxes implemented in your token as the tokens are not leaving or entering the dex (buying or selling). In this case they stay within the dex ecosystem and don't apply for limits and taxes (if your token charges them).

Do I need to add additional RouterV2 contracts to the AMM list?

If your secondary liquidity pool is on a different DEX than your main liquidity pool, even if the RouterV2 contract is different, you don't need to add it to AMM in most cases. Just adding the liquidity pool is enough for the token to work properly.

If you have any questions about creating or managing your ERC-20 token, don't hesitate to reach out to us via our Telegram channel.

Related Posts

Continue your journey with these related blog posts.

ERC-20 Enable Trading inscription on a background featuring the 20lab logo with blue graphic elements.
How to Create ERC-20 Token with EnableTrading Function

Create an ERC-20 token with an EnableTrading function. This guide covers feature selection, implementing trading controls, and managing trading activation.

August 06, 2024

9 min read

ERC-20 Anti-bot inscription on a background featuring the 20lab logo with blue graphic elements.
How to Create ERC-20 Token with Anti-bot Cooldown

Learn how to create an ERC-20 token with anti-bot cooldown protection. This tutorial covers feature selection, cooldown management, and testing.

August 05, 2024

12 min read

Ethereum (ETH) cryptocurrency logo is centered on a dark background with blue elements and abstract geometric and wave-like patterns.
Ethereum Token - Discover the Leading Blockchain With 20lab

Explore Ethereum's capabilities for building secure, scalable and decentralized projects and why it is one of the best networks to choose for your token.

July 18, 2024

7 min read

ERC-20 Auto-burn Tax inscription on a background featuring the 20lab logo with blue graphic elements.
How to Create ERC-20 Token with Auto-burn Tax

Unleash the potential of your ERC-20 token with 20lab's auto-burn tax feature. Our guide shows you how to create and customize it for maximum efficiency.

August 17, 2024

14 min read

Solana Transfer Tax inscription on a background featuring the 20lab logo with purple graphic elements.
Ultimate Guide to Creating SPL (Solana) Token with Transfer Tax

Master the art of creating Solana tokens with transfer tax. 20lab's comprehensive guide covers everything to know about SPL token creation and management.

September 02, 2024

11 min read

Share your feedback