# Withdraw all fund from payment.addr

**URL:** <https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946>\
**Category:** Cardano Projects\
**Tags:** transactions, fund3, payments\
**Created:** [30 June 2021 11:31 UTC](https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946 "2021-06-30T11:31:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saghi](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@saghi](https://forum.cardano.org/u/saghi)\
**Post date:** [30 June 2021 11:31 UTC](https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946/1 "2021-06-30T11:31:10Z")

</div>

I have already retired my pool and transferred all funds to the payment.addr. Now I want to transfer all funds from payment to my personal wallet and shutdown the servers, but I receive the following error when I submit the signed transaction:

```auto
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash "65546106af95141987d0292a40df583da65d12baa2bee3326536cbed")) (StakeRefBase (KeyHashObj (KeyHash "c3cf4973c39727cf6da2c8430c951e2931e1ef047d8b66c2c93f330a"))),Value 87 (fromList []))])))])

```

Here is what I have done:  
I used the following command and it shows I have 508262976 lovelace in the payment.addr

```auto
cardano-cli query utxo --address $(cat payment.addr) --mainnet

```

Then calculate the fee which was 176589

I tried to transfer 508086300 which is less than 508262976 - 176589

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [30 June 2021 11:42 UTC](https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946/2 "2021-06-30T11:42:43Z")

</div>

Is the node synced?

Also try this topic

> [@Small transaction failing with error - OutputTooSmallUTxO](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280):
>
> I am trying to understand the math here. Trying a small transaction. I created a payment address (payment.addr). And transferred 2 ADAs into it using two transactions of 1-1 each. Now the query results into this: $cardano-cli query utxo --address $(cat payment.addr) --mainnet TxHash TxIx Amount -------------------------------------------------------------------------------------- 8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab939…

---

<div class="post-metadata">

**Author:** ![saghi](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@saghi](https://forum.cardano.org/u/saghi)\
**Post date:** [30 June 2021 12:10 UTC](https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946/3 "2021-06-30T12:10:04Z")

</div>

Yes, the node is synced,

I’m not sure how the thread your shared can be adopted to my case. To my understanding the problem is having a transaction less than minUTxOValue which in my case is 87 the remaining money back to payment.addr. Here is my build command. Any thoughts are highly appreciated:

```auto

cardano-cli transaction build-raw \
    ${tx_in} \
    --tx-out $(cat payment.addr)+87 \
    --tx-out ${destinationAddress}+508086300\
    --invalid-hereafter $(( ${currentSlot} + 10000)) \
    --fee ${fee} \
    --out-file tx.raw

```

---

<div class="post-metadata">

**Author:** ![tomdx](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/tomdx/32/44498_2.png) [@tomdx](https://forum.cardano.org/u/tomdx)\
**Post date:** [30 June 2021 12:45 UTC](https://forum.cardano.org/t/withdraw-all-fund-from-payment-addr/65946/4 "2021-06-30T12:45:35Z")

</div>

@saghi The value of the Tx must be preserved. i.e. TxIn - TxOut - Fees == 0  
You can have multiple TxIn/TxOut but the above must still be true
