Code Monkey home page Code Monkey logo

zeus's Introduction

数字货币交易所实时行情 Springboot + Netty

目前支持🔥火币数据解析 后续会逐步添加解析

  • websocket连接火币服务器
  • K线作为历史数据写入mongoDB
  • 获取okex最新USD汇率写入redis
  • 支持http查询历史K线数据
  • 支持配置文件订阅交易对
  • 支持其它交易所扩展
  • 支持websocket本地连接
  • 自定义协议

服务端连接方式 ws://ip:port/

Usage

本地客户端在与服务端握手时,服务器会为客户端分配一个唯一识别码UUID,在接下来的所有请求中都必须带上该ID

订阅

  • K线
  • 24小时成交详情
  • 深度
  • 最新成交

K线

{
  "event":"sub",
  "id": "723c9150-e143-4d80-84fc-6d0acdcba8f5",
  "channel":["market.btcusdt.kline.1min"],   //1min 5min 15min 30min 60min 1day 1mon..
  "type":"kline"
}
返回

24小时成交详情

{
  "event":"sub",
  "id": "723c9150-e143-4d80-84fc-6d0acdcba8f5",
  "channel":["market.btcusdt.detail"],
  "type":"detail"
}
返回

深度

{
  "event":"sub",
  "id": "723c9150-e143-4d80-84fc-6d0acdcba8f5",
  "channel":["market.btcusdt.depth.step1"],
  "type":"depth"
}
返回

最新成交

{
  "event":"sub",
  "id": "723c9150-e143-4d80-84fc-6d0acdcba8f5",
  "channel":"market.btcusdt.trade.detail",
  "type":"trade"
}
返回

取消订阅所有

{
  "event":"un_sub",
  "id": "723c9150-e143-4d80-84fc-6d0acdcba8f5",
  "type":"all"
}

请求

  • 历史K线初始化
  • 历史K线分页加载

历史K线初始化

{
  "event":"req",
  "channel":["market.kline.btcusdt.1min"]
}
返回

历史K线分页加载

{
  "event":"req",
  "channel":["market.kline.btcusdt.1min.page.1571199360"]
}
返回

数据

image

image

image

image

zeus's People

Contributors

wangbinzero avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.