Bitcoin Forum
October 23, 2017, 06:42:20 AM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: What currency exchange should be?  (Read 296 times)
vasssya.com
Newbie
*
Offline Offline

Activity: 1


View Profile
July 25, 2013, 01:01:54 PM
 #1

Hi, everyone. I Ruby/Rails programmer and decide try for fun implement currency exchange, and maybe it becomes something useful in future.

First of all,  I decide to make most simple implementation. I show my algorithm in 3 examples:

First:

User1: I want to buy 10 BTC for 1000 USD
User2: I want to buy 1000 USD for 10 BTC

It'll matched and money pass through accounts.

Second:

User1: I want to buy 10 BTC for 2000 USD (bid1)
User2: I want to buy 1000 USD for 9 BTC (bid2)

Bid2 will be closed. User2 get 1000 USD and give 9 BTC.
Bid1 will looks like: I want to by 1 BTC for 1000 USD. User1 get 9 BTC and give 1000 USD.

Third:

User1: I want to buy 1 BTC for 1000 USD (bid1)
User2: I want to buy 100 USD for 1 BTC (bid2)

Both will be closed. User1 get 1 BTC and give 1000 USD. User2 get 100 USD and give 1 BTC.

900 USD "disapears". For now I call it a feature - spread, which exchange earns.

You can't delete or undo your bids. If your not have enough funds it will marked as "bad" bid and never be proccessed.

Code is open under GPLv2 and avalible on GitHub https://github.com/vasssya/sunrise

Demo http://vasssya.com/ (no ads, no profit, only app). Every new user get demo money: BTC, USD and EUR and can try to trade.

Ideas, thoughts, what implement next? Where to move?

Thanks for attention.




 
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!