Alice sends the Application a signed Transfer request, which includes:
starkKey of the vault that funds will be taken from
The relevant (quantized)
See here for the full transaction structure.
The Application sends the Transfer transaction to StarkEx service. StarkEx service verifies:
The signature is valid and the signing
starkKey matches the
vaultId has enough funds (according to the application business logic)
vaultId indeed has the receiver
The Transfer has not expired
The Transfer was not executed before (checked in the
For perpetual trading: the
assetId corresponds to the collateral token
If the Transfer is valid, the Transfer is included in a batch to be submitted on-chain along with validity proof. See here for full details on state update on-chain.