How users currency accounts address are updated during currency trading on Exchanges like Coinbase and Binance? - bitcoin

My naive understanding behind how currency trading works on Exchanges like Binance and Coinbase is each users are provided with unique address and when the respective currencies trade happens on exchanges like Binance or Coinbase, both the parties accounts get's updated live on blockchain.
To elaborate more, In case of ETH/BTC trading, let's say, Mr Foo wants to trade his ETH with Mr Bar's BTC on Binance exchange. Binance will provide both of them with unique address respectively to their currency. So when the ETH/BTC trade take place, Mr Foo will receive the BTC on his newly generated unique BTC address and Mr Foo's ETH account will be deducted . On the other side, Mr Bar's BTC account will be deducted and Ether account is updated with newly received ether.
I'm really confuse regarding whether these currency trading on exchanges execute live on Blockchain? Recently during Bitcoin and Ethereum network congestion, I did BTC/ETH trading on HITBTC, the process happened instantaneously, but I've to wait for hours during withdrawal process. Also Hitbtc seems to be using same Ethereum account (0x65e2c5175e2e618f48e70343b14c31b280e42d90) to transfer fund during withdraw request for multiple users. It seems that these exchanges are using the same address for serving multiple users.
Could somebody explain how users accounts are updated during currency trading on exchanges like Coinbase and Binance? Does trading immediately happens live on blockchain? Or Exchanges only shows the users with fake trading balances until it's withdrawn? Do the Exchanges use same address to accept deposits from multiple users?
Thank you for your time.

Check out this thread for a brief explanation of Coinbase's order management.
Answer on the reddit thread, supposedly from a coinbase insider.
In addition, my comment above was just based on intuition and my general knowledge of the way brokers work.
Brokers
Brokers tend to match orders first since they are in the business of exchanging, not investing. Meaning they make their most consistent revenue from fees generated by facilitating customer orders, not by investing in the securities or assets that they help to buy/sell.
Sometimes in order to fulfill an order the broker will go long or short a particular asset class, in this case bitcoin or ethereum, etc. If this happens the broker is exposed to fluctuations in the price of that asset against the asset they are trying to grow (cash).
Now, since Coinbase is heavily involved in crypto it might be part of their strategy to hold Bitcoin or Ethereum inventory, but I would doubt it would figure much since that would undermine public trust in their institution as an impartial exchange. No one really likes to hear their broker bet against them, it tends to engender resentment.
Technicals
Coinbase is setup as a software wallet, meaning you have an account, with the private keys stored on their server. So it is possible for them to facilitate some of the trading between bitcoin accounts without ever having to match orders with an account holder outside their system.
Meaning, they can collect/match/fill the orders in batches and then submit those batches to bitcoin miners. This would allow them to quickly "fulfill" your order, and then send you verification once it has been posted to the blockchain.
Further Reading
Although it is not specifically geared towards crypto exchanges there is an excellent book on the subject of how markets actually function.
Market Microstructure in Practice

Related

Can bigger exchanges act as a proxy wallet to smaller exchanges

is there chance that Coinbase or any wallet can be used as a proxy wallet i.e a smaller exchange stores its retail clients assets on Coinbase custody but when withdrawals are made by a retail client it is processed by an api and sent from custody directly to the clients wallet
can this be achieved?
Complex, but anything is possible. You can program a login system, and depending on who logs in, a different function in the code is executed, and the books of each client's amounts would also have to be kept and integrated into the code, and the client must not have access to alter the core coding. Maybe use python?
You can already use Coinbase's API to make withdrawals to a wallet. Withdrawals via API exist for most exchanges.
https://developers.coinbase.com/api/v2#withdrawals
https://docs.pro.coinbase.com/?python#list-withdrawals

How many Bitcoin addresses can I generate through Coinbase API?

I use Coinbase API to generate Bitcoin addresses.
What are the limits of this API?
How many Bitcoin addresses can I generate?
The API says that:
The Coinbase API is rate limited to prevent abuse that would degrade our ability to maintain consistent API performance for all users. By default, each API key or app is rate limited at 10,000 requests per hour. If your requests are being rate limited, HTTP response code 429 will be returned with an rate_limit_exceeded error.
So I would reason to assume you can generate 10,000 BTC addresses per hour. Of course there might be somewhere else it has been mentioned.
API docs say it is unlimited for each account.
Address resource represents a bitcoin, bitcoin cash, litecoin or ethereum address for an account. Account can have unlimited amount of addresses and they should be used only once.
This text is taken from the official api docs (link down below) on date 04-02-2020
https://developers.coinbase.com/api/v2#addresses

Bitcoin transaction verification process

I am building and app which will offer payment in bitcoins. I know that when I send bitcoin from one address to another it can be tracked by blockain API to verify the transaction. After receiving some assets I want to send some assets back. The customer will have an input field where he will paste his deposit wallet address. I am subscribed to blockchain API to track received assets to my bitcoin address. How can I verify that the payment was made by certain customer? Checking his address doesn't seem to solve the problem because if customer uses wallets like Coinbase, Bitstamp etc. transaction is made from multiple addresses.
A few helpers here:
What you need to do is to generate a new address and give it to your customer. This way you can uniquely identify him
Wait for confirmation before making the decision. Just because you see a transaction, does not mean you have the money. You need to wait for a few blocks and several (>6) confirmations

Sms delivery fail, but money still charged

Can any body explain why sms gateways take money on fail delivery?
Yes i understand that sometimes confirm that sms was delivered its hard but even if services says cant deliver it still take money.
Because then they are not loosing money and why to hurry up? I used when when they answered to me after one week. After one week they answered why sms was not delivered.
As part of question would be how to deal with that because now i see only one option to use two different services and track if user try to send sms twice and account is not confirmed then use other service as previous
The way these services work is that they incur cost on every SMS sent, even if not delivered. Do note that in most of the cases, this is not the telecom provider's cost, as that is pretty minimal because of the bulk purchases these services do. It is more of the cost of their entire infrastructure etc. in sending out that SMS.
To put it in perspective, take case of email service providers. They also charge based on number of emails sent, irrespective of whether the emails are actually delivered or not.
And to minimize this cost, you need to try a few services to see which one has the best data bank of numbers that have least non-delivery rate.

Payment Gateway process

I have to integrate a payment gateway in my web app. I am negotiating with PGs to get most suitable offer. Most of them have:
Setup Fees
Annual/Monthly Fees.
Per Transaction Fees (1%-5%)
Rule of thumb is- Higher the setup fees, lower Transaction Fees.
My question here is "Are payment gateways compulsory?" I have used several sites like ebay, flipkart, amazon etc which take credit card info directly on their portal, authorizing it directly from bank, bypassing 3rd party payment gateways. (This is how it seems.)
What happens behind the scenes here? What is the process to directly accept payments and authorize it from bank?
What tentative transaction volume is needed to make the above scenario profitable?
I used to work for bluesnap (previously called Plimus) which is an on-line payment-processing company. A payment-processing company - is a company that authorizes and charges the credit-card against the processing gateways.
Many people confuse payment-processing companies with processing gateways. As a small business you can either use one of the payment-processing companies or use self-service such as Authorize.net, Paypal etc.
There are plenty of resources over the web that explain about payment-processing but I don't think that it will be very interesting to read, unless you decide to build your own gateway...
In order to work directly against one of the gateways you need to process millions of transactions per day - which I don't believe you have the capacity.