USD Conversion
Last updated
Last updated
All prices on DMEX are in US Dollars. However, the profits are paid in the collateral currency chosen by the user. Therefore the profits made in USD must be converted to the collateral currency when a position is settled.
To make this work properly, the conversion rate between USD and the collateral currency (eg. ETH/USD) is set up during the order creation.
For example, if you want to open a position using ETH as collateral currency, inside the Futures Contract the multiplier parameter will be set:
When closing the position, the profits made in USD will be converted to ETH by multiplying the profit with the multiplier.
Let's say that ETH was worth 125$ when you opened the position. This means that the multiplier = 1/125*100 000 000 = 800 000. If for example you make a 100$ profit on this position, you will be credited 100$ * 800 000 / 100 000 000 = 0.8 ETH.
The ETH/USD exchange rate remains fixed for the duration of the position. Therefore if the price of ETH fluctuates your profits might vary slightly due to the price volatility of ETH. If you want to protect from this volatility use a USD pegged stablecoin like DAI as collateral. Because the stablecoin will always equal to 1 USD, there is no volatility risk.
We use the 100000000 (or 1e8) in the formula because of the particularities of Ethereum smart contract design. Ethereum smart contracts don't support floating numbers, so all formulas are multiplied by a standard number (1e8 or 1e18) before performing divisions. Otherwise the division that results in a fraction would be truncated to the integer value by the Ethereum Virtual Machine.