Asset

The Asset in the DMEX smart contract is a fundamental object that defines the asset being traded in the futures contract. The Asset comprises of the following information:

Parameter

Type

Value

baseToken

address

the token used for margin (0x000... in the ETH case)

priceUrl

string

the url where the Oracle will take the settlement price from

pricePath

string

the JSON parameter inside the priceUrl that represent the last traded price

disabled

bool

if true, the asset cannot be used in contract creation (when priceUrl no longer valid or decimals have changed)

decimals

uint256

number of decimals in the price

Every Asset has a unique hash. That unique hash is used in the “Asset” parameter when creating a new Futures Contract. There can be no two assets with different parameters but the same hash because all parameters are part of the hash, therefore a change in parameters would result in a new unique asset hash.

bytes32 futuresAssetHash = keccak256(
    this, 
    baseToken, 
    priceUrl, 
    pricePath, 
    decimals
);

Last updated