BenPay's account system adopts a layered model to support the complete asset flow from on-chain assets to real-time transactions, ensuring asset security, real-time performance, and system consistency. The entire system is divided into three layers of accounts: on-chain wallet, DEX wallet account, and trading account.
-
On-Chain Wallet
This is the user's personal wallet on the blockchain (e.g., Ethereum or Bitcoin wallet), controlled by the user, used to store on-chain assets. The on-chain wallet interacts with BenPay, transferring assets into the DEX via deposit or transferring assets back on-chain from the DEX via withdrawal.
-
DEX Wallet Account
-
Stored in the database, recording the user's asset balances, categorized into Available Balance (Type A) and Frozen Balance (Type F).
-
Available Balance (A) is the asset freely usable by the user for transfers, trading, or withdrawals.
-
Frozen Balance (F) is temporarily locked assets, e.g., frozen during withdrawals or transfers to the trading account.
-
-
Trading Account
-
Divided into the Spot Account and Perpetual Account, stored in memory to support high-performance trading.
-
The Spot Account is used for spot trading (e.g., BTC/USD trading pair), and the Contract Account is used for contract trading (e.g., leveraged trading).
-