All Projects → NickStefan → stockmarket

NickStefan / stockmarket

Licence: other
golang stock market simulator

Programming Languages

go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
shell
77523 projects
HTML
75241 projects
Nginx
273 projects
CSS
56736 projects

Stock Market Clone

now in golang!

TOP TODO

  • ticker HTTP GET API for bid / ask spread
  • make a market maker
  • make a trading bot

TODO

  • ledger service

    • rename to account service
    • listen for http (from orderbook)
    • use django and mysql for auth, accounts and assets
    • handle accounts and authentication
    • track quantity and asset for each user (cash is an asset)
  • orderbook service

    • listen for http (for submitting of orders)
    • redlock on orderbook ticker keys
    • containerize, load balance
    • use redis ordered sets for buy and sell priority queues
    • priotiy queues for buy and sell orders
    • dequeue priority queues into trades
    • message to web service anonymized trades and orderbook bid ask
    • message to ledger service trades
    • message to ticker service anonymized trades
  • ticker service (chart and quote stream)

    • rename to tickdata service
    • redlock on second and minute ticker keys
    • containerize and load balance
    • [?] need leader elect for ticker
    • use redis to for accumulating trades into tick data
    • on price data http, update minute high, low, open, close, vol information
    • every 60 seconds, persist 1minute period tick data to DB
    • API for charts
  • web service

    • serve front end javascript
    • socket messages to interested clients
    • scale messages across multiple instances with web sockets?
  • web client (front end)

    • graph "CHART" data into a stock chart
    • listen to "TICKER" channels
    • append new data to chart
    • display account info
    • place orders
  • bot service (automate trades)

    • trading bots
    • front end UI for creating bots
    • rule based trading using JSON {$when: ..., $buy: ... }
  • web load balancer

    • nginx
    • proxy each service to single domain

Ideas:

  • Ticker names: Kryptonite, Adamantium, Puppies

  • rule based trading:

    {
    $when: {
    $comparison: {
    itemA: { $ticker: "STOCKA"},
    itemB: 20.55,
    type: "gte"
    }
    },
    $do: {
    $order: { kind: "LIMIT", intent: "BUY", bid: 20.60, shares: 100 }
    },
    $then: {
    $when: {
    $comparison: {
    itemA: { $ticker: "STOCKA"},
    itemB: 21.00,
    type: "gte"
    }
    },
    $do: {
    $order: { kind: "LIMIT", intent: "SELL", ask: 20.90, shares 100 }
    }
    }
    }

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].