The simulator core behind StockYatra. A virtual wallet, market/limit/stop orders that fill against live prices, positions, holdings and live mark-to-market P&L. Now with a per-fill charges hook (pair it with @lacspace/market for net P&L) and backtest-style stats — win rate, profit factor, avg win/loss. Drop it into any app.
Install
$ npm install @lacspace/paper-trade
Quick example
@lacspace/paper-tradets
acct.buy("RELIANCE", { qty: 10 })
Returns Order { status: "FILLED" }
Tips
Zero-dependency and isomorphic — safe to import on the server, in the browser, on the edge and in React Native. It tree-shakes, so you only ship what you import.
Looking for the complete API and more examples? The npm page and GitHub README carry the full reference — or grab the PDF.