sneilan / stock-exchange

Personal stock exchange on your laptop!
Other
39 stars 7 forks source link

Wallet and Risk Management #6

Open sneilan opened 11 months ago

sneilan commented 11 months ago

When a user is first created, they should have a balance gifted to them by the administrator. Perform risk checks for every trade and make sure user has enough money in their wallet.

sreyas-p commented 10 months ago

what factors would the risk checks need to consider other than the user's balance? (I am interested in contributing to this project)

sneilan commented 10 months ago

Totally! Here's some I thought of for a server like this that will eventually be public facing. They prevent DDOS attacks and out of memory crashes. There are other types of risk factors involving margin, options, total market activity but that is not on the roadmap yet.

1) How many trades a user has open. Is the user trading too much? (too many trades open = server runs out of memory) 2) How big is a trade relative to other trades in the market (a huge trade means a long time to fill it. potential DDOS attack) 3) How many trades are live across all users? (Should rate limit trades when too many trades open to prevent server crashing)

It may be hard to implement these features without user accounts.