I have a question regarding the Stellar DEX. My understanding is that the book building and order matching is done by the protocol itself. Orders are placed through APIs such as Stellar X, Stellar Term or others. But what is the sequence once the buy/sell orders have been matched? How work the settlement? Is it still within the protocol or it has to happen on a different platform (with peer to peer interaction?). Apologies, I am a finance guy, no a tech guy, hence have limitations on the code understanding ! Many thanks for your feedback

  • Actually, when you buy/sell assets on SDEX, you buy/sell a Stellar representation of the asset issued by someone (an account). For exemple, you don't buy BTC on SDEX, but a stellar version of BTC. If you want to start using your BTC, you have to withdraw through Stellar BTC issuer (i.e the company who issued your Stellar version of BTC like naobtc.com). The SDEX kept track of the order, so there are proofs that your Stellar public key owns the asset. The withdraw is done off-chain (off Stellar). I'm wondering what's the proof that issuer really owns assets. It seems that buyer must tru – Guillaume Nicolas Mar 5 at 14:45
  • That's correct, there's no way to verify on-chain that the anchor has what they claim to. That's the original motivation behind "trustlines"—to hold an asset, you need to explicitly opt-in and indicate that you trust them. stellar.org/developers/guides/concepts/assets.html#trustlines – Carl Vitullo Mar 5 at 22:07

When a user creates an order, the corresponding amount of the tokens to sell is automatically locked on her balance (the outstanding amount on orders is listed as selling_liabilities on the account properties). Once another user submits a crossing order, a trade is executed automatically. Both users immediately receive bought tokens on their balances.

All DEX components including the orders management, orderbook, matching, and settlement are implemented on the protocol level.

StellarX, StellarTerm, StellarPort, Interstellar and others offer a fancy user interface that simplifies the interaction with the ledger. However, all order manipulations and trades are executed directly on-chain in a form of transactions, so Stellar DEX is truly a decentralized peer-to-peer exchange on the blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.