Perpetual trading

Vault Structure

The vault contains the following fields:

  • starkKey - the public key of the vault’s owner. Transfers and trades that refer to this vault must be signed with this key.

  • collateralAmount - the amount of collateral in the vault.

  • A list of synthetic assetId. For each assetId we have:

Additional Elements in the State

Global funding indices

The most recent global funding index according to the lastfunding tick. Used to update the position’s balance before every transaction execution according to the funding logic.

Current system time

The current time of the system advances whenever a Funding tick or an Oracle price tick arrives. When closing a batch for submission, the system time must be a date within the last week.

Current prices

The current prices of all the assets in the system, as received from different Oracle Price Tick transactions.