seed
seed(uint128 liq, uint256 max0, uint256 max1, address to) returns (uint256 shares, uint256 used0, uint256 used1)
You pass the liquidity you want to add; the pool decides what that costs. Anything you sent above the cost comes straight back in the same transaction.
Shares are minted in proportion to liquidity — and you also contribute your proportion of any fees the vault has harvested but not yet compounded, rounded up. That is what stops a deposit from diluting the holders who were already there.
The first seed burns a thousand shares to the zero address. An empty vault whose share price can be walked up by a donation is the oldest bug in this shape of contract, and a floor is the cheapest fix.