<p>This "rails application" you would like to create, could be called an "exchange platform". A challenge hereby is to create a secure platform, as you will be taking responsibility for and handling other people's money.</p>

<p>One main difference between exchange platforms is how services facilitate the trade: I am aware of three different <em>modi operandi</em>:</p>

<ol>
<li><p><strong>Service only sells crypto.</strong> (e.g. Coinbase.com)</p>

<ol>
<li>The service offers crypto currency at a given price. </li>
<li>The user accepts the current offer for a specific amount and provides an address where he wants to receive the crypto currency.</li>
<li>The user sends a fiat deposit to the service.</li>
<li>The service waits for the user's payment to clear, then sends the crypto to the user's address.<br>
&nbsp;</li>
</ol></li>
<li><p><strong>Service holds crypto in escrow.</strong> (e.g. Bitcoin.de)</p>

<ol>
<li>User Alice sends a crypto currency deposit to the service.</li>
<li>Alice creates an offer on the service's platform to sell a specific amount of crypto at a certain price.</li>
<li>User Bob accepts Alice's offer.</li>
<li>Bob sends a fiat payment to Alice.</li>
<li>Once Alice receives the payment from Bob, she confirms the payment to the service.</li>
<li>The service sends Alice's crypto currency deposit to Bob, after taking their fees from it.</li>
<li>If something goes wrong, the service mediates the dispute.<br>
&nbsp;</li>
</ol></li>
<li><p><strong>Service holds deposits of all currencies.</strong> (e.g. Bitstamp.net)</p>

<ol>
<li>User Alice sends a crypto currency deposit to the service.</li>
<li>Alice can now create a 

<ul>
<li>sell offer at a specific price (limit order)
Which will remain in the order book until somebody is willing to pay the price she set.</li>
<li>sell immediately at the current price (market order)<br>
Which will match the best buy offers until her order is matched completely.</li>
</ul></li>
<li>Vice versa user Bob sends a fiat deposit to the service.</li>
<li>User Bob can now create a

<ul>
<li>buy offer at a specific price (limit order)
Which will remain in the order book until somebody is willing to sell for the price he set.</li>
<li>buy immediately at the current price (market order)<br>
Which will match the best sell offers until his order is matched completely.</li>
</ul></li>
<li>At any point, Alice and Bob can withdraw their deposits from the service.<br>
You can find a more detailed example at <a href="https://bitcoin.stackexchange.com/a/20759/5406">How do buy and sell orders work?</a></li>
</ol></li>
</ol>

<p>Any of the above should also work for exchanging crypto for crypto.</p>

<hr>

<p>In order to make the complete platform work, you will need:</p>

<ul>
<li>User interface, i.e. a website</li>
<li>User management including fulfillment of local KYC, AML laws</li>
<li>Orderbook</li>
<li>Matching engine</li>
<li>Wallets for any tradable crypto currencies</li>
<li>Cold storage for any tradable crypto currencies</li>
<li>Payment processing for fiat currencies, maybe a banking partner</li>
<li>Customer Service</li>
<li>Legal advice</li>
</ul>

<p>You might also find <a href="https://bitcoin.stackexchange.com/q/18540/5406">What would it take to create my own Bitcoin exchange?</a> helpful, which goes more in-depth on the same topic.</p>

<hr>

<p>Concerning your question for open source Bitcoin exchange software, this question has been answered here: <a href="https://bitcoin.stackexchange.com/q/1447/5406">Is there an open source Bitcoin exchange?</a></p>

CC BY-SA 3.0
2014-05-07T08:37:47.480Z
2014-05-08T09:59:18.723Z
2017-04-13T12:47:33.610Z
Murch
<p>I want to build a rails application to create buy or sell offer for coins. If buy offer is accepted by seller, How the coins exchanged between the buyer and seller. How can it be implemented? What is the sequence of processes to be done in development level. Is there any opensource projects available in Github. I don't want to use other API's such as cryptsy. Can anybody guide me with proper steps as I am a beginner to cryptocoins.</p>

CC BY-SA 3.0
2014-05-02T11:41:35.137Z
Please check http://bitcoin.stackexchange.com/questions/18540/ and http://bitcoin.stackexchange.com/questions/3054/
Joe Pineda
CC BY-SA 3.0
2014-05-06T17:06:44.997Z
What do you want to exchange: Fiat for crypto coins, or crypto coins for other crypto coins? You might find "[How Does trading on the Exchanges Work?](http://bitcoin.stackexchange.com/q/5970/5406)" or "[How do buy and sell orders work?](http://bitcoin.stackexchange.com/a/20759/5406)" interesting as well.
Murch
<transactions><bitcoind><exchanges><trading><currencies>
How accept trade works on creating order
Jsd
# How accept trade works on creating order

(Asked by: username_0 on 2014-04-30)

I want to build a rails application to create buy or sell offer for coins. If buy offer is accepted by seller, How the coins exchanged between the buyer and seller. How can it be implemented? What is the sequence of processes to be done in development level. Is there any opensource projects available in Github. I don't want to use other API's such as cryptsy. Can anybody guide me with proper steps as I am a beginner to cryptocoins.

**Tags:** transactions, bitcoind, exchanges, trading, currencies

> **Comments:**
> **username_1**: Please check http://bitcoin.stackexchange.com/questions/18540/ and http://bitcoin.stackexchange.com/questions/3054/  
> **username_2**: What do you want to exchange: Fiat for crypto coins, or crypto coins for other crypto coins? You might find "[How Does trading on the Exchanges Work?](http://bitcoin.stackexchange.com/q/5970/5406)" or "[How do buy and sell orders work?](http://bitcoin.stackexchange.com/a/20759/5406)" interesting as well.  

---

## 1 answers

### Answer by username_2 on 2014-05-07. Score: 2 | Accepted answer

This "rails application" you would like to create, could be called an "exchange platform". A challenge hereby is to create a secure platform, as you will be taking responsibility for and handling other people's money.

One main difference between exchange platforms is how services facilitate the trade: I am aware of three different *modi operandi*:

1. **Service only sells crypto.** (e.g. Coinbase.com)

   1. The service offers crypto currency at a given price.
   2. The user accepts the current offer for a specific amount and provides an address where he wants to receive the crypto currency.
   3. The user sends a fiat deposit to the service.
   4. The service waits for the user's payment to clear, then sends the crypto to the user's address.
2. **Service holds crypto in escrow.** (e.g. Bitcoin.de)

   1. User Alice sends a crypto currency deposit to the service.
   2. Alice creates an offer on the service's platform to sell a specific amount of crypto at a certain price.
   3. User Bob accepts Alice's offer.
   4. Bob sends a fiat payment to Alice.
   5. Once Alice receives the payment from Bob, she confirms the payment to the service.
   6. The service sends Alice's crypto currency deposit to Bob, after taking their fees from it.
   7. If something goes wrong, the service mediates the dispute.
3. **Service holds deposits of all currencies.** (e.g. Bitstamp.net)

   1. User Alice sends a crypto currency deposit to the service.
   2. Alice can now create a
      * sell offer at a specific price (limit order)
        Which will remain in the order book until somebody is willing to pay the price she set.
      * sell immediately at the current price (market order)  
        Which will match the best buy offers until her order is matched completely.
   3. Vice versa user Bob sends a fiat deposit to the service.
   4. User Bob can now create a
      * buy offer at a specific price (limit order)
        Which will remain in the order book until somebody is willing to sell for the price he set.
      * buy immediately at the current price (market order)  
        Which will match the best sell offers until his order is matched completely.
   5. At any point, Alice and Bob can withdraw their deposits from the service.  
      You can find a more detailed example at [How do buy and sell orders work?](https://bitcoin.stackexchange.com/a/20759/5406)

Any of the above should also work for exchanging crypto for crypto.

---

In order to make the complete platform work, you will need:

* User interface, i.e. a website
* User management including fulfillment of local KYC, AML laws
* Orderbook
* Matching engine
* Wallets for any tradable crypto currencies
* Cold storage for any tradable crypto currencies
* Payment processing for fiat currencies, maybe a banking partner
* Customer Service
* Legal advice

You might also find [What would it take to create my own Bitcoin exchange?](https://bitcoin.stackexchange.com/q/18540/5406) helpful, which goes more in-depth on the same topic.

---

Concerning your question for open source Bitcoin exchange software, this question has been answered here: [Is there an open source Bitcoin exchange?](https://bitcoin.stackexchange.com/q/1447/5406)


---

