Tracking Rewards Prices

What is the best way to track the value of rewards on a daily basis? I was hoping I could see the rewards as transactions on the blockchain and then look up daily algo prices but I don’t see the rewards as transactions. Am I missing something?

Thank you,
Jose

Rewards are only written on chain when you make a transaction involving Algos from/to your account.
The Algorand Wallet display a “reward” line every time a transaction from/to your account triggered such writing.

Similarly, on algoexplorer.io, if you click on More Information on a transaction, you will see how much reward the transaction generated for the sender/recipient/close to account. See e.g., Algorand Transaction

Note that you actually receive rewards more often than that, but they are not written to the chain, because that would be too costly.
These non-written rewards are called “pending rewards”.
For all intent and purposes, those pending rewards are parts of your balance, except when it comes to compounding.

For more information, see:

Thanks for the reply. So what do you think is the best way to look for daily value of the reward in the wallet?

I guess I could transfer 0 algos to another address in my wallet so the rewards shows up, but it seems like that would be just be throwing away the fee daily. I’ve read the links you posted, but Is there a way to see directly in the wallet perhaps? I am looking for something like, “address XXXX has received YYY algos” In other words, holding on to algos generates a daily dividend that I would like to be able to track.

I’ve been thinking that it might be possible with goal account reward in some way?

Thanks,
Jose

I don’t know if you can do it with goal. goal account rewards return all the rewards received from the beginning (including the pending ones), but not just the pending ones.

You can use the API.
For example, using jq (very convenient tool to parse JSON)

$ curl -s -H "X-Algo-API-Token: $(cat $ALGORAND_DATA/algod.token)" "$(cat $ALGORAND_DATA/algod.net)/v2/accounts/346ZPS3VFIY522T5B4SCGHPUU32IZCV66YQOK6SHC2QJZ3WNRAOPSPYZGA" | jq '."pending-rewards"'
100156

This is assuming that $ALGORAND_DATA is defined correctly and does not contain space.
You can also use an API service or sandbox. See 1. Workspace Setup - Algorand Developer Portal

If you do send a daily zero transaction (or use some tool to do so while we work on implementing something like this for the wallet), you can indeed see those reward transactions in the txn history. If you’d like a condensed view, you can download your history and filter the CSV.

Thanks @ian . I think I understand that part, but wouldn’t that degrade the value of the rewards since I have to include a fee with the transaction?

Regards,
Jose

@fabrice @ian

Thank you for all the replies. I created a simple script that runs via cron every day. Now I can see the transaction in the blockchain daily, which is a good step in tracking the price of the reward, but also creates compounding. I still have a few questions about reward prices though.

  1. My understanding is that rewards are generated every few seconds even if they are not seen in the block chain. It seems tedious to track the price of algo every second, so that every un-transacted partial reward can be assigned a basis value even before it shows up in the block chain after the daily transaction. Therefore, what should be the value of the reward seen in the block chain? The price at the time of the transaction? The average price of algo during the day? Other?

And, related question:

  1. What should be the basis value of a reward that has been accumulating for a while before it shows up in the block chain? The price of algo at the time of the transaction? The average price over the time of the accumulation? Other?

Thanks for any advice,
Jose

Actually rewards to be distributed are accumulated in every blocks.
Once enough rewards are accumulated to give 1 microAlgo of reward for each 1 Algo, then they are actually distributed.
So in practice rewards are distributed every few blocks.

It is up to you to decide how to count rewards for tax and accounting purposes.

I believe some (most?) services for cryptocurrency taxes report rewards only when they are committed to the blockchain (and at the price of the time they are committed to the blockchain). Whether it is the appropriate choice for any or all juridictions is unclear.

@fabrice
Thanks for the reply. One, hopefully final, obviously noob question: if I send 0 algos from one address to another in my wallet did I get in total (rewards - fee) or is the fee reflected in the reward value that is seen in the block?

Thanks,
Jose

The transaction will record the rewards and the fee independently.
Your balance will be increased by rewards - fee.

1 Like