now in golang!
TOP TODO
- ticker HTTP GET API for bid / ask spread
- make a market maker
- make a trading bot
-
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 }
}
}
}