Bitcoin Forum

Economy => Exchanges => Topic started by: wsxdrfv on April 12, 2018, 03:07:23 AM



Title: How exchange's BTC/altcoin market works?
Post by: wsxdrfv on April 12, 2018, 03:07:23 AM
If user A deposit 1 bitcoin to some exchange, EX.

Then A buy 1000 Xcoin by 1 btc, then he sees his deposit become 0 btc and 1000 Xcoin.
At this time, where actually his 1 btc gone? To EX's bitcoin wallet? But originally A's bitcoin deposit address is EX's wallet's address, right?

Then can A send BTC to its own EX's wallet? This become self send BTC to self, right? Is that possible? How implement this?



Title: Re: How exchange's BTC/altcoin market works?
Post by: hugeblack on April 12, 2018, 05:26:12 AM
All that happens is that you have a central database running in the background and sync it with a bitcoin wallet using json to send commands to daemons and get a response back.
When a user creates an account, he gets a wallet address linked to his account. After making deposit, all that happens is a change in the data values of the central database.
Then A buy 1000 Xcoin by 1 btc, then he sees his deposit become 0 btc and 1000 Xcoin.
This means that your data in the central database is 0 btc and 1000 Xcoin

where actually his 1 btc gone?
exchange site wallet (they have the private key)

For more read
How Changelly works (https://changelly.com/blog/how_changelly_suggests_the_best_exchange_rates/)
How does Exodus wallet (or other wallet) exchange bitcoin to other cryptocurrency (https://bitcoin.stackexchange.com/questions/65062/how-does-exodus-wallet-or-other-wallet-exchange-bitcoin-to-other-cryptocurrenc)
https://github.com/AdamCox9/nickelbot (https://github.com/AdamCox9/nickelbot)


Title: Re: How exchange's BTC/altcoin market works?
Post by: nc50lc on April 12, 2018, 05:44:27 AM
In simple words, exchanges aren't using any coins' blockchain in the trades within the platform, they're only displaying the balances and trades "visually" not on-chain... in exception to withdrawals.

At this time, where actually his 1 btc gone? To EX's bitcoin wallet? But originally A's bitcoin deposit address is EX's wallet's address, right?
It will stay in that BTC address if they didn't already moved the balance. | Yes

To understand this, in your own wallets (ex. core or electrum), you have the total control over the private keys of your addresses.
In exchanges, they are only giving you the address (they have the PrivKey) which they issue when you want to deposit your funds that will be "recorded" to their database as your balance.
After that, they can move the funds from that address whenever they want, however, it will not affect your displayed balance in your exchange account.

You can check this your own by checking your deposit address in any blockexplorer like blockchain.info.
You will notice that sometimes the balance is still there even if you already traded your Bitcoins.