All Projects → wangbinzero → kunkka-match

wangbinzero / kunkka-match

Licence: Apache-2.0 license
高性能撮合引擎

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to kunkka-match

Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (+320%)
Mutual labels:  exchange, btc, eth
Go Binance
A Go SDK for Binance API
Stars: ✭ 441 (+782%)
Mutual labels:  exchange, btc, eth
coinaly
🚀 Fast and easy to use mobile trade interface for cryptocurrencies. Track your trades to the moon and beyond. Currently only for Bittrex.
Stars: ✭ 32 (-36%)
Mutual labels:  exchange, btc, eth
Tardis Node
Convenient access to tick-level real-time and historical cryptocurrency market data via Node.js
Stars: ✭ 126 (+152%)
Mutual labels:  exchange, btc, eth
Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+44902%)
Mutual labels:  exchange, btc, eth
Bitcoin Arbitrage
An AWS Lambda function that looks for Bitcoin Arbitrage opportunities
Stars: ✭ 115 (+130%)
Mutual labels:  exchange, btc
coinbin.org
₿ A Human–Friendly API Service for Crypto Currency Information.
Stars: ✭ 255 (+410%)
Mutual labels:  btc, eth
Multicurrencywallet
Bitcoin, Ethereum, ERC20 crypto wallets with Atomic Swap exchange. Release announce: https://twitter.com/SwapOnlineTeam/status/1321844352369500160
Stars: ✭ 136 (+172%)
Mutual labels:  exchange, btc
My Token
📈Track token prices of your favorite exchanges in terminal!
Stars: ✭ 141 (+182%)
Mutual labels:  exchange, btc
Uniswap Python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 191 (+282%)
Mutual labels:  exchange, eth
Cryptocompare
CryptoCompare JavaScript API
Stars: ✭ 212 (+324%)
Mutual labels:  exchange, btc
Crypto vba
An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
Stars: ✭ 103 (+106%)
Mutual labels:  exchange, btc
Coinexchange
数字货币交易所 (开源免费、基于java、无限扩展、高并发、高可靠性、美观?我尽量吧)
Stars: ✭ 61 (+22%)
Mutual labels:  exchange, btc
Qtbitcointrader
Secure multi crypto exchange trading client
Stars: ✭ 520 (+940%)
Mutual labels:  exchange, btc
bankster
Money Creation Made Easy
Stars: ✭ 30 (-40%)
Mutual labels:  btc, eth
MinerProxy
MinerProxy(中文名:加密挖全球 ),采用IOCP超高性能的网络框架编写,具有稳定性高,传输速度快,并发强等优点。可快速实现一键搭建任意矿池(ETH/ETC/RVN/ERGO/AE/BTC等)的中转节点,支持SSL加密,支持SSL矿池,支持任意第三方挖矿软件(包括OS系统),支持协议模拟功能,内网无需客户端即可SSL加密传输至VPS解密,并同时支持5个矿池的转发,有精准清晰的矿机数据展示列表,可方便配置合理抽水,自动拦截抽水增加业主算力。在保持业主算力不受大的影响的情况下,给予VPS搭建者一定的运营费用。
Stars: ✭ 447 (+794%)
Mutual labels:  btc, eth
crypto-watcher
Real-time cryptocurrencies prices.
Stars: ✭ 25 (-50%)
Mutual labels:  btc, eth
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+966%)
Mutual labels:  exchange, eth
conduit
Conduit - Open Source 0x Relayer API implemented in NodeJS
Stars: ✭ 18 (-64%)
Mutual labels:  exchange, eth
tokencore
The core components of the blockchain wallet backend, support a variety of blockchain address generation and offline signatures
Stars: ✭ 412 (+724%)
Mutual labels:  btc, eth

kunkka-match

有幸得到大家的喜欢,由于当前代码只放了一部分。有兴趣的小伙伴加我微信一起探讨交流!个人的目标是做一版开源的!VX :wangbin769558579

高性能撮合引擎

连续竞价之价格判断

连续竞价要满足价格优先,时间优先原则

  • 价格优先:买单价格较高者优先成交,卖单价格较低者优先成交

  • 时间优先:买卖方向和价格相同的委托单,先上报的委托单会比后申报的委托单优先成交

  • 买入价必须大于等于卖出价才能成交,当买入价等于买入价时,成交价就是买入或者卖出价。

  • 当买入价大于卖出价时,则还需要参考前一笔成交价来确定最新成交价。假设买入价为 B 卖出价为S 前一笔成交价为P ,最新成交价为N 那么:

    • 如果 P >= B 则 N = B
    • 如果 P <= S 则 N = S
    • 如果 B > P > S 则 N = P

中间件支持

  • rabbitmq
  • redis

运行

go run main.go

编译&运行

linux

GOOS=linux GOARCH=amd64 go build main.go
./main

windows

GOOS=windows GOARCH=amd64 go build main.go

开启交易标的引擎

POST http://127.0.0.1:8080/openMatching

{
	"symbol":"btcusdt",  //交易标的
	"price":7200         //开盘价
}

关闭交易标的引擎

POST http://127.0.0.1:8080/closeMatching

{
   "symbol":["btcusdt","ethusdt"]
}
-----------------------------------------------------------------
   __ __          __    __          __  ___     __      __
  / //_/_ _____  / /__ / /_____ _  /  |/  /__ _/ /_____/ /
 / ,< / // / _ \/  '_//  '_/ _  / / /|_/ / _  / __/ __/ _ \ 
/_/|_|\_,_/_//_/_/\_\/_/\_\\_,_/ /_/  /_/\_,_/\__/\__/_//_/

             Kunkka 高性能撮合引擎-v0.1  goLang
-----------------------------------------------------------------
[KUNKKA] –– 2020/01/02 11:50:13.398527 [INFO]交易标的引擎map初始化成功
[KUNKKA] –– 2020/01/02 11:50:13.398816 [INFO]缓存服务redis [127.0.0.1:6379] 连接成功 
[KUNKKA] –– 2020/01/02 11:50:13.399150 [INFO]订单簿初始化成功
[KUNKKA] –– 2020/01/02 11:50:13.399174 [INFO]撮合引擎 [btcusdt] 启动成功
[KUNKKA] –– 2020/01/02 11:50:13.399544 [INFO]缓存加载订单: 交易标的 [btcusdt] 订单 map[action:create orderId:1234568 orderType:limit price:1200 symbol:btcusdt timestamp:0.00000000000000000000000000000000000000000000000015779359203800869]
[KUNKKA] –– 2020/01/02 11:50:13.399736 [INFO]缓存加载订单: 交易标的 [btcusdt] 订单 map[action:create orderId:1234567 orderType:limit price:1200 symbol:btcusdt timestamp:0.0000000000000000000000000000000000000000000000001577935932283284]
[KUNKKA] –– 2020/01/02 11:50:14.401942 [INFO]服务端口: :8080
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].