On-Chain Configuration

The StarkEx Perpetual Trading system configuration smart contract contains:

  • global configuration parameters

  • configuration parameters for each synthetic asset

The system configuration must be reflected on-chain in order to preserve soundness. In order to reduce gas costs, a hash committment of the full configuration is stored on-chain, rather than the full configuration smart contract itself.

To understand the importance of storing the system configuratio on-chain, consider the following example:

In a given system, one configuration dictates who is allowed to sign on price feeds of the different assets. If a batch is proven with respect to an invalid Oracle, which is different from what is reflected on-chain, then the proof is rejected. Otherwise, a malicious operator could change this configuration off-chain and sign any price feed with an arbitrary price.

If you are worried about the security of the system, check that you can access the full configuration, along with the hash calculations that attest to it corresponding to the on-chain configuration commitment. You can get this information, for example, on the application site.

Global Configuration

Contains the following fields:


Contains asset_id and resolution for the collateral token.


Contains position_id and the public Stark key, public_key, of the party that receives fees from users for transactions that take place in the system.


Used to verify asset_id for the Funding tick transaction off-chain collateral.


The height of the Orders tree.


The height of the Balances tree.


Used to check the validity of funding ticks.


Used to check the validity of oracle price ticks.

Configuration Per Synthetic assetId

Contains the following fields:


The synthetic asset’s ID.


The number of oracle signers required to approve a new price for a given synthetic asset.


A list of possible IDs to identify this asset, for use with different oracle companies. For more information, see Becoming an oracle provider for StarkEx.


A list of public Stark keys that have permission to sign on oracle prices for a given synthetic asset.


The asset’s resolution.


The asset’s risk factor. The risk factor is a representation of the maintenance margin required for this asset. For more information, see Margin and Total value and total risk.