Decentralized Exchange (2024)

Last updated

Edit

The XRP Ledger has possibly the world's oldest decentralized exchange (sometimes abbreviated "DEX"), operating continuously since the XRP Ledger's launch in 2012. The exchange allows users to buy and sell tokens for XRP or other tokens, with minimal fees charged to the network itself (not paid out to any party).

Caution: Anyone can issue a token with any currency code or ticker symbol they want and sell it in the decentralized exchange. Always perform due diligence before buying a token, and pay attention to the issuer. Otherwise, you might give up something of value and receive worthless tokens in exchange.

Structure

The XRP Ledger's decentralized exchange consists of an unlimited number of currency pairs, tracked on-demand when users make trades. A currency pair can consist of XRP and a token or two different tokens; tokens are always identified by the combination of an issuer and a currency code. It is possible to trade between two tokens with the same currency code and different issuers, or the same issuer and different currency codes.

As with all changes to the XRP Ledger, you need to send a transaction to make a trade. A trade in the XRP Ledger is called an Offer. An Offer is effectively a limit order to buy or sell a specific amount of one currency (XRP or a token) for a specific amount of another. When the network executes an Offer, if there are any matching Offers for the same currency pair, they are consumed starting with the best exchange rate first.

An Offer can be fully or partially filled; if it's not fully filled right away, it becomes a passive Offer object in the ledger for the remaining amount. Later on, other Offers or Cross-currency payments can match and consume the Offer. Because of this, Offers can execute at better than their requested exchange rate when initially placed, or at exactly their stated exchange rate later on (aside from minor differences to account for rounding).

Offers can be manually or automatically canceled after being placed. For details on this and other properties of Offers, see Offers.

When trading two tokens, auto-bridging improves exchange rates and liquidity by automatically trading token-to-XRP and XRP-to-token when doing so is cheaper than trading directly token-to-token.

Example Trade

Consumed Offersare removedfrom the orderbook.Tran places an Offer to buy 100FOO issued by WayGate, byspending up to 1000 XRP.78 FOO for 780 XRP0.1......TranOwnerAmountOrder Book: FOO.WayGate:XRPExchange Rate...20.0≥20...DavidOwnerAmountOrder Book: XRP:FOO.WayGateExchange Rate...20000 XRP for 1000 FOOThe owners of thematching Offersreceive a total of 31XRP from Tran.0.50.6674.020.0≥20...OmarDavidOmarBradAmyDavidAmyBradOwnerAmountOrder Book: XRP:FOO.WayGateThe remainder of Tran'sOffer is added to theopposite order book at itsoriginal exchange rate.Tran receives atotal of 22FOO.WayGate fromthe other traders.TranTranExchange RateThese Offersmatch becausetheir exchangerates are equalor better....20 XRP for 5 FOO20000 XRP for 1000 FOO10 XRP for 15 FOO1 XRP for 2 FOOOfferBuy: 100 FOO.WayGateSpend: 1000 XRP(Exchange rate: 10.0 XRP/FOO.WayGate)

The above diagram shows an example trade in the decentralized exchange. In this example, a trader named Tran places an Offer to buy 100 tokens with the currency code FOO issued by a fictional business called WayGate. (For brevity, "FOO.WayGate" refers to these tokens.) Tran specifies that he is willing to spend up to 1000 XRP for the full total. When Tran's transaction is processed, the following things happen:

  1. The network calculates the exchange rate of Tran's Offer, by dividing the amount to buy by the amount to pay.
  2. The network finds the order book for the reverse of Tran's Offer: in this case, that means the order book for selling FOO.WayGate and buying XRP. This order book already has several existing Offers from other traders for varying amounts and exchange rates.
  3. Tran's Offer "consumes" matching Offers, starting with the best exchange rate and working its way down, until either Tran's Offer has been fully filled, or there are no more Offers whose exchange rate is equal or better than the rate specified in Tran's Offer. In this example, only 22 FOO.WayGate are available at the requested rate or better. The consumed Offers are removed from the order book.
  4. Tran receives the amount of FOO.WayGate that the trade was able to acquire, from the various traders who had previous placed orders to sell it. These tokens go to Tran's trust line to WayGate for FOO. (If Tran did not already have that trust line, one is automatically created.)
  5. In return, those traders receive XRP from Tran according to their stated exchange rates.
  6. The network calculates the remainder of Tran's Offer: since the original Offer was to buy 100 FOO.WayGate and so far Tran has received 22, the remainder is 78 FOO.WayGate. Using the original exchange rate, that means that the rest of Tran's Offer is now to buy 78 FOO.WayGate for 780 XRP.
  7. The resulting "remainder" gets placed onto the order book for trades going the same direction as Tran's: selling XRP and buying FOO.WayGate.

Later transactions, including ones executed immediately after Tran's in the same ledger, use the updated order books for their trades, so they can consume part or all of Tran's Offer until it's fully filled or Tran cancels it.

Note: The canonical order transactions execute in when a ledger is closed and validated is not the same as the order those transactions were sent. When multiple transactions affect the same order book in the same ledger, the final results of those transactions may be very different than the tentative results calculated at the time of transaction submission. For more details on when transactions' results are or are not final, see Finality of Results.

Limitations

The decentralized exchange is designed with the following limitations:

Because trades are only executed each time a new ledger closes (approximately every 3-5 seconds), the XRP Ledger is not suitable for high-frequency trading. The order transactions execute within a ledger is designed to be unpredictable, to discourage front-running.

The XRP Ledger does not natively represent concepts such as market orders, stop orders, or trading on leverage. Some of these may be possible with creative use of custom tokens and Offer properties.

As a decentralized system, the XRP Ledger does not have any information on the actual people and organizations behind the accounts involved in trading. The ledger itself cannot implement restrictions around who can or cannot participate in trading, and users and issuers must take care to follow any relevant laws to regulate trading tokens that represent various types of underlying assets. Features such as freezes and authorized trust lines are intended to help issuers comply with relevant laws and regulations.

See Also

  • Concepts:
    • See Offers for details on how trades work in the XRP Ledger.
    • See Tokens for an overview of how various types of value can be represented in the XRP Ledger.
  • References:
    • account_offers method to look up Offers placed by an account
    • book_offers method to look up Offers to buy or sell a given currency pair
    • OfferCreate transaction to place a new Offer or replace an existing Offer
    • OfferCancel transaction to cancel an existing Offer
    • Offer object for the data structure of passive Offers in the ledger
    • DirectoryNode object for the data structure that tracks all the Offers for a given currency pair and exchange rate.
  • Offers
  • Auto-Bridging
  • Tick Size
  • Automated Market Makers

Previous page

Next page

Decentralized Exchange (2024)

FAQs

What is a decentralized exchange? ›

A DEX (decentralized exchange) is a peer-to-peer marketplace where users can trade cryptocurrencies in a non-custodial manner without the need for an intermediary to facilitate the transfer and custody of funds.

Is decentralized crypto exchange safe? ›

Decentralized exchanges (DEXs) allow users to retain control of their funds through non-custodial wallets, but users must take personal responsibility for security. Security: CEXs, despite their security measures, are vulnerable to large-scale hacks due to the concentration of funds.

What is the main advantage of a decentralized exchange? ›

One of the fundamental benefits of decentralized exchanges is that users have custody of their assets. In other words, you do not have to transfer your assets to any third party. Hence, the level of risk from malicious actors such as cybercriminals is low.

Is Coinbase a decentralized exchange? ›

Coinbase is a centralized exchange. The exchange is owned and operated by a centralized entity — Coinbase Global, Inc.

How does a dex make money? ›

Transaction Fee Revenue: Similar to centralized exchanges, DEXs earn revenue by charging transaction fees. However, DEXs typically offer lower fees due to the absence of intermediary costs, attracting a larger user base. These fees support the operational and developmental needs of the DEX.

Are decentralized exchanges legal in the USA? ›

Due to regulations written into law with the Build Back Better Act, decentralized exchanges that fail to comply with these policies may not be allowed to operate in the United States. It's possible that decentralized exchanges will need to introduce KYC policies to comply with reporting requirements.

What are the top 5 decentralized coins? ›

Top Decentralized Finance (DeFi) Coins Today By Market Cap
#NameMarket Cap
1Lido Staked Ether ( STETH )$22.62B
2Chainlink ( LINK )$6.30B
3Dai ( DAI )$5.08B
4Uniswap ( UNI )$5.03B
40 more rows

How much is decentralized exchange? ›

The Decentralized Exchange (DEX) market cap today is $14.20B, which reflects a +0.18% daily change.

Can a decentralized exchange be hacked? ›

A decentralized and non-KYC crypto exchange was hacked. FixedFloat, a known option to exchange bitcoin and several cryptocurrencies in a decentralized and pseudonymous way, lost over $26 million in an alleged hack, according to their team. Financial losses from this incident include 409 BTC BTC and 1,728 ETH.

Can a decentralized wallet be hacked? ›

The concepts behind blockchain technology make it nearly impossible to hack into a blockchain. However, weaknesses outside of the blockchain create opportunities for thieves. Hackers can gain access to cryptocurrency owners' cryptocurrency wallets, exchange accounts, or the exchanges themselves.

What crypto is actually decentralized? ›

In Bitcoin's case, the blockchain is decentralized, so no single person or group has control—instead, all users collectively retain control.

Why do we want decentralized currency? ›

A decentralized currency reduces reliance on centralized financial institutions, enabling peer-to-peer transactions. By removing these intermediaries, transaction costs decrease, efficiency improves, and financial freedom expands. This paves the way for a more inclusive and accessible global financial system.

Which is better centralized or decentralized exchange? ›

Centralized cryptocurrency exchanges usually have higher trading volumes than DEX platforms. Global CEX trading volumes are valued at billions of dollars every month. Decentralized platforms also have high trading volumes, but these can fluctuate rapidly because of low liquidity and market volatility.

What is a decentralized stock exchange? ›

Decentralized exchanges, also called DEXs, are cryptocurrency marketplaces that allow traders to make autonomous peer-to-peer transactions without the need for a third party. Instead, self-executing smart contracts are used to facilitate transactions - giving users full control over their funds.

What is decentralized in simple words? ›

Decentralization is the process of shifting control from one main group to several smaller ones. The decentralization of government, for example, gives more power to the individual states, rather than concentrating it at the federal level.

What are the disadvantages of decentralized exchanges? ›

Decentralized exchanges (DEXs) have several potential disadvantages, including:
  • Lower Liquidity. ...
  • Higher Fees. ...
  • Less User-friendly. ...
  • Peculiar Security Concerns.

What are decentralized exchanges for dummies? ›

A crypto decentralized exchange (DEX) is an app for trading cryptocoins where coin exchange occurs via smart contracts without using a centralized trading system. Users mostly access DEX either through a web browser or via smartphone apps. DEX does not store users' funds or administers transactions.

Top Articles
The four-factor model of product design: scale development and validation
Lawful excuse Definition | Legal Glossary | LexisNexis
Worcester Weather Underground
Room Background For Zepeto
Seething Storm 5E
How to Type German letters ä, ö, ü and the ß on your Keyboard
Guardians Of The Galaxy Vol 3 Full Movie 123Movies
Rapv Springfield Ma
Local Dog Boarding Kennels Near Me
Cooking Fever Wiki
Nwi Arrests Lake County
Rhinotimes
Palm Coast Permits Online
Vintage Stock Edmond Ok
Craigslist Missoula Atv
Promiseb Discontinued
Jail View Sumter
Exl8000 Generator Battery
Wics News Springfield Il
Watch Your Lie in April English Sub/Dub online Free on HiAnime.to
Ficoforum
Dmv In Anoka
Harrison County Wv Arrests This Week
Papa Johns Mear Me
Meta Carevr
Tinyzonehd
Xxn Abbreviation List 2023
2021 Tesla Model 3 Standard Range Pl electric for sale - Portland, OR - craigslist
Myaci Benefits Albertsons
2430 Research Parkway
Chase Bank Cerca De Mí
Maybe Meant To Be Chapter 43
SOC 100 ONL Syllabus
Wal-Mart 2516 Directory
Labyrinth enchantment | PoE Wiki
5 Tips To Throw A Fun Halloween Party For Adults
Dee Dee Blanchard Crime Scene Photos
Vocabulary Workshop Level B Unit 13 Choosing The Right Word
2700 Yen To Usd
Andrew Lee Torres
Vons Credit Union Routing Number
Vindy.com Obituaries
Hovia reveals top 4 feel-good wallpaper trends for 2024
Rush Copley Swim Lessons
Patricia And Aaron Toro
Zeeks Pizza Calories
The Cutest Photos of Enrique Iglesias and Anna Kournikova with Their Three Kids
Human Resources / Payroll Information
San Diego Padres Box Scores
Minecraft Enchantment Calculator - calculattor.com
Lux Nails & Spa
Latest Posts
Article information

Author: Roderick King

Last Updated:

Views: 6090

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Roderick King

Birthday: 1997-10-09

Address: 3782 Madge Knoll, East Dudley, MA 63913

Phone: +2521695290067

Job: Customer Sales Coordinator

Hobby: Gunsmithing, Embroidery, Parkour, Kitesurfing, Rock climbing, Sand art, Beekeeping

Introduction: My name is Roderick King, I am a cute, splendid, excited, perfect, gentle, funny, vivacious person who loves writing and wants to share my knowledge and understanding with you.