Coder Social home page Coder Social logo

kucoin-level3-sdk's Introduction

Kucoin Level3 Market

Kucoin Level3 Market supports both spot and futures.

Guide

中文文档

Installation

  1. build
CGO_ENABLED=0 go build -ldflags '-s -w' -o kucoin_market cmd/main/market.go

or you can download the latest available release

Usage

  1. vim config.yaml:

     app_debug: true
     
     symbol: KCS-USDT
     #symbol: XBTUSDM
     
     app:
       name: market
       log_file: "./runtime/log/market.log"
     
     api_server:
       network: tcp
       address: 0.0.0.0:9090
       token: your-rpc-token
     
     market.kucoin_v2:
       url: "https://api.kucoin.com"
       type: "spot"
       # url: "https://api-futures.kucoin.com"
       # type: "future"
       key: ""
       secret: ""
       passphrase: ""
    
     redis:
       addr: 127.0.0.1:6379
       password: ""
       db: 0
    
  2. Run Command:

    ./kucoin_market start -c config.yaml
    

Docker Usage

  1. Build docker image

    docker build -t kucoin_market .
    
  2. vim config.yaml:

    app_debug: true
    
    symbol: KCS-USDT
    #symbol: XBTUSDM
    
    app:
      name: market
      log_file: "./runtime/log/market.log"
    
    api_server:
      network: tcp
      address: 0.0.0.0:9090
      token: your-rpc-token
    
    market.kucoin_v2:
      url: "https://api.kucoin.com"
      type: "spot"
      # url: "https://api-futures.kucoin.com"
      # type: "future"
      key: ""
      secret: ""
      passphrase: ""
    
    redis:
      addr: 127.0.0.1:6379
      password: ""
      db: 0
    
  3. Run

docker run --rm -it -v $(pwd)/config.yaml:/app/config.yaml --net=host kucoin_market

RPC Method

default endpoint : 127.0.0.1:9090 the sdk rpc is based on golang jsonrpc 1.0 over tcp.

see:python jsonrpc client demo

  • Get Part Order Book

    {"method": "Server.GetOrderBook", "params": [{"token": "your-rpc-token", "number": 1}], "id": 0}
    
  • Add Event ClientOids To Channels

    {"method": "Server.AddEventClientOidsToChannels", "params": [{"token": "your-rpc-token", "data": {"clientOid": ["channel-1", "channel-2"]}}], "id": 0}
    

Python-Demo

the demo including orderbook display

see:python use_level3 demo

  • Run order_book.py
    command: python3 order_book_demo.py
    describe: display orderbook
    

kucoin-level3-sdk's People

Contributors

sh7ning avatar ive20 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.