Spin
WebsiteTwitterTelegramDiscord
  • ๐Ÿ‘‹Welcome to Spin
  • Spin Products
    • ๐ŸŒ Spot Trading
    • โšกInstant Swaps
    • ๐Ÿ†Perpetual Futures
    • ๐Ÿช™DeFi Option Vaults
      • โ˜€๏ธCovered Call Strategy
      • ๐ŸŒ•Cash-Secured Put Strategy
    • โœจOther AIPs
  • Contracts specification
    • โšชNEAR-Perp
  • SPIN Token
    • ๐ŸŽ‡SPIN Utilities
    • ๐ŸฃPublic Token Sale
    • ๐Ÿ“Tokenomics
    • ๐Ÿ’ซMarket Maker Incentives
    • โ›ฒTrader Incentives
    • ๐Ÿ›ธSPIN Staking
    • โš“Insurance Fund
  • Freaky Elves
    • ๐Ÿ‘พFreaky Elves NFTs
    • ๐ŸฆšSecret Chat on DS
  • Tech Documentation
    • ๐ŸŒฑSC Methods & API
    • ๐Ÿ€Perpetuals
      • ๐ŸŒฟTrading Modules
      • ๐Ÿ”‹Collateral
      • ๐Ÿ’ธUnrealized PnL
      • ๐ŸงชFunding
      • ๐Ÿ›ฃ๏ธMargin ratio & Liquidation
  • User Guides
    • ๐Ÿ“ˆSpin Trading Strategies
    • โฒ๏ธUsing Ledger on Spin
  • Links
    • ๐Ÿ”—Useful links
Powered by GitBook
On this page

Was this helpful?

  1. Tech Documentation
  2. Perpetuals

Trading Modules

This section describes Spin's trading architecture i.e. modules involved in perpetuals trading.

PreviousPerpetualsNextCollateral

Last updated 2 years ago

Was this helpful?

Spin's trading modules

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.

Risk Engine is a module that runs pre-trade checking and order settlement.

All information about the user activity is kept in the smart contract that calculates traders' metrics such as required collateral, uPnL, margin ratio, etc.

  1. The user deposits USDC to the margin account

2. User enters a position for 1 BTC-PERP

3. User closes the position

๐Ÿ€
๐ŸŒฟ