Bitcoin Forum
April 24, 2018, 01:32:39 AM *
News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: What currency exchange should be?  (Read 307 times)
Offline Offline

Activity: 1
Merit: 0

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

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:


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.


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.


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

Demo (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]
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!