Margin Vault is an on-chain wallet that works according to the smart contract logic. To trade on Spin, users need to deposit funds to the margin vault that stores users' funds safely, while the smart contract defines the amount of funds the user can transfer depending on their balance and current positions.