Perpetual Trading (v2.0)
The user submits a
WithdrawalToAddress request to the off-chain application.
This request includes the user’s
ethereumAddress in addition to the user’s signature.
The off-chain app checks the validity of the withdrawal request according to its business logic and the relevant
positionId state. If it is valid, it sends the off-chain withdrawal transaction to the StarkEx service.
StarkEx verifies that the withdrawal request is valid, according to the relevant business logic statement to be proved, and the relevant
positionId state. If the withdrawal is valid, it is aggregated to a batch to be submitted on-chain along with a validity proof.
Upon performing state update, the StarkEx smart contract moves the relevant funds to the withdrawal area, under the user
Once the funds are in the withdrawal area, every user can make an on-chain call to withdraw the funds to the
ethereumAddress the funds are belonged to. The ownerKey parameter should be the ethereum address, and not the stark key. For more info, see