# USD Conversion

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:&#x20;

$$
Multiplier = 1/ETHUSD \* 100 000 000
$$

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.

{% hint style="warning" %}
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.
{% endhint %}

{% hint style="info" %}
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.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dmex.app/formulas/usd-conversion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
