Adding only one liquidity side in pair

I actually don’t understand why all the AMM derived from uniswap don’t allow adding liquidity only on one side of the pool? Is it technically difficult?
The contract should automatically:

  • Swap half of the liquidity provided for the other token (paying the fees)
  • Allocate both tokens to the pool.

The advantages would be:

  • 1 transaction instead of two, so less transactions in the network and only one fee for users
  • No tokens leftover because swapping manually always results in non perfect 50/50 tokens.
1 Like

It wouldl be convenient because you would just have to press 1 button, but the txn and fees would be the same, you would just pay a higher fee for interacting with that one contract which executes all the txn insteand of paying the same fees one by one.

Also, you need to have some AVAX leftover to pay for unstaking fees, so I don’t understand your last point.

Why would the tx and fees be the same? I mean changing the contract which does the operation inside. The user only transfers one currency and the contract makes everything and returns the LP.
About the last point, no all pairs have AVAX. For example imagine ETH-PNG. An user only has ETH. The contract automagically swaps 50% of ETH for PGN and allocates them to the pool with 0 leftovers. If the users have to manually swap ETH for PNG, due to fees and slippage it’s difficult to calculate the precise amount of ETH to swap to have an exactly 50-50%.
If AVAX is involved (but also for other pairs) the user can simply specify the % of his total amount he wants to allocate to the pool, so that the user can choose for example 90% leaving 10% avax fo transaction fees.

If you don’t do the txn, the contract does them for you, so there would be a contract that would make the same steps you do (sell half of the currency for the other pair and then deposit the liquidity), thus making the same. The gas price would be the same, since interacting with this contract would cost the same or more than interacting with the other 2. I really see no use in this.

1 Like

It would be very tricky to write such a contract because of slippage and price changes, especially with large stake amounts.
But I think it should be possible to simply stake slightly unequal amounts because that would hardly affect the LP and would likely even out over many deposits.

Tricky? I don’t thinks so. It’s easy math and everything is deterministic. I don’t see any problem.

It’s tricky because large swaps change the exchange rate. Which will change the balance of the liquidity pair itself. It’s interactive which makes it more complicated to code.
It’s also tricky because it all has to happen from 1 account in a sequence of transactions so there is a time effect. For instance, if somebody else has done a swap at the same time, the liquidity pair balance changes again.
Also, a larger, more complicated contract is more expensive to execute so there will be little gain in terms of network costs.
And a larger, more complicated contract is more prone to errors, failures or possible hacks.