Module: "Trading Actions"
The module description and pricing information are available via this link.
When trading on an exchange, discrepancies may occur due to cryptocurrency price fluctuations during the execution of a trade. To mitigate this, it’s essential to maintain a small reserve for each cryptocurrency to cover the difference between the price at the time of placing the order and the price at the time of execution.
To avoid such discrepancies, follow these steps:
Set up a small reserve for each cryptocurrency you trade. For example, the reserve could be 0.003 BTC.
Regularly monitor the reserve size and replenish it as needed.
Example:
Let’s say you want to buy 1 BTC. At the time of placing the order, the price of Bitcoin is $50,000. However, by the time the trade is executed, the price may have changed to $50,009. In this case, the discrepancy is $9. If you have a reserve of 0.003 BTC, this difference will be covered.
Important:
The size of the reserve required to cover discrepancies depends on the trade size and the cryptocurrency’s volatility.
The purpose of the trading module is to fully automate the process of executing orders and recording current exchange rates, whether cryptocurrencies are present in your portfolio or not.
There are two main types of trading actions:
Selling cryptocurrency via an order.
Buying cryptocurrency via an order.
Each of these actions can be divided into two scenarios:
Selling cryptocurrency via an order when it is available in your portfolio.
Buying cryptocurrency via an order when the currency used for the purchase is available in your portfolio.
and
Selling cryptocurrency via an order when it is not available in your portfolio.
Buying cryptocurrency via an order when the currency used for the purchase is not available in your portfolio.
This categorization allows for a more detailed description of various trading scenarios.
Selling Cryptocurrency
When selling or buying cryptocurrency via an order, and the required currency is available in your portfolio, the process is simpler and more efficient. In this case, the automated trading system operates as follows:
The client creates an order and receives a payment address from the merchant.
The client makes the payment (you can also configure rate recalculation at the time of payment, which is crucial for locking in the rate and ensuring a stable profit margin for the order). The system then automatically sells the cryptocurrency on the exchange from your portfolio.
After the cryptocurrency is sold, the client receives the corresponding amount, and the system records the current rate at the time of payment.
The system then transfers the funds to the exchange and continues the process.
This method minimizes risks and ensures a more stable profit margin for the order, as the rate is locked in at the time of payment. Additionally, optimizing fund transfers between the exchange and wallets reduces fees and increases trading efficiency.
But what if you don’t have Bitcoin in your portfolio and only have USDT? In this case, a margin account on the exchange comes to the rescue. The steps described above remain the same. However, since you don’t have BTC in your portfolio, the system will borrow the required amount of BTC from the exchange and sell it, using your USDT account as collateral for the loan (note: any currency can be used as collateral).
For those familiar with stock, commodity, or forex trading, this type of sale is known as a "short sale" or "shorting." It involves selling an asset you don’t own.
Let’s break it down step by step using the example above:
The client creates an order and receives a payment address from the merchant.
The client pays for 0.1 BTC (you can also configure rate recalculation at the time of payment, which is crucial for locking in the rate and ensuring a stable profit margin for the order).
Once the client pays, the system automatically borrows and sells 0.1 BTC on the exchange, using your USDT account as collateral.
The cryptocurrency is received, for example, in a block.io wallet (any merchant wallet can be used for receiving cryptocurrency).
As a result, you have 0.1 BTC in your block.io account, a debt of 0.1 BTC to the exchange, and USDT from the sale of 0.1 BTC.
Buying Cryptocurrency
The process of buying cryptocurrency when it is available in your portfolio works as follows. For example, let’s consider an exchange of rubles from Sberbank for 0.1 BTC:
The client creates an order, and you provide them with a payment card.
The client pays the required amount.
You manually set the order status to "Paid" (you can also configure rate recalculation at the time of payment, which is crucial for locking in the rate and ensuring a stable profit margin for the order).
If you don’t have Bitcoin in your portfolio but only USDT, and you want to automatically fulfill orders, the margin account comes to the rescue again. To prepare for this:
Transfer the required amount of USDT to your exchange account, enough to buy 1 BTC, for example.
Take out a loan of 1 BTC on the exchange.
Transfer 1 BTC from the exchange to your block.io wallet. As a result, you’ll have 1 BTC in your block.io wallet and a debt of 1 BTC on the exchange.
Now, clients can create exchange orders, and you can fulfill them by sending Bitcoin from your block.io wallet. For example, let’s consider an exchange of rubles from Sberbank for 0.1 BTC:
The client submits a request, and you provide them with a payment card.
The client pays the required amount.
You manually set the request status to "Paid" (you can also configure recalculation based on the exchange rate at the time of payment, which is crucial for locking in the rate and ensuring a stable profit margin for the transaction).
It’s also worth noting that all the actions described above—buying and selling—can be combined depending on your needs. You can carry out cryptocurrency-to-cryptocurrency exchanges even if you don’t actually have the cryptocurrency in your possession. For example, you can exchange XMR for BTC.
Additionally, you can create more complex trading operations involving cryptocurrency-to-cryptocurrency exchanges, including trading pairs that don’t exist on the exchange, such as XMR to XRP and vice versa.
The examples provided use a merchant and auto-payouts via the block.io wallet. It’s important to note that you can use any merchant and/or configure automatic payouts as you see fit. Trading actions are tied exclusively to the request statuses, so it doesn’t matter which merchant or auto-payout system you choose to use.
Last updated