Comments (9)
The issue seems fully resolved: closing. If DaLI and RP2 are useful to you, please consider adding a star to their Github page. Thanks!
from dali-rp2.
No apology needed, you have helped a lot with all the bug reports and the log data! I'll take a look at this.
from dali-rp2.
Implemented in the latest version: could you please test?
from dali-rp2.
Tested on 0.4.0 see the Staking Reward transactions, no errors when I run now!
When looking at the spot prices for XTZ, this one stood out:
2021-10-06 15:38:49 +0000
$16.58
Is that right?
from dali-rp2.
Looks too high, but it could be an artifact of Coinbase returning low-precision values. The spot price is calculated by native_amount/amount: if native_amount is around 1-2c, then the calculation of spot_price can be off by quite a bit. The problem is that Coinbase is returning 2 decimal digit precision for fiat values. However this should have no impact on your taxes, because they are computed based on the reported fiat value. Can you paste here the transaction from the log files: that would help us verify the above explanation.
from dali-rp2.
Sorry, should have clarified, this is using the -s flag on DaLI, as the staking rewards don't have a Spot Price from Coinbase by default.
from dali-rp2.
Here's the log for it:
2022-03-30 21:06:18,490/dali/DEBUG: Self-contained transaction: InTransaction:
plugin=Coinbase
unique_id=AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
raw_data={"id": "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA", "type": "staking_reward", "status": "completed", "amount": {"amount": "0.000603", "currency": "XTZ"}, "native_amount": {"amount": "0.01", "currency": "USD"}, "description": null, "created_at": "2021-10-06T15:38:49Z", "updated_at": "2021-10-06T15:38:49Z", "resource": "transaction", "resource_path": "/v2/accounts/CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC/transactions/AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA", "instant_exchange": false, "from": {"id": "BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB", "resource": "user", "resource_path": "/v2/users/BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB", "currency": "XTZ"}, "details": {"title": "Tezos reward", "subtitle": "From Coinbase", "header": "Received 0.000603 XTZ ($0.01)", "health": "positive"}, "hide_native_amount": false}
timestamp=2021-10-06 15:38:49 +0000
asset=XTZ
exchange=Coinbase
holder=((name))
transaction_type=Staking
spot_price=16.58374792703150912106135987
crypto_in=0.000603
fiat_fee=0
fiat_in_no_fee=0.01
fiat_in_with_fee=0.01
notes=Tezos reward
from dali-rp2.
The -s
option has no effect here because the native amount is > 0, so the spot price is computed as native_amount / amount (0.01/0.000603=16.58). The -s
option would take effect when Coinbase incorrectly returns the native_amount as zero. The problem in this case is that Coinbase returns 2-decimal-digit precision fiat numbers, which is very low precision: when the fiat amount is very low (in this case it's $0.01) the low precision can cause the calculation of spot price to be off. E.g. imagine the real fiat amount was $0.0051 and Coinbase rounds it to $0.01: if they had returned a higher precision number ($0.0051), then we would have computed the spot price to be 0.0051/0.000603=8.45. The -s
option only takes effect when we don't have a way to get the spot number. For higher fiat values (e.g. $5.07, the problem is lessened, because you have more precision). However since the taxes are calculated using fiat amounts (as they are given by the exchange) the spot price in this case should not affect the final result. For additional context, Coinbase Pro doesn't have this problem: they return high precision fiat numbers and so the issue doesn't present itself there.
Bottom line: i think this is correct, given the (bad) numbers returned by Coinbase when fiat amounts are very low.
from dali-rp2.
I also should mention that the other option would be to use -s whenever Coinbase doesn't report the price, but this comes with other problems, because in this case the calculation would seem off (amount * spot price != native price). I think the solution we have in place now (described in my previous post) is preferable. But again neither solution is perfect and the cause is Coinbase sending out low-precision numbers.
from dali-rp2.
Related Issues (20)
- Pricing for dates before asset is listed on Binance.com are inaccurate HOT 2
- Weigh vertexes in Djikstra based on monthly volume for the CCXT pair converter HOT 23
- Negative Transaction Fees and transaction_resolver errors HOT 11
- Asset missing from graph HOT 10
- 2 same uniqueID transactions in binance´s dust trade. HOT 3
- Spot price for XXX->YYY not found on any pair converter plugin HOT 7
- Kraken Rest API _initialize_markets broken HOT 3
- Bitbank withdrawals rest API HOT 4
- 2 transactions with same uniqueID in binance HOT 7
- Bitbank widthdrawals status CONFIRM_TIMEOUT
- ExchangeNotAvailable hang time HOT 2
- Override or fallback exchanges HOT 4
- Unrecognized dividends in binance HOT 4
- Missing fiat to crypto transactions in binance HOT 3
- Implement Binance Japan Data Loader Plugin HOT 1
- Unnecessary check in dali_main regarding missing NATIVE_FIAT.value
- Error with coinbase asking for apikey HOT 4
- ETH2 fetch price problem HOT 7
- LUNA->EUR not found HOT 5
- WARNING: Unrecognized Dividend: LUNA compensation. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dali-rp2.