Cryptocurrency Exchange Technical architecture? How to build it? (Developer Point of View) I'm a softawre developer &amp; newly involved in Blockchain Technology. 


  I need information about How Cryptocurrency Exchange Technically work?
  i.e Buy ETH using BTC or exchanging any coin with another coin etc.


I know all the other terms/things needed for exchange like, Legal, security, KYC, peer to peer etc.

I search many articles but didn't found any technical architecture. found following


  There are readymade API's like block.io, chain.com, blockcypher.com etc who provide such thing.
  but want to develope it from core ie bitcoind Github.



I have good conceptual knowledge of Blockchain, Solidity etc.
Working with Bitcoin Core for creating new address, sending BTC to another address vai CMD prompt.
Able to implement Block Explorer etc.
Able to create new Coin/Currency in Solidity using ETH Compiler.


What I really need is Direction &amp; path to follow.
As the technology is new, resources are very few. Any technical help I really appreciate.

Thank you, Have a great day.
There is opensource asset exchange called Peatio written in ruby. You can look into its source code to see what happens with assets during their lifetime there.

Mainly there are 3 steps for exchange:


Deposit - put real coins to exchange's accounts
Exchange - change coins, by changing just values of accounts' balances
Withdraw - send real coins from exchange's accounts to end user


When user sends deposit request, exchange generates new address (sends rpc request to btc node), and assigns it to deposit entity in db. User have to send sufficient amount of btc, to fulfill deposit. When special daemon watcher finds incoming transaction to the address assigned to some deposit entity, it compares incoming amount with required one and waits for confirmations. If there are enough btcs and confirmations - daemon increases amount of user's account balance.

Then, during user's exchanges, exchange engine just changes numbers in db, so no real transactions are provided. This allows very fast fast and network fee free exchanges.

When user decides to spend bitcoins from account, he sends withdrawal request to exchange. Exchange checks user's balance and if there are enough coins, sends them from its wallet to user's address and decreases user's balance

In such system security of the main server is critical. All coins are stored on wallets of the system and can be spent by it. So cold wallet is usually used in such exchanges. Nearly 90% of total amount of all coins are sent to some secured wallet: hardware wallet or at least wallet, that is stored on a system that doesn't have internet connection. When there is not enough coins on hot wallet to create withdrawal, alert is sent to admin, and he manually sends some coins from cold wallet to hot.

If you don't want to allow trading, and just want exchange, you can remove Exchange step, and create withdrawal just after deposit fulfillment. But then you have to determine price of the pair.

This is not the only approach to asset exchanges. There are also approaches when users control their wallets on exchange, and approaches when decisions to change user's balance are taken by several nodes together.