java-api

Quedex Java API.

License

License

Categories

Categories

Java Languages Net Dex General Purpose Libraries Utility
GroupId

GroupId

net.quedex
ArtifactId

ArtifactId

java-api
Last Version

Last Version

0.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

java-api
Quedex Java API.
Project URL

Project URL

https://github.com/quedexnet/java-api
Source Code Management

Source Code Management

https://github.com/quedexnet/java-api

Download java-api

How to add to project

<!-- https://jarcasting.com/artifacts/net.quedex/java-api/ -->
<dependency>
    <groupId>net.quedex</groupId>
    <artifactId>java-api</artifactId>
    <version>0.7.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.quedex/java-api/
implementation 'net.quedex:java-api:0.7.0'
// https://jarcasting.com/artifacts/net.quedex/java-api/
implementation ("net.quedex:java-api:0.7.0")
'net.quedex:java-api:jar:0.7.0'
<dependency org="net.quedex" name="java-api" rev="0.7.0">
  <artifact name="java-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.quedex', module='java-api', version='0.7.0')
)
libraryDependencies += "net.quedex" % "java-api" % "0.7.0"
[net.quedex/java-api "0.7.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.21
com.fasterxml.jackson.core : jackson-databind jar 2.8.0
org.bouncycastle : bcpg-jdk15on jar 1.54
com.google.guava : guava jar 19.0
org.java-websocket : Java-WebSocket jar 1.3.0

test (5)

Group / Artifact Type Version
org.testng : testng jar 6.9.10
ch.qos.logback : logback-classic jar 1.1.7
org.mockito : mockito-all jar 1.10.19
org.assertj : assertj-core jar 3.5.2
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Quedex Official Java API

The best way to communicate with Quedex Bitcoin Derivatives Exchange using Java.

Important!

  • Next to this documentation, please read the general documentation of our WebSocket API.
  • Quedex Exchange uses an innovative schedule of session states. Some session states employ different order matching model - namely, Auction. Please consider this when placing orders.

Getting the API

Include in your project as a Maven dependency:

<dependency>
    <groupId>net.quedex</groupId>
    <artifactId>java-api</artifactId>
    <version>0.7.0</version>
</dependency>

Using the API:

To use the API you need to provide a configuration - the default way to do that is via a .properties file. An example may be found in qdxConfig.properties.example - rename this file to qdxConfig.propertie, place on your classpath and fill in the following (the rest of the properties is done):

  • net.quedex.client.api.accountId
  • net.quedex.client.api.userPrivateKey

You may find your account id and encrypted private key in our web application - on the trading dashboard select the dropdown menu with your email address in the upper right corner and go to User Profile (equivalent to visiting https://quedex.app/profile when logged in).

Now you are ready to start hacking:

char[] pwd = ... // read private key passphrase
Config qdxConfig = Config.fromResource(pwd); // initialise the config from qdxConfig.properties using one of the factory methods

MarketStream marketStream = new WebsocketMarketStream(qdxConfig);
UserStream userStream = new WebsocketUserStream(qdxConfig);

// register stream failure listeners
marketStream.registerStreamFailureListener(...);
userStream.registerStreamFailureListener(...)

// start streams
marketStream.start();
userStream.start();

// receive tradable instruments
marketStream.registerInstrumentsListener(instruments -> {

    // register and subscribe other market stream listeners
    marketStream.registerQuotesListener(...).subscribe(instruments.keySet()); // to subscribe all instruments
    marketStream.register*(...).subscribe(...);
});

// register user stream listeners
userStream.registerOpenPositionListener(...);
userStream.register*(...);

// subscribe user stream listeners; see Javadoc for details
userStream.subscribeListeners();

// play with the streams: receive events, place orders and so on
userStream.placeOrder(...);
userStream.batch()
    .placeOrder(...)
    ...
    .send();
...

// once finished, stop the streams
userStream.stop();
marketStream.stop();

Contributing Guide

Default channel for submitting questions regarding the API is opening new issues. In cases when information disclosure is not possible, you can contact us at [email protected].

In case you need to add a feature to the API, please submit an issue containing change proposal before submitting a PR.

Pull requests containing bugfixes are very welcome!

License

Copyright © 2017-2019 Quedex Ltd. API is released under Apache License Version 2.0.

net.quedex

Quedex

Bitcoin Derivatives Exchange

Versions

Version
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1