Under the hood
Contracts
Xhade is five Solidity contracts. Addresses are published here when they go live.
| Contract | Role |
|---|---|
| XhadeExchange | Private balances, pools, liquidity, perps, liquidations and receipts |
| PriceOracle | Mark prices for perps, pushed by a keeper |
| MockUSDG | Test quote currency with a daily faucet |
| StockToken | ERC-20 used for test stock tokens |
| StockFactory | Mints new stock tokens for the Create page |
Main functions
| Function | What it does |
|---|---|
| deposit, withdraw | Move tokens between your wallet and your private balance |
| buy, sell | Spot trade against a pool |
| quoteBuy, quoteSell | Preview what a trade returns |
| addLiquidity, removeLiquidity | Fund a pool or take your share out |
| createMarket | Open a new pool |
| openPosition, closePosition | Open or close a perp |
| liquidate | Close an under-margined position for a reward |
| myBalance, myPosition, myShares, myReceipts | Read your own data |
The contracts are unaudited.
