Bitcoin Forum
May 27, 2024, 05:11:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Dynamically change prices based on BTC's value  (Read 771 times)
C1D (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
April 14, 2013, 01:20:41 PM
 #1

Hello,
I'm currently working on a JS, PHP and Python program that will change the price of a product on your webiste based on the current price of USD/BTC. Meaning that if your product costs $70 and BTC is at 70/1 (USD to BTC) then your website will display 1 BTC as the price but if it drops to 60/1 (USD to BTC) your website will automatically update the price to 0.857 BTC.
Now before I start working on this, I would like to know if you would use it and if this has been done before.
Thanks,
@_C1D
yucca
Full Member
***
Offline Offline

Activity: 217
Merit: 100



View Profile WWW
April 14, 2013, 01:33:21 PM
 #2

I think bitpay does something similar, well the button displays the $ price, you click it and enter bitpay page where $ price and equivalent BTC price are visible. Maybe they have an option to display dynamic BTC price on merchants site (not sure).

P.S
obviously make the clientside JS as passive as possible, so no chance of someone creating a low BTC value order that is seen as valid by the system.

C1D (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
April 14, 2013, 01:55:45 PM
 #3

Quote
obviously make the clientside JS as passive as possible, so no chance of someone creating a low BTC value order that is seen as valid by the system.
Definitely, the JS Client Side will only display the price not process it; that can be done by the python/php module.
Quote
I think bitpay does something similar, well the button displays the $ price, you click it and enter bitpay page where $ price and equivalent BTC price are visible. Maybe they have an option to display dynamic BTC price on merchants site (not sure).
I think I'm going to build it so individual/lone web stores can also implement that feature, I'm also planning on using it on my own site.
enco
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 14, 2013, 06:15:54 PM
 #4

Ha, I had a similar thought not too long ago and was wondering about the pros and cons Smiley
Not sure if such a feature would be widely adopted since probably most merchants still have to buy the products / services they are offering in other currencies than BTC themselves. So if they accept bitcoins at a real-time exchange rate, they risk losing money if BTC drops in value after the purchase. Especially if they aren't early adopters and haven't already built up some significant BTC deposits to compensate for such a case.
So as I see it, there should at least be the possibility for the merchant to apply some (configurable?) "smoothing" to the exchange rate being used as well as some kind of add-on buffer to compensate for the currency risk. E.g. "current USD/BTC exchange rate plus 15%".
Also, you'd have to find a way not to be dependent on a single exchange like mt.gox for determining the current exchange rate, in case they temporarily go offline once again. Maybe build an average across multiple exchanges? I dunno.

Unless the exchange rate becomes much more stable, I guess this would probably mostly be for the bold or optimistic / idealistic merchants out there, who trust in BTCs mid- to long-term stability. And maybe the primary target group could be those who are offering services with relatively low expenditure in other currencies, such as artists or software developers.
C1D (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
April 16, 2013, 04:07:21 PM
 #5

Quote
Ha, I had a similar thought not too long ago and was wondering about the pros and cons
Not sure if such a feature would be widely adopted since probably most merchants still have to buy the products / services they are offering in other currencies than BTC themselves. So if they accept bitcoins at a real-time exchange rate, they risk losing money if BTC drops in value after the purchase. Especially if they aren't early adopters and haven't already built up some significant BTC deposits to compensate for such a case.
So as I see it, there should at least be the possibility for the merchant to apply some (configurable?) "smoothing" to the exchange rate being used as well as some kind of add-on buffer to compensate for the currency risk. E.g. "current USD/BTC exchange rate plus 15%".
Also, you'd have to find a way not to be dependent on a single exchange like mt.gox for determining the current exchange rate, in case they temporarily go offline once again. Maybe build an average across multiple exchanges? I dunno.

Unless the exchange rate becomes much more stable, I guess this would probably mostly be for the bold or optimistic / idealistic merchants out there, who trust in BTCs mid- to long-term stability. And maybe the primary target group could be those who are offering services with relatively low expenditure in other currencies, such as artists or software developers.
Yes, I was thinking about averaging the price and I'm probably going to do that and my service won't be able to help with the BTC Infulxes and Defluxes and the Client could add the 15% on by them selves. The BTC Ups and Downs can't be helped but they could automatically convert the money they receive to USD using a Bot Server or they would have to bold. I'm defiantly going to be using this in my own site Smiley and If I see a declining pattern I would temporarily close my BTC Price page before the market crashes.
enco
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
April 17, 2013, 01:02:08 PM
 #6

Sounds good, keep us posted Smiley
amiracle2
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
April 17, 2013, 01:12:10 PM
 #7

I don't know about Mtgox, but Btc-e provies it's api. With the api, you can easily pull the latest price of BTC/USD.
bitcento
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
April 17, 2013, 01:13:40 PM
 #8

good iniciative
daemondazz
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
April 17, 2013, 01:16:37 PM
 #9

I don't know about Mtgox, but Btc-e provies it's api. With the api, you can easily pull the latest price of BTC/USD.

They also have a 24h, 7d, 30d average, so you could use the 24h value to handle the smoothing.

Computers, Amateur Radio, Electronics, Aviation - 1dazzrAbMqNu6cUwh2dtYckNygG7jKs8S
C1D (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
April 19, 2013, 04:07:31 PM
 #10

I don't know about Mtgox, but Btc-e provies it's api. With the api, you can easily pull the latest price of BTC/USD.
mtGox provides a free API with out a need for API key and I will be using mtGox and I might also average it with BTC-e.
Quote
Sounds good, keep us posted Smiley
Will do Smiley I've currently finished the PHP version! I will be finishing the Javascript and Python and then post it here (and on the main thread). I may also do a C and Ruby version.
condor335
Copper Member
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
April 19, 2013, 04:10:11 PM
 #11

yeah you go girl. Don't let a man tell you what to do, you just be who you are.
takagari
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000


View Profile
April 19, 2013, 04:10:51 PM
 #12

Super cool idea, as long as it can be used on any value, example Canadian dollar Smiley

Wish someone would write an add-on for Concrete5. lol
Firestarter1
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
April 19, 2013, 04:28:35 PM
 #13

So visit the store and all the prices are changing every 5 sec via long polling.
You should probably add candle chart for clients.
And this shop will be some sort of commodity-currency exchange.

PS If I would be the owner of the shop that would mean that all
The risks are on my side. I would fear the difference between btc value
On the sell moment and btc value on the moment I convert to local currency to
Refill my stock and get profit.

This risk though can be calculated and added to btc value,
But for swinging btc value this percent would be (my guess) so big
So clients would prefer buying ...hmm... Medicine.. From local dealer twice cheaper.
nebulus
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


... it only gets better...


View Profile
April 19, 2013, 04:43:45 PM
 #14

I has been done

C1D (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
April 19, 2013, 07:08:01 PM
 #15

yeah you go girl. Don't let a man tell you what to do, you just be who you are.
Yea.. Im not a girl -______-.
Quote
So visit the store and all the prices are changing every 5 sec via long polling.
You should probably add candle chart for clients.
And this shop will be some sort of commodity-currency exchange.

PS If I would be the owner of the shop that would mean that all
The risks are on my side. I would fear the difference between btc value
On the sell moment and btc value on the moment I convert to local currency to
Refill my stock and get profit.

This risk though can be calculated and added to btc value,
But for swinging btc value this percent would be (my guess) so big
So clients would prefer buying ...hmm... Medicine.. From local dealer twice cheaper.
It would have to be converted the second the transaction goes though and the client can chose long polling or to leave it at that and once the transaction is sent to the backend PHP will display the amount at that second. The shop can also add a risk fee (eg 15% increase) so that the BTC influxes will not hurt their profit.
Quote
I has been done
Please provide proof.
Quote
Super cool idea, as long as it can be used on any value, example Canadian dollar

Wish someone would write an add-on for Concrete5. lol
Verison 1 will be USD only but hopefully I will add Australian and Canadian Dollar.
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!