-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PART-3] Add transaction tax report #382
[PART-3] Add transaction tax report #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment
|
||
continue | ||
} | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this logic.
Is not the exact usd what we are trying to get.
Why would we need the first and last symbol price mapped to usd?
We should add the USD reference, lastSymbPriceUsd etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to simplify tax calc I would like to have a distinct data structure: just have firstSymbPrice and lastSymbPrice for pairs eg tETHBTC
At the same time, we can have movements eg BTC deposits, and should consider it like tBTCUSD
exactUsdValue - is the amount in transaction in USD (the logic would be as we planned) that can be used for calc prices of pairs eg tETHBTC
In other words, in tables, have one additional field exactUsdValue
when have exactUsdValue -> calc firstSymbPrice, lastSymbPrice
if don't have exactUsdValue -> get from pub-trades, set exactUsdValue to appropriate tables -> calc firstSymbPrice, lastSymbPrice
having firstSymbPrice, lastSymbPrice can calc tax report
the idea is to not calculate everything in one place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
This PR adds ability to fetch transactions entries based on
trades
,movements
andledgers
tables forTransaction Tax Report
It's a 1-part of the feature, the main idea taken from these PRs: #373, #378, #379
Basic changes:
exactUsdValue
and_id
for movements