Code Monkey home page Code Monkey logo

investment-lime-trader-client's Introduction

Lime trader client

This is Java client for the lime.co trader api. Official description of the api could be found here.

Quick start

Important
Java 17+ is required

Add dependency of lime trader client, e.g. if you are using maven it will be something like:

<dependency>
  <groupId>com.ramanbabich.investment</groupId>
  <artifactId>lime-trader-client</artifactId>
  <version>${lime-trader-client.version}</version>
</dependency>

Create an instance of lime trader client specifying your credentials and just invoke methods you need. Don’t forget to close the client when you don’t need it any longer or just use try-with-resources statement to free up borrowed resources.

LimeTraderClient client = new LimeTraderClient(new Credentials(
      "<your-client-id>",
      "<your-client-secret>",
      "<your-username>",
      "<your-password>"));
List<AccountBalance> accountBalances = client.getAccountBalances();
String accountNumber = accountBalances.get(0).accountNumber();
client.setSubscriber((AccountBalanceChangedEventSubscriber) System.out::println);
client.subscribeForAccountBalanceChangedEvents(accountNumber);
Thread.sleep(5 * 1000);
client.close();

Look through one file code of the client overview app to quickly get info about all capabilities of this client. You can also start this app inside your code and analyse capabilities via logs with help of code below:

Warning
application.reviewOrderApi(); is commented because it makes the order that you possibly don’t want to do, it is recommended to look through the source code first of all.
try (ClientOverviewApplication application = new ClientOverviewApplication(new Credentials(
    "<your-client-id>", "<your-client-secret>", "<your-username>", "<your-password>"))) {
  application.reviewAccountApi();
  //application.reviewOrderApi();
  application.reviewPricingApi();
  application.reviewSecurityApi();
  application.reviewMarketDataApi();
}

Internals

This client internally uses java.net.http.HttpClient introduced in Java 11 for http and web socket communication. Shaded FasterXML Jackson databind for (de)serialization of request/responses.

License

Licensed under the Apache License, Version 2.0

Lime trader client includes a number of subcomponents with separate copyright notices and license terms. Your use of the source code for these subcomponents is subject to the terms and conditions of their licenses. Details are included within NOTICE.txt file, please read it before use.

investment-lime-trader-client's People

Contributors

raman-babich avatar

Watchers

 avatar

investment-lime-trader-client's Issues

Update versions maven plugin rule set

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>versions-maven-plugin</artifactId>
  <version>${versions-maven-plugin.version}</version>
  <configuration>
    <!--<allowMajorUpdates>false</allowMajorUpdates>-->
    <ruleSet>
      <ignoreVersions>
        <ignoreVersion>
          <type>regex</type>
          <version>(?i)(.+-rc|.+-m\d|.+-(dev|alpha|beta).*)</version>
        </ignoreVersion>
      </ignoreVersions>
    </ruleSet>
  </configuration>
</plugin>

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.