Bitcoin Forum
November 09, 2024, 03:40:10 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Actual bitcoin price tool  (Read 132 times)
pawanjain (OP)
Hero Member
*****
Offline Offline

Activity: 2856
Merit: 732


Nothing lasts forever


View Profile
December 27, 2020, 08:56:27 AM
Last edit: May 16, 2023, 03:04:29 AM by pawanjain
Merited by hugeblack (2)
 #1

Hello guys,

Today I have created a python program which displays the actual bitcoin price for a particular country for the specific year.
This is more of a fun project for me and created this program just to learn good stuff. I wish to create more such tools which might be useful for the crypto community.
As of now I haven't hosted it on any platform but may be host it if I get good feedback from you people. Do let me know what you feel about it and thoughts and suggestions to how can I improve it further.



It's quite a basic program which takes the inflation rate of a given country for a specific year as an input and then calculates the actual price of bitcoin.
A list of countries is displayed to the user and then the user has to enter the country name and the year for which he wants to calculate the price of bitcoin.
An API call then gets the inflation rate for the country for the given year.
Then the user is asked to enter the price of bitcoin. I could have automatically fetched the current price of bitcoin through API but then thought what if the user doesn't want the current price.
So the user is asked to enter the bitcoin price manually. Once entered the actual price of bitcoin is displayed as output to the user.

Example output :


 


Kindly drop your suggestions.

My Github link to this program : https://github.com/hmrawal/My_Projects.git

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
 
 Duelbits 
██
██
██
██
██
██
██
██

██

██

██

██

██
TRY OUR UNIQUE GAMES!
    ◥ DICE  ◥ MINES  ◥ PLINKO  ◥ DUEL POKER  ◥ DICE DUELS   
█▀▀











█▄▄
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 KENONEW 
 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀█











▄▄█
10,000x
 
MULTIPLIER
██
██
██
██
██
██
██
██

██

██

██

██

██
 
NEARLY
UP TO
50%
REWARDS
██
██
██
██
██
██
██
██

██

██

██

██

██
[/tabl
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6316


bitcoindata.science


View Profile WWW
December 27, 2020, 10:58:42 AM
 #2

It's quite a basic program which takes the inflation rate of a given country for a specific year as an input and then calculates the actual price of bitcoin.


This is not very precise. This is not how bitcoin price works in other countries.

I don't know where you are from.. but bitcoin price works differently in every country.

It depends on country supply of bitcoin in local exchanges, number of exchanges available and so on.

There are many countries which has an spread of about 10% or more in the bitcoin. Sometimes bitcoin is more than 10% more expensive in a country after converting to usd.

Coindesk an Coinmarketcap.com have api which you can use that let you just request the price of bitcoin in any country,  based in local exchanges price.

pawanjain (OP)
Hero Member
*****
Offline Offline

Activity: 2856
Merit: 732


Nothing lasts forever


View Profile
December 27, 2020, 12:09:04 PM
 #3

It's quite a basic program which takes the inflation rate of a given country for a specific year as an input and then calculates the actual price of bitcoin.

This is not very precise. This is not how bitcoin price works in other countries.

I don't know where you are from.. but bitcoin price works differently in every country.

It depends on country supply of bitcoin in local exchanges, number of exchanges available and so on.

There are many countries which has an spread of about 10% or more in the bitcoin. Sometimes bitcoin is more than 10% more expensive in a country after converting to usd.

Coindesk an Coinmarketcap.com have api which you can use that let you just request the price of bitcoin in any country,  based in local exchanges price.

I am not sure but I guess you have not fully understood the program. The program is about the inflation rate and the price of bitcoin correlated to it for the given country. Here we have to enter the bitcoin price manually. So it's us who have to enter the bitcoin price whether it be the normal price or the premium price.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
 
 Duelbits 
██
██
██
██
██
██
██
██

██

██

██

██

██
TRY OUR UNIQUE GAMES!
    ◥ DICE  ◥ MINES  ◥ PLINKO  ◥ DUEL POKER  ◥ DICE DUELS   
█▀▀











█▄▄
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 KENONEW 
 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀█











▄▄█
10,000x
 
MULTIPLIER
██
██
██
██
██
██
██
██

██

██

██

██

██
 
NEARLY
UP TO
50%
REWARDS
██
██
██
██
██
██
██
██

██

██

██

██

██
[/tabl
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6316


bitcoindata.science


View Profile WWW
December 27, 2020, 10:26:46 PM
Merited by webtricks (1)
 #4

I am not sure but I guess you have not fully understood the program. The program is about the inflation rate and the price of bitcoin correlated to it for the given country. Here we have to enter the bitcoin price manually. So it's us who have to enter the bitcoin price whether it be the normal price or the premium price.

I didn't understand...

Inflation in your example, Russia, is not a bitcoin inflation. It is a inflation of their fiat currency, ruble. Why did you get a lower bitcoin usd pair price?

It is not even a ruble btc pair.

So if I am in Venezuela and VES has a 1000% inflation rate, your program will say bitcoin price is 2.600 usd?

Bitcoin price is very close to 27000 world wide, no matter any other currency inflation rate... afaik

pawanjain (OP)
Hero Member
*****
Offline Offline

Activity: 2856
Merit: 732


Nothing lasts forever


View Profile
December 28, 2020, 05:13:58 AM
Last edit: May 16, 2023, 03:04:21 AM by pawanjain
 #5

I didn't understand...

Inflation in your example, Russia, is not a bitcoin inflation. It is a inflation of their fiat currency, ruble. Why did you get a lower bitcoin usd pair price?

It is not even a ruble btc pair.

So if I am in Venezuela and VES has a 1000% inflation rate, your program will say bitcoin price is 2.600 usd?

Bitcoin price is very close to 27000 world wide, no matter any other currency inflation rate... afaik

Ok Let me try that again.

Firstly, the currency is nowhere mentioned in the program. The amount entered in the program is not necessarily USD. It can be any currency.
Now since Russia's currency is Ruble I have googled the price of bitcoin in Ruble it came as 2,010,000 as of writing the post.
So when I enter this amount in my program, as per the inflation rate of 2020 in Russia the below output is derived.
Here the bitcoin price is 1928595 Rubles but due to inflation the price has increased to 2,010,000 Rubles.


 


I have updated this screenshot in OP. Thanks for your comments.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
 
 Duelbits 
██
██
██
██
██
██
██
██

██

██

██

██

██
TRY OUR UNIQUE GAMES!
    ◥ DICE  ◥ MINES  ◥ PLINKO  ◥ DUEL POKER  ◥ DICE DUELS   
█▀▀











█▄▄
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 KENONEW 
 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀█











▄▄█
10,000x
 
MULTIPLIER
██
██
██
██
██
██
██
██

██

██

██

██

██
 
NEARLY
UP TO
50%
REWARDS
██
██
██
██
██
██
██
██

██

██

██

██

██
[/tabl
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6316


bitcoindata.science


View Profile WWW
December 28, 2020, 10:49:11 AM
 #6

Inflation is calculated daily or monthly.
The inflation which occured 12 months ago is already priced in today.

Even usd has a 2% average inflation per year.thats already priced in EVERYTHING,  including bitcoin.

I think that If you want to calculate the real bitcoin gains, i.e., bitcoin price -inflation, you should ask for the user bitcoin price 12 months ago.

Then you will get 27000 - price 28/12/19 - 2% = real gains

BitcoinOfficialGroup
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile WWW
December 28, 2020, 11:08:05 AM
 #7

Bitcoin Has Inflation?
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6316


bitcoindata.science


View Profile WWW
December 28, 2020, 01:11:46 PM
 #8

Bitcoin Has Inflation?

Yes it does.

But the inflation rate decreases every 4 years in every halving.

Now , we generate6.25 btc every block, which means about 1.8% annual inflation rate.
Before the halving it was 3.65

webtricks
Legendary
*
Offline Offline

Activity: 1918
Merit: 1728


View Profile
December 28, 2020, 06:12:10 PM
Last edit: December 28, 2020, 06:24:58 PM by webtricks
 #9

It's good to see that you are trying to create a utility tool but it doesn't make sense if user himself has to input the bitcoin price. If a user first has to look for the price of a particular date from the past, he can very well search for the inflation rate too, isn't it? After that it's just a simple division. Cheesy



This is more of a fun project for me and created this program just to learn good stuff. I wish to create more such tools which might be useful for the crypto community.
....
Kindly drop your suggestions.
My Github link to this program : https://github.com/hmrawal/My_Projects.git

Like you said that the tool is for learning purpose and you wish to create something useful for the crypto community, here is my suggestion for you to create something worthwhile:

Ask the user for two inputs - date and country. Then fetch the bitcoin price of the provided country for the provided date (you can look for local exchanges for the currency-specific price API). Then return the result something like this-

Nominal Profit/Loss of the User = [ (Current Price - Buy Price) / Buy Price ] * 100
Real Profit/Loss of the User (Inflated return) = [ (Current Price - Buy Price) / Buy Price ] * 100 * Inflation Adjustment Index

This will give user the stats whether his investment is yielding any inflation-adjusted profits or not which may be useful tool for some users. And most important of all, do make web app for the tool. Not everyone knows how to run Python script so web app is much more handy.




There are many countries which has an spread of about 10% or more in the bitcoin. Sometimes bitcoin is more than 10% more expensive in a country after converting to usd.

Coindesk an Coinmarketcap.com have api which you can use that let you just request the price of bitcoin in any country,  based in local exchanges price.

This won't work. Coindesk or Coinmarketcap APIs only calculate prices in USD. Then they convert the price to other currencies using forex API. So, the same problem will sustain. Suppose the price of bitcoin is $25,000. But it is selling at the premium of 10% in Indian Market. CMC API will simply convert $25000 into current rate of INR/USD (suppose INR 70/$) which is Rs. 1,750,000. But in actual the price is Rs. 1,925,000 in Indian Market.

So it is best to use APIs provided by the local exchanges or any other local pricing service.
hugeblack
Legendary
*
Offline Offline

Activity: 2688
Merit: 3969



View Profile WWW
December 30, 2020, 12:18:01 PM
 #10

Do not forget that many countries have more than one exchange rate, and sometimes the price differs from the official market and the exchange rate in the parallel market, which occurs in some countries.

Therefore, the most appropriate solution is to get the data from peer-to-peer trading sites, where you can choose an average of prices and build accounts on them based on the national currency and ignore the conversion from the dollar to the cash currency.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pawanjain (OP)
Hero Member
*****
Offline Offline

Activity: 2856
Merit: 732


Nothing lasts forever


View Profile
December 30, 2020, 01:38:35 PM
 #11

Do not forget that many countries have more than one exchange rate, and sometimes the price differs from the official market and the exchange rate in the parallel market, which occurs in some countries.

Therefore, the most appropriate solution is to get the data from peer-to-peer trading sites, where you can choose an average of prices and build accounts on them based on the national currency and ignore the conversion from the dollar to the cash currency.

Though the idea is good, it still has the issue of difference in price since different P2P platforms will have different prices.
For example: For India, Localbitcoins has the price of 22,94,000 INR whereas Paxful has the price of 22,25,00 INR which is a difference of 69,000 INR ($930 approx)
So there will always be a difference in price if we solely use just one exchange/P2P platform.
We will then have to use fetch the price from multiple exchanges and then take an average amount all together to get the most appropriate price.
Doing so will reduce the efficiency of the program and will also make it dependable on multiple sources.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
 
 Duelbits 
██
██
██
██
██
██
██
██

██

██

██

██

██
TRY OUR UNIQUE GAMES!
    ◥ DICE  ◥ MINES  ◥ PLINKO  ◥ DUEL POKER  ◥ DICE DUELS   
█▀▀











█▄▄
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀
 
███
▀▀▀
███
▀▀▀

███
▀▀▀
███
▀▀▀
███
▀▀▀

███
▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 KENONEW 
 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀█











▄▄█
10,000x
 
MULTIPLIER
██
██
██
██
██
██
██
██

██

██

██

██

██
 
NEARLY
UP TO
50%
REWARDS
██
██
██
██
██
██
██
██

██

██

██

██

██
[/tabl
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!