One of the strongest features of the XRPL is its native decentralized exchange. The DEX lets anyone trade any asset including XRP to any other asset that exists on the network. Anyone can issue assets on the XRPL and if the new asset holds value it can be traded on the DEX.
The decentralized exchange works by combining trade offers into an orderbook. Offers are created by individual wallets and other wallets can choose to accept the offer. These offers can be accepted in full or in part so your offer can be fulfilled by multiple different wallets.
You can read more about the XRPL DEX in our blog.
Creating an offer
Every action on the XRPL is a transaction. In order to create an offer, a transaction is posted that specifies the currencies and amounts that you wish to exchange. Note that every transaction consumes a small amount of XRP (~0,000015 XRP) that is not paid to anyone but burnt.
This creates an offer (also known as open order) on the ledger. The owner reserve rule applies here, so you need sufficient XRP in order to create a new offer.
The following can happen to an offer.
- You can cancel the offer and release the reserved XRP.
- Your offer is accepted by another user (wallet) on the network and the funds are exchanged at the rate specified in the offer.
- Your offer is partially filled by a user who only wants to take you up on a part of your offer.
Partially filled offers
Large offers are usually fulfilled in more than one step if another user does not have the amount necessary to fulfil your offer. An offer stands until it’s completed in full. You can leave it as it is or cancel it at any time, but this will not reverse the completed part of the exchange.
Fees are an integral part of the crypto space because businesses need a way to make a living. Fees are used to prevent attacks on the network and to pay for transactions that need to be processed. There are certain mechanisms that you should know about when it comes to XRPL.
There are XRPL reserves - a "cost" of having an XRPL wallet. Every one of them requires a 10 XRP of "base reserve" to function. Each trust line or open order then takes additional 2 XRP of "owner reserve", which is required by the network.
Transactions cost is not exempt from XRPL. Like most other networks, XRPL also requires some amount to process a transaction. Transactions cost on the XRPL are very low - about 0,000015 XRP. This is a cost you need to pay when doing any action on your wallet. The transaction cost is burnt.
You also have transfer fees and withdrawal fees. Transfer fees are applied to transactions between XRPL wallets if you are transferring anything else than XRP. And a withdrawal fee is applied when making a withdrawal to cover the cost of transactions on the destination network.
For more info on fees, see this article here.
Cancel an offer
You can cancel an offer at any time. Cancelling an offer requires you to post a transaction which costs about 0,000015 XRP. This transaction removes a trade offer and releases the owner reserve (2 XRP) that was previously locked.
On GateHub you can buy crypto very easily by exchanging directly from USD and EUR to Bitcoin (BTC), Ethereum (ETH) and XRP. You can also trade or exchange any currency on the XRPL.
If you wish to exchange assets on your Hosted wallet, you simply select the pair you want to exchange and we’ll perform a swap of funds for you at the current market rate.
On the XRPL, your exchanges go through the XRPL DEX but there’s a special condition. This is achieved through a fillOrKill flag. This specifies that the whole amount needs to be exchanged at once at the specified rate and allows the platform to prevent transactions with a very bad exchange rate from being executed.
Fill or kill order must be filled or killed immediately which simply means the exchange will be executed in full or not at all. The “fill or kill” error means the exchange was not possible or exceptionally unfavourable and usually appears due to lower market liquidity for your chosen pair.
In case this keeps on happening, you can create a market order on trade with your preferred exchange rate or wait for the liquidity to pick up.
If you want to trade an uncommon pair, auto-bridging can help you by using XRP as an intermediary currency. It sells currency for XRP and then buys the wanted currency with those XRP on the right market. This process is automated so you don't have to do anything in order to make it happen. To find out more check out our blog on auto-bridging.