Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: zander1983 on December 27, 2022, 03:53:37 PM



Title: Funding a non-custodial exchange?
Post by: zander1983 on December 27, 2022, 03:53:37 PM
Hi
Im developing a Bitcoin exchange as a way to learn Bitcoin development. I have a node running, and an integration with Stripe to acquire fiat (USD, GBP and EUR) from users. Users provide a Bitcoin address so there is no storing of their keys.

Im guessing the next part - were I to actually go live with it - would be to bulk buy Bitcoin, work out a conversion rate between the fiat and this Bitcoin, and dole this out to users as they buy?

Or is there some API service to buy Bitcoin on-the-fly?

Thanks


Title: Re: Funding a non-custodial exchange?
Post by: jackg on December 27, 2022, 05:12:51 PM
I think there's likely a way to convert fiat to usdc but I don't think there's one where you can link a random user to an exchange without paying a fee (because they'd be providing the same service as you).

There's then the possibility of using systems already in defi like liquidity pools if your hypothetical exchange was considering allowing users to put up funds (on the chance the you didn't have the provisions for it). I'm assuming stripe has an api so you can confirm when a deposit has happened though.

I've been thinking about how an exchange could be made too and I don't think you'd need to "bulk" buy bitcoin necessarily as you could keep an amount of stock and provide for more later on when the initial has been taken - it generally fast to buy bitcoin either otc or via an exchange (otc is especially fast with cash deposits). 


Title: Re: Funding a non-custodial exchange?
Post by: n0nce on December 27, 2022, 06:31:44 PM
Or is there some API service to buy Bitcoin on-the-fly?
There are APIs for that, but at that point you just become a middle-man, a mere front-page between customers and an existing exchange in the backend.
That introduces issues like heavy dependence on the service's uptime, ToS, questions about their privacy policy and more. The 'backend exchange' (Binance, etc.) will also have to make a profit on this as opposed to serving the customer directly, meaning you will have to offer worse rates.


Title: Re: Funding a non-custodial exchange?
Post by: zander1983 on December 27, 2022, 08:20:42 PM
Or is there some API service to buy Bitcoin on-the-fly?
There are APIs for that, but at that point you just become a middle-man, a mere front-page between customers and an existing exchange in the backend.
That introduces issues like heavy dependence on the service's uptime, ToS, questions about their privacy policy and more. The 'backend exchange' (Binance, etc.) will also have to make a profit on this as opposed to serving the customer directly, meaning you will have to offer worse rates.

Yeah I understand that. Companies like Strike and Swan use Prime Trust, but add value elsewhere as I'd like to do. However Im informed on another thread Prime Trust only deal with companies with large volumes.

If I was to do it myself, how would I do this? Bulk buy Bitcoin on decentralised exchanges and dole that out?


Title: Re: Funding a non-custodial exchange?
Post by: zander1983 on December 27, 2022, 08:22:54 PM
I think there's likely a way to convert fiat to usdc but I don't think there's one where you can link a random user to an exchange without paying a fee (because they'd be providing the same service as you).

There's then the possibility of using systems already in defi like liquidity pools if your hypothetical exchange was considering allowing users to put up funds (on the chance the you didn't have the provisions for it). I'm assuming stripe has an api so you can confirm when a deposit has happened though.

I've been thinking about how an exchange could be made too and I don't think you'd need to "bulk" buy bitcoin necessarily as you could keep an amount of stock and provide for more later on when the initial has been taken - it generally fast to buy bitcoin either otc or via an exchange (otc is especially fast with cash deposits). 

What do you mean by "keep an amount of stock and provide for more later on when the initial has been taken"? And also what does "otc" mean?

Thanks


Title: Re: Funding a non-custodial exchange?
Post by: n0nce on December 28, 2022, 12:59:52 PM
If I was to do it myself, how would I do this? Bulk buy Bitcoin on decentralised exchanges and dole that out?
Yes; also keep in mind people may sell BTC through you; if you had equal amounts of sellers and buyers, your supply would even remain relatively constant.
If you only sell BTC, you will obviously need to buy more periodically.

And also what does "otc" mean?
I guess 'over the counter';
Over-the-counter (OTC) or off-exchange trading or pink sheet trading is done directly between two parties, without the supervision of an exchange. It is contrasted with exchange trading, which occurs via exchanges. A stock exchange has the benefit of facilitating liquidity, providing transparency, and maintaining the current market price. In an OTC trade, the price is not necessarily publicly disclosed.


Title: Re: Funding a non-custodial exchange?
Post by: DaveF on December 28, 2022, 02:32:41 PM
If I was to do it myself, how would I do this? Bulk buy Bitcoin on decentralised exchanges and dole that out?

More or less yes.
But, remember at that point you are going to be fully responsible for all your funds. If you buy 2BTC today @ $16500 and it drops to $15500 you are either going to be selling to people at a loss or not selling waiting for the market to go back up. Do you have the funds to wait?

There are a bunch of non KYC, P2P exchanges that are out there so you are going to have to compete with them also. Can you work on margins that thin?

-Dave


Title: Re: Funding a non-custodial exchange?
Post by: jackg on December 29, 2022, 02:37:07 AM
What do you mean by "keep an amount of stock and provide for more later on when the initial has been taken"? And also what does "otc" mean?

Thanks

Don't hold too much crypto, especially on online wallets.

It's fast and easy to replenish stock, there's not a great need to keep buying more of you don't have the finances for it until your initial has dropped by quite a bit.

Otc is over the counter trading (ie getting an entity to trade with you at a set price rather than doing a market buy). It just means don't buy off exchanges, find other sources as they should be more reliable (especially if you have multiple).


Title: Re: Funding a non-custodial exchange?
Post by: Ryker1 on December 29, 2022, 10:07:31 AM
[snip]
Otc is over the counter trading (ie getting an entity to trade with you at a set price rather than doing a market buy). It just means don't buy off exchanges, find other sources as they should be more reliable (especially if you have multiple).
Interesting --this is how crypto OTC desks work and perhaps OP will understand it more.
[ https://medium.com/circle-research/how-does-crypto-otc-actually-work-e2215c4bb13 ]
It seems that OP what looking for which seems trying to compete with this kind of service. But one thing that I saw is some serious problems that you will experience OP --this OTC trading cannot be automated by using an API just like an exchange platform, the same as mentioned above, it could have more terrible fees than the regular exchange which seems worst. The last one is, it is good for large-scale traders, not small-scale traders.

Here is a link if you will need OTC brokers where to connect API.
[ https://www.sfox.com/blog/13-bitcoin-otc-brokers-you-need-to-know/ ]