Code Monkey home page Code Monkey logo

deribit-api-python's Introduction

API Client for Deribit API

Description

The Deribit API is available in this package.

Installation

sudo pip install deribit-api

Example

from deribit_api import RestClient
client = RestClient("KEY", "SECRET")
client.index()
client.account()

API - REST Client

new RestClient(key, secret, url)

Constructor creates new REST client.

Parameters

Name Type Decription
key string Optional, Access Key needed to access Private functions
secret string Optional, Access Secret needed to access Private functions
url string Optional, server URL, default: https://www.deribit.com

Methods

  • getorderbook(instrument) - Doc, public

    Retrieve the orderbook for a given instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
  • index() - Doc, public

    Get price index, BTC-USD rates.

  • getcurrencies() - Doc, public

    Get all supported currencies.

  • getorderbook(instrument) - Doc, public

    Retrieve the orderbook for a given instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
  • getlasttrades(instrument, count, since) - Doc, public

    Retrieve the latest trades that have occured for a specific instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
    count integer Optional, count of trades returned (limitation: max. count is 100)
    since integer Optional, “since” trade id, the server returns trades newer than that “since”
  • getsummary(instrument) - Doc, public

    Retrieve the summary info such as Open Interest, 24H Volume etc for a specific instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
  • account() - Doc, Private

    Get user account summary.

  • buy(instrument, quantity, price, postOnly, label) - Doc, private

    Place a buy order in an instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
    quantity integer Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options)
    price float Required, USD for futures, BTC for options
    postOnly boolean Optional, if true then the order will be POST ONLY
    label string Optional, user defined maximum 4-char label for the order
  • sell(instrument, quantity, price, postOnly, label) - Doc, private

    Place a sell order in an instrument.

    Parameters

    Name Type Decription
    instrument string Required, instrument name
    quantity integer Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options)
    price float Required, USD for futures, BTC for options
    postOnly boolean Optional, if true then the order will be POST ONLY
    label string Optional, user defined maximum 4-char label for the order
  • edit(orderId, quantity, price) - Doc

    Edit price and/or quantity of the own order. (Authorization is required).

    Parameters

    Name Type Decription
    orderId integer Required, ID of the order returned by "sell" or "buy" request
    quantity integer Required, quantity, in contracts ($10 per contract for futures, ฿1 — for options)
    price float Required, USD for futures, BTC for options
  • cancel(orderId) - Doc, private

    Cancell own order by id.

    Parameters

    Name Type Decription
    orderId integer Required, ID of the order returned by "sell" or "buy" request
  • cancelall(type) - Doc

    Cancel all own futures, or all options, or all.

    Parameters

    Name Type Decription
    type string Optional, type of instruments to cancel, allowed: "all", "futures", "options", default: "all"
  • getopenorders(instrument, orderId) - Doc, private

    Retrieve open orders.

    Parameters

    Name Type Description
    instrument string Optional, instrument name, use if want orders for specific instrument
    orderId integer Optional, order id
  • positions() - Doc, private

    Retreive positions.

  • orderhistory(count) - Doc, private

    Get history.

    Parameters

    Name Type Description
    count integer Optional, number of requested records
  • tradehistory(count, instrument, startTradeId) - Doc, private

    Get private trade history of the account. (Authorization is required). The result is ordered by trade identifiers (trade id-s).

    Parameters

    Name Type Description
    count integer Optional, number of results to fetch. Default: 20
    instrument string Optional, name of instrument, also aliases “all”, “futures”, “options” are allowed. Default: "all"
    startTradeId integer Optional, number of requested records

deribit-api-python's People

Contributors

ven-ajie avatar ssmyczynski avatar yandrey avatar pdivos 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.