A stupid little cost calculator to compare the quote on a BTC buy/sell against pro.coinbase.com
order book. The results are the premium payed for the buy or sell.
-
Console:
python crypt_cost.py counter base [exchange:base-counter]
counter
: The counter currency (dollars) transacted in the buy/sellbase
: The base currency (satoshis) transacted in the buy/sellexchange
: The exchange to use (coinbase, kraken, gemini).base-cntr
: The "base-counter" currency pair (btc-usd, ltc-btc, eth-btc... etc)
-
Output:
spot
: The current USD/BTC spot price quoted onpro.coinbase.com
order bookdeal
: The USD/BTC price you are about to pay on your current transactionbest
: The smallest fee possible by crossing the spread and issuing a limit order onpro.coinbase.com
buy
: The premium / discount you are paying / getting if this is a buy of BTCsell
: The premium / discount you are paying / getting if this is a sell of BTC
To install, you will need either python installed. Either version 2 or version 3. If you want to run the KivyGui, you will need to perform the Kivy steps as well. For Android, there is a generic launcher on PlayStore. I've moved those instructions to a separate file.
- Install Python. Either version 2 or 3 will work.
- Download a ZIP of the gist from here (Zip Download) or just clone the git.
- Follow the instructions in the Usage section above.
The KivyGui is really intended for Android, but you can run it on desktop if you want. To do so:
- Install Python. Either version 2 or 3 will work.
- Download a ZIP of the gist from here (Zip Download) or just clone the git.
pip install kivy_deps.sdl2 kivy_deps.glew kivy_deps.gstreamer
pip install kivy
python cc_kivy.py
- Android Setup moved to a separate file.
-
Example: An example of a BTC buy quote on Coinbase.com Mobile App
- Console: python crypt_cost.py 100 892030
- Output:
spot
: 10,817.57deal
: 11,210.39best
: 0.1834 %buy
: 3.6313 %sell
: -3.6313 %
- Conclusion: By using the mobile app I would be paying a 3.6 % premium over spot. If I went to
pro.coinbase.com
and issued a limit order, it would have cost me 0.18 %.
-
Example: An example of a BTC buy quote on CashApp Mobile App (about an hour later)
- Console: python crypt_cost.py 100 913916 btc-usd
- Output:
spot
: 10,739.94deal
: 10,941.92best
: 0.1501 %buy
: 1.8807 %sell
: -1.8807 %
- Conclusion: By using the CashApp I would be paying a 1.9 % premium over spot. If I went to
pro.coinbase.com
and issued a limit order, it would have cost me 0.15 %. Note the use of the trading pair without the exchange. In the absence of a named exchange, Coinbase is assumed.
-
Example: An example of a BitRefill order for a Walmart Giftcard on Lightning Network. This would count as a sell of BTCLN for USD denominated Giftcard btw.
- Console: python crypt_cost.py 100 979216 coinbase:btc-usd
- Output:
spot
: 10,704.68deal
: 10,212.25best
: 0.2068 %buy
: -4.6001 %sell
: 4.6001 %
- Conclusion: By using the BitRefill to purchase the GiftCard, I would be paying a 4.6 % premium over spot. If I went to
pro.coinbase.com
and issued a limit order, to sell BTC for USD, it would have cost me 0.21 %. Notice the use of the named exchange in the pair. This could have beenkraken:
orgemini
but it is just a simple example of the arguments form.
-
Example: An example of using it to calculate the on-chain fees of a TXN. 100,000 sats on chain with a 1,604 sat fee. Note the
btc-btc
pair.- Console: python crypt_cost.py 100000 101604 btc-btc
- Output:
spot
: 1.00000000deal
: 0.98421322best
: 0.1500 %buy
: -1.5787 %sell
: 1.6040 %
- Conclusion: By using an on-chain BTC transaction, you are paying about 1.6 % in miner fees. Obviously larger transactions or batched transactions can lower this fee down to where it is barely noticable, but it is always good to be aware of what the fee is. There are special cases for the
btc-btc
orltc-ltc
orxxx-xxx
key pairs. These default to a simple percentage calculator.
Please keep in mind that all the companies are taking substantial risk and great effort to provide these services. Although everyone wants these conversions to be as inexpensive as possible, there is the undeniable truth that these companies have overhead to sustain. My purpose is simply to provide a very simple price comparator to allow people to shop services effectively. These companies should be commended for treading into the waters of a cryptocurrency buisness.
If you have any questions, just add a comment to this gist (bottom of this page) and I will see it. You could also always catch me on reddit
Expand for tip addresses
BTC-LN: https://tippin.me/@dkbriandBTC-b32: bc1qwc2203uym96u0nmq04pcgqfs9ldqz9l3mz8fpj
BTC: 3AAzK4Xbu8PTM8AD3fDnmjdNkXkmu6PS7R
LTC-b32: ltc1q5uucgx9f8n70nq7jmjy03rpg84cm4tm70z5rz6
LTC: MKcAge42cX6WZnnPfFGJAxReUYZUbsi6t3
ETH / BAT: 0xBc72A79357Ff7A59265725ECB1A9bFa59330DB4b