# Help with Taking rewards issue

**URL:** <https://forum.cardano.org/t/help-with-taking-rewards-issue/62247>\
**Category:** Operate a Stake Pool\
**Created:** [21 May 2021 11:55 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247 "2021-05-21T11:55:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Carlos](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jose\_Carlos](https://forum.cardano.org/u/Jose_Carlos)\
**Post date:** [21 May 2021 11:55 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/1 "2021-05-21T11:55:41Z")

</div>

I don’t understand how to create successfully the transaction rewards. Can you assist me? I’m trying to follow the official guide but its for no avail.

> **[3,918 commits this week - Cardano Updates](https://cardanoupdates.com/)**
>
> Cardano releases and daily development reports at 00:00 (UTC). See commits in real-time.

It always ends with the same error  
(ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737223564 (fromList )))

I’m sharing with you the commands and values I’m experiencing on my server.

# Create protocol.json

cardano-cli query protocol-parameters   
–mainnet   
–out-file protocol.json

# Query stake address

cardano-cli query stake-address-info   
–mainnet   
–address $(cat poolOwner.staking.addr)

[  
{  
“address”: “stake1…55l”,  
“rewardAccountBalance”: 690381863,  
“delegation”: “poolId”  
}  
]

# Query payment

## cardano-cli query utxo --mainnet --address $(cat payment.addr) TxHash TxIx Amount

tx-in 0 46841701 lovelace

cardano-cli transaction build-raw   
–mary-era   
–tx-in tx-in#1   
–tx-out $(cat payment.addr)+0   
–withdrawal $(cat staking.addr)+0   
–invalid-hereafter 0   
–fee 0   
–out-file withdraw\_rewards.draft

# Calculate min fee

cardano-cli transaction calculate-min-fee   
–tx-body-file withdraw\_rewards.draft   
–tx-in-count 1   
–tx-out-count 1   
–witness-count 1   
–mainnet   
–protocol-params-file protocol.json

172365

# Calculate min fees

expr 46841701 - 172365 + 690381863  
737051199

# Cardano build raw

cardano-cli transaction build-raw   
–mary-era   
–tx-in txwin#1   
–tx-out $(cat payment.addr)+737051199   
–withdrawal $(cat poolOwner.staking.addr)+690381863   
–invalid-hereafter 12345678   
–fee 172365   
–out-file withdraw\_rewards.raw

# Sign transaction

cardano-cli transaction sign   
–tx-body-file withdraw\_rewards.raw   
–signing-key-file payment.skey   
–signing-key-file poolOwner.staking.skey   
–mainnet   
–out-file withdraw\_rewards.signed

# Submit

cardano-cli transaction submit   
–tx-file withdraw\_rewards.signed   
–mainnet

The error is always the same  
(ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737223564 (fromList )))

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [21 May 2021 13:12 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/2 "2021-05-21T13:12:19Z")

</div>

> [@Jose\_Carlos](#):
>
> (Value 737223564 (fromList

Hi!

What happens when you add 737223564 to txout

---

<div class="post-metadata">

**Author:** ![Jose\_Carlos](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jose\_Carlos](https://forum.cardano.org/u/Jose_Carlos)\
**Post date:** [21 May 2021 14:05 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/3 "2021-05-21T14:05:12Z")

</div>

ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737395929 (fromList ))))

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [21 May 2021 14:34 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/4 "2021-05-21T14:34:10Z")

</div>

so is it really txin#1 contains 46841701?

---

<div class="post-metadata">

**Author:** ![Jose\_Carlos](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jose\_Carlos](https://forum.cardano.org/u/Jose_Carlos)\
**Post date:** [21 May 2021 14:42 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/5 "2021-05-21T14:42:26Z")

</div>

## TxHash TxIx Amount

TUXIN 0 46841701 lovelace

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [21 May 2021 14:45 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/6 "2021-05-21T14:45:03Z")

</div>

> [@Jose\_Carlos](#):
>
> –tx-in txwin#1

but you provided #1 during transaction build, so lets change it to #0

---

<div class="post-metadata">

**Author:** ![Jose\_Carlos](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jose\_Carlos](https://forum.cardano.org/u/Jose_Carlos)\
**Post date:** [21 May 2021 14:52 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/7 "2021-05-21T14:52:07Z")

</div>

like this?

cardano-cli transaction build-raw   
–mary-era   
–tx-in txin#0   
–tx-out $(cat payment.addr)+737045127   
–withdrawal $(cat poolOwner.staking.addr)+690381863   
–invalid-hereafter 12345678   
–fee 178437   
–out-file withdraw\_rewards.raw

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 12345678)}) (SlotNo 30042462)))])

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [21 May 2021 14:55 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/8 "2021-05-21T14:55:21Z")

</div>

the invalide-hereafter should be more then 30042462, like 31000000  
the official documentation about withdraw rewards:  
[https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/withdraw-rewards.html](https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/withdraw-rewards.html)

---

<div class="post-metadata">

**Author:** ![Jose\_Carlos](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jose\_Carlos](https://forum.cardano.org/u/Jose_Carlos)\
**Post date:** [21 May 2021 14:56 UTC](https://forum.cardano.org/t/help-with-taking-rewards-issue/62247/9 "2021-05-21T14:56:11Z")

</div>

> [@laplasz](#):
>
> 31000000

Transaction successfully submitted.  
thanks!
