Skip to main content
Merkle Street

Protocols, markets, policy, people

Swap the Right Amount Before Funding a New Token Pair

Swap only the token amount needed for the pair’s target ratio, then add both assets to the pool and check the initial on-chain price before confirming.

Merkle Street Newsroom#30723f3 min read

Abstract cover artwork

To fund a new token pair, swap part of the asset you hold into the second asset, then deposit both in the ratio the pool will use. A decentralised exchange routes the swap through an existing pool: your transaction specifies the input token, the amount, and the minimum output you will accept. After the swap settles, a liquidity transaction supplies the two assets to the new pool. For a fuller explanation of the base swap mechanics, see the linked guide. The key is to calculate the needed amount before trading, because the swap price and the pool’s opening price depend on how much of each asset you provide.

How much should you swap before adding liquidity?

Swap enough to match the pair’s intended starting ratio, while keeping the amount you want to contribute in the first token. If you plan to deposit 100 units of token A and the intended pool ratio is one unit of A for two units of B, you need 200 units of B. If you already hold some B, subtract that balance before deciding how much A to swap. This is like measuring ingredients to a recipe: the proportions determine the result.

For an existing pool, its reserves usually determine the ratio accepted for adding liquidity. For a genuinely new pool, the first liquidity provider sets the initial ratio, which also implies the pool’s opening price. A ratio far from the price on other markets can invite traders to exploit the difference, leaving the pool with a changed balance. Decide the ratio deliberately and compare it with available market prices before adding funds.

What happens during the swap?

Your wallet sends a swap transaction to a router contract, which directs the trade to a pool holding both tokens. The pool’s pricing rule calculates the output from its reserves and the amount entering it. The pool charges a fee, and the trade changes its reserve balance, so the quoted price can move before your transaction executes. The wallet’s slippage setting limits how far the final output may fall below the quoted amount.

Before confirming, check the token names and contract addresses, the input amount, the minimum output, and the network. A token’s ticker or logo is not proof that it is the intended asset. A very loose slippage limit can let a trade complete at a much worse price than expected; a limit set too tightly can cause the transaction to fail if the market moves.

How do you add the two assets to the new pair?

Once the swap is complete, open the exchange’s liquidity flow and select the two tokens for the pair. Enter the amount of one asset; the interface may calculate the corresponding amount of the other from the pool ratio. Review both quantities and the implied price. The liquidity transaction may require token approvals first, allowing the contract to move the specified tokens from your wallet. Approve only the assets and amounts required for the deposit.

  • Keep enough of the original asset for the swap and any transaction fees.
  • Use the swap’s minimum-output limit to define an acceptable execution.
  • Check the pair and deposit ratio again in the final wallet confirmation.
  • After adding liquidity, verify the transaction and your pool position in the wallet or exchange interface.

The practical order is simple: choose the pair’s starting ratio, work out the shortfall in the second asset, swap only what is needed, then supply both assets. That keeps the swap and the pool funding connected to one clear target: the amount of each token you intend to place at the opening price.