用户 1 --》n 账户 account
账户 1 --》n 订单 order
订单 1 --》n 账单流水ledger
订单order:
type 类型 :
账单流水ledger:
账户
钱包账户-- 可用理解成总账户,与对外的流水入口。譬如充值、提现关联.
参考 okex 账户体系
每次的流水都记录当前的balance
holding:持仓,指数量(股数),跟market price不挂钩
portfolio
product & instrument
注意所有的数字在传输的时候都是 string,防止数据在加密过程中容易出错,并保留固定位数。(防止 2.00 与 2.000 有差别)
关于时间 UTC String(Thu, 14 Mar 2019 08:06:39 GMT) vs timestamp (1552550799091) vs ISODate (2019-03-14T08:06:39.091Z)
建议 ISODate
Kong 分发不同的交易币种种,不同的交易产品(期货合约/币币交易/法币/其他API)
`
$ curl -I https://www.okex.com
HTTP/1.1 200 Tunnel established
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Content-Length: 45825
Connection: keep-alive
Vary: Accept-Encoding
X-RateLimit-Limit-second: 50
X-RateLimit-Remaining-second: 49
X-RateLimit-Limit-minute: 100
X-RateLimit-Remaining-minute: 99
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: SAMEORIGIN
Set-Cookie: locale=en_US; Max-Age=604800; Expires=Thu, 28-Mar-2019 03:39:44 GMT; Path=/
Content-Language: en-US
Date: Thu, 21 Mar 2019 03:39:44 GMT
X-Kong-Upstream-Latency: 13
X-Kong-Proxy-Latency: 0
Via: kong/0.12.3
`
容量估计:
关键子系统概述:
量化策略系统
ref :
交易所系统设计 exchange trading system design
原文:https://www.cnblogs.com/no7dw/p/13628880.html