Bitcoin Forum

Bitcoin => Project Development => Topic started by: OmegaStarScream on June 10, 2020, 02:50:17 PM



Title: [Discussion] Building an instant exchange
Post by: OmegaStarScream on June 10, 2020, 02:50:17 PM
I want to create an instant exchange (to make it open source) but I'm not sure about the logic behind this type of exchanges.

My current understanding:

{The exchange runs a full node for both ETH and BTC}

1. User makes a deposit
2. The exchange generate a BTC address for the user to send funds to
3. The user pays
4. The exchange wait until a certain amount of confirmation is reached
5. And then initiate a transaction to the user's ETH address

So basically, your order doesn't have to match someone else's order, you're buying/selling from/to the exchange itself.

But I then came across this post (https://bitcointalk.org/index.php?topic=5252415.msg54547406#msg54547406) and also looked into CoinSwitch  (https://coinswitch.co/app/exchange) and it appears that some instant exchange are buying directly from centralized platforms like Binance, Bittrex, Hitbtc etc. So does that mean that these platforms are running without liquidity to start with? Do they just let you deposit to their addresses, and then they forward them to the exchange, buy the coin and withdraw to your address? I find that hard to believe, but I guess this could easily go unnoticed if an exchange require a high amount of confirmations.

Something else I've noticed is that some platforms tend to have the same trading pairs, which might also prove that they're dealing with certain third parties.

Thanks!


Title: Re: [Discussion] Building an instant exchange
Post by: stompix on June 10, 2020, 03:29:34 PM
So does that mean that these platforms are running without liquidity to start with? Do they just let you deposit to their addresses, and then they forward them to the exchange, buy the coin and withdraw to your address? I find that hard to believe, but I guess this could easily go unnoticed if an exchange require a high amount of confirmations.

Not really, I don't know about all of them but I'm sure at least one of them works like this.

They use a double system, having their own coins in their private wallets and other coins on the exchange.
When you send ETH to the instant exchange wallet, the same time they receive the coins they execute an exchange of ETH>BTC on Binance or Okex or whatever, and then they release your BTC from their own funds. At the end of the day, they deposit or withdraw coins to balance the pairs again and have funds available.







Title: Re: [Discussion] Building an instant exchange
Post by: ActivatedWalnut on June 10, 2020, 04:09:21 PM
Easiest way to implement such a exchange is to use Binance ( or similar ) API to generate deposit address, switch the coins, and withdraw.
And the easiest way to implement something is most likely how they run.


Title: Re: [Discussion] Building an instant exchange
Post by: bob123 on June 11, 2020, 10:02:38 AM
They use a double system, having their own coins in their private wallets and other coins on the exchange.
When you send ETH to the instant exchange wallet, the same time they receive the coins they execute an exchange of ETH>BTC on Binance or Okex or whatever, and then they release your BTC from their own funds. At the end of the day, they deposit or withdraw coins to balance the pairs again and have funds available.

Definitely this.

I can't speak for all of them, but the majority does indeed work like this.
That's the only way to guarantee a specific conversion rate without waiting for a few confirmations where the rate could fluctuate.


Oh, and since you are going to open source it, don't forget to include the random 0.1% chance of having your funds locked due to "security" reasons incl. required KYC to release the funds. Every proper instant exchange needs that.
Code:
if (getRandomNumber(0, 999) == 666):
    lockFunds()
    requestKYC()
   


Title: Re: [Discussion] Building an instant exchange
Post by: cryptoworld99 on June 11, 2020, 08:18:06 PM
Do you want something like https://changelly.com/ ? If yes, I could help you out and guide you for free.



Title: Re: [Discussion] Building an instant exchange
Post by: gesrhon7 on June 21, 2020, 08:51:55 AM
I want to create an instant exchange (to make it open source) but I'm not sure about the logic behind this type of exchanges.

My current understanding:

{The exchange runs a full node for both ETH and BTC}

1. User makes a deposit
2. The exchange generate a BTC address for the user to send funds to
3. The user pays
4. The exchange wait until a certain amount of confirmation is reached
5. And then initiate a transaction to the user's ETH address

So basically, your order doesn't have to match someone else's order, you're buying/selling from/to the exchange itself.

But I then came across this post (https://bitcointalk.org/index.php?topic=5252415.msg54547406#msg54547406) and also looked into CoinSwitch  (https://coinswitch.co/app/exchange) and it appears that some instant exchange are buying directly from centralized platforms like Binance, Bittrex, Hitbtc etc. So does that mean that these platforms are running without liquidity to start with? Do they just let you deposit to their addresses, and then they forward them to the exchange, buy the coin and withdraw to your address? I find that hard to believe, but I guess this could easily go unnoticed if an exchange require a high amount of confirmations.

Something else I've noticed is that some platforms tend to have the same trading pairs, which might also prove that they're dealing with certain third parties.

Thanks!



Hello can you can your exchange also list another coins too?