On-Chain Accounts

An on-chain account has its vault saved on-chain, and all balance instructions arrive as L1 transactions. A special property of an on-chain account is that it does not require a private (stark) key — enabling smart contracts to be the "owner" of such an account. Thus, L1 players/applications can trade through StarkEx and be matched against any pending orders (both on-chain and off-chain account orders).

The on-chain trading mode enables interoperability between StarkEx applications and L1 applications and can be used for DeFi Pooling or by liquidity aggregators.

On-chain accounts do not scale well — as submitting a trade request for an on-chain account requires an L1 transaction that will cost ~60K gas. It is anticipated that dApps will be the primary users of this mode. If you intend to use it as an end-user, double-check it makes sense for your needs.

We will explore the deposit, trade, and withdrawal flows for on-chain accounts.

StarkEx for perpetual doesn’t support on-chain accounts. This is because the only "real" asset in the perpetual environment is the collateral asset, and all the debt/collateral is managed at L2. L1 vaults are not useful for active trading against the L2 market.