Uniswap liquidity has been fully withdrawn. Why haven’t the tokens returned to my wallet?
In Uniswap v3, withdrawing liquidity and collecting tokens are two separate actions. Even when the position shows that its liquidity has dropped to zero, the withdrawn assets may still be in the contract waiting for you to collect them.
You can see the difference by reading the position management contract. decreaseLiquidity reduces the position and credits the two tokens withdrawn in this transaction, along with newly settled fees, to the unclaimed balance. collect is what actually withdraws the unclaimed tokens from the pool and transfers them to the recipient address specified in the call. The interface can perform both actions in the same on-chain transaction, so it’s hard to tell which step was completed based on the button label alone.
When reconciling, first confirm it’s the same position NFT, then check whether the transaction includes a collect operation and which address the tokens were actually transferred to. Also, don’t record the entire collected amount as fees. As long as previously withdrawn assets remain in the unclaimed balance, a single collect may include both withdrawn assets and fees. To record them separately, reconcile the token amounts recorded in each withdrawal event with the subsequent collect.
$UNI #Uniswap
Original source https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol