GithubHelp home page GithubHelp logo

edennis / krakex Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 15.0 148 KB

Elixir client for the Kraken Bitcoin Exchange API

License: MIT License

Elixir 100.00%
elixir-client cryptocurrency crypto-exchange kraken-exchange-api kraken bitcoin

krakex's Introduction

Krakex

Build Status Coverage Status Hex.pm

Elixir client for the Kraken Bitcoin Exchange API

Note that this README refers to the master branch of Krakex, not the latest released version on Hex. See the documentation for the documentation of the version you're using.

Installation

The package can be installed by adding krakex to your list of dependencies in mix.exs:

def deps do
  [
    {:krakex, "~> 0.7.0"}
  ]
end

Configuration

The Kraken API consists of public and private calls. While you can use the public API as you like, you'll need to create an account and get yourself an API key if you want to do more. To use the private API you'll need to add some configuration to your Mix config:

config :krakex,
  api_key: System.get_env("KRAKEN_API_KEY"),
  private_key: System.get_env("KRAKEN_PRIVATE_KEY")

Usage

The entire functionality of the API can be accessed via the Krakex module. To get started just configure your API credentials as described above and call the functions:

iex(1)> Krakex.balance()
{:ok,
 %{"BCH" => "0.0000000000", "XETH" => "0.0000000000", "ZEUR" => "50.00"}}

If you need to use multiple Kraken accounts in your application this can be achieved by explicitly defining Krakex.Client structs and passing them as the first argument to any of the functions defined in the Krakex module:

client1 = Krakex.Client.new("api_key1", "secret1")
client2 = Krakex.Client.new("api_key2", "secret2")

balance1 = client1 |> Krakex.trade_balance(asset: "ZUSD")
balance2 = client2 |> Krakex.trade_balance(asset: "EUR")

TODO - Help wanted!

Private user data

Private user trading

Private user funding calls

Contributing

  1. Fork it (https://github.com/edennis/krakex/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2018 Erick Dennis

krakex's People

Contributors

edennis avatar lukebelbina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

krakex's Issues

Conditional Closes on Limit Order

Hi,

I'm trying to figure out how to add a conditional close to a limit order, specifically a take profit condition. On a standard limit order you would write something like:

Krakex.add_order(pair, "buy", "limit", lot_size, [price: buy_price])

After looking through the Krakex docs and the Kraken API I see another order type called take-profit-limit. I've tried this as well in the following fashion:

Krakex.add_order(pair, "buy", "take-profit-limit", lot_size, [price: sell_price, price2: buy_price])

But I seem to get back an error of: EGeneral:Invalid arguments:ordertype

If you could give me a hand figuring out where I'm misapplying this it would be greatly appreciated.

Change AddOrder signature

In order to avoid float imprecision, AddOrder should use string instead of float for volume and price data.

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.