On DMEX, users trade futures contracts. Futures contracts are defined by the following parameters:
the hash of the underlying asset object
futures contract expiration block
the closing price for the futures contract
is the futures contract closed? (0 - false, 1 - true)
if someone has forced release of funds after no settlement for two hours, the contract is marked as broken and can no longer close positions, all collaterals are released
the multiplier price (usually 1/ETHUSD x 1e8)
funding rate expressed per block * 1e18
the block in which the contract was closed (0 while contract open)
true if the contract is perpetual
the maintenance margin coefficient
The Futures Contract has a unique hash derived from its parameters. There can be no two futures contracts with the same hash and different parameters as all parameters are included in the hash. A change in any parameter will result in a new futures contract hash.
bytes32 futuresContractHash = keccak256(this,asset,expirationBlock,multiplier,fundingRate,perpetual,maintenanceMargin);
When a user places an order, the order is placed to trade a specific futures contract and the futures contract hash is embedded in the user’s signature. This way the user can be sure that he/she is trading the correct asset/futures contract.