Comments (5)
FYI, Looks correct when chaging config to CoinGecko
from bittytax.
Other data sources are correct.
% bittytax_price historic USDT 07/11/2020 -ds all
1 USDT=0.00006403008998220877 BTC via CoinGecko (Tether)
1 BTC=11,817.074841427373 GBP via CoinGecko (Bitcoin)
1 USDT=£0.76 GBP
1 USDT=0.0000653 BTC via CoinPaprika (Tether)
1 BTC=11,294.5 GBP via CryptoCompare (Bitcoin)
1 USDT=£0.74 GBP
1 USDT=0.00009221 BTC via CryptoCompare (Tether)
1 BTC=11,294.5 GBP via CryptoCompare (Bitcoin)
1 USDT=£1.04 GBP
Checked the endpoint from the debug.
price: GET https://min-api.cryptocompare.com/data/all/coinlist
price: GET https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=USDT&tsym=BTC&limit=2000&tryConversion=false&toTs=1777503600
price: 2020-11-07, 1 USDT=0.00009221 BTC via CryptoCompare (Tether)
1 USDT=0.00009221 BTC via CryptoCompare (Tether)
price: GET https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=BTC&tsym=GBP&limit=2000&tryConversion=false&toTs=1777503600
price: 2020-11-07, 1 BTC=11,294.5 GBP via CryptoCompare (Bitcoin)
1 BTC=11,294.5 GBP via CryptoCompare (Bitcoin)
1 USDT=£1.04 GBP
Response confirms it's an data issue with CryptoCompare.
{"time":1604707200,"close":0.00009221,"high":0.00009221,"low":0.00009221,"open":0.00009221,"volumefrom":0,"volumeto":0,"conversionType":"direct","conversionSymbol":""},
I've emailed CryptoCompare to raise the issue with them.
from bittytax.
Had a response from CryptoCompare (thankyou guys for being so quick to respond).
We noticed that you are trying to pull the data for the USDT/BTC pair, and since we don't have any active market that is included in our CCCAGG at the moment, the price you are getting with this endpoint ( https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=USDT&tsym=BTC&limit=2000&tryConversion=false&toTs=1777503600) is the last trading price from a market from 1 year ago.
There is 1 active market where USDT/BTC pair trades, it is on the Hikenex exchange, but the last trade happened 2 days ago so we wouldn't recommend using this pair for reference as it doesn't have the most recent trades.
It appears the CryptoCompare API works differently to the other data sources we use, the requested trading pair is related to that specific market pair, not an aggregation of market data.
I don't fully understand the reason why you need to do so many conversions to get a price of the certain asset as you can simply use the endpoint that will give you the direct trading price, for example:
https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=USDT&tsym=GBP&limit=50&tryConversion=false&toTs=1604707200If you want to continue using several different endpoints, to calculate the price, we recommend using the active markets and pairs with BTC as a 'fsym':
https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=BTC&tsym=USDT&limit=50&tryConversion=false&toTs=1604707200
https://min-api.cryptocompare.com/data/histoday?aggregate=1&extraParams=BittyTax/v0.4.2&fsym=BTC&tsym=GBP&limit=50&tryConversion=false&toTs=1604707200
and calculate the rate between the USDT and GBP.
Recommend everyone uses CoinGecko as a data source for stable coins for the moment, until I can think of the best way to implement a fix for this.
Ideally it would be better to use direct conversions from token to GBP where available instead of using BTC prices as an intermediary.
from bittytax.
On further investigation it appears that the tryConversion parameter being set to False
was causing issues.
The API used to get the latest price (i.e. https://min-api.cryptocompare.com/data/price?extraParams=BittyTax/v0.4.2&fsym=USDT&tsyms=GBP) does not use the tryConversion parameter (it defaults to True
) and returns correct prices.
This parameter causes the endpoint to try different conversions to return more accurate data. For example, it will invert the trading pair and recalculate the price if there is more liquidity for BTC/USDT than USDT/BTC.
CryptoCompare have confirmed this (big thank you to their excellent support team). Here is a blog post that explains the tryConversion parameter.
from bittytax.
This fix has been delivered in BittyTax v0.4.3.
If you have any stablecoins in your transaction records (i.e. USDT, USDC, etc) it is important that you upgrade.
pip install --upgrade BittyTax
You will also need to delete the existing price data cache for CryptoCompare, this will force the bittytax
accounting tool to refresh the price data.
The data cache is in your home directory as shown below.
~/.bittytax/cache/CryptoCompare.json
from bittytax.
Related Issues (20)
- bug: GMT, BST are not the same as Europe/London HOT 3
- enhancement: make bittytax_conv more script friendly by adding non-zero exit status
- Can´t parse binance csv HOT 1
- Lost transaction - Final balance and current holdings HOT 3
- Binance parser cash-deposit buy_quantity should be gross 'Indicated Amount' HOT 2
- Converting Binance deposits/withdrawals fails HOT 1
- Kraken parser update
- Method getiterator has been removed in Python versions >=3.9 HOT 7
- Too many requests for coingecko HOT 3
- Fantom Opera Support HOT 3
- Add offline mode
- including staked amounts in the audit report HOT 3
- Cannot run code against new tax year 2022-23 HOT 1
- Support Ledn loans, repayments and interest HOT 1
- Coinbase: 'Advanced Trade Buy' HOT 5
- Unidentified Cryptoassets trezorsuite HOT 1
- Request to add Binance margin trades HOT 5
- Request to add ETH/BETH support on Binance HOT 2
- Updated Binance Statements Spreadsheet HOT 3
- No current holding section in my pdf report HOT 2
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 bittytax.