GithubHelp home page GithubHelp logo

discosultan / krakencore Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 16.0 90 KB

๐Ÿ’ฑ .NET client for Kraken Bitcoin & cryptocurrency exchange API

License: MIT License

C# 100.00%
async csharp kraken-exchange-api netstandard

krakencore's People

Contributors

discosultan avatar romeopavoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krakencore's Issues

TimestampedDictionary

Hey @discosultan,

What is a use of the TimestampedDictionary class? From what I see the only difference from Dictionary is the last property. My major problem is that it makes interfacing this great library from F# code really tricky. Could we get rid of it and consistently use Dictionary everywhere?
Cheers,
Wojtek

Rate limit applied to public methods

Hey, many thanks for this wrapper!
Could you tell me please, what is the reason for applying rate limit for anonymous public methods calls like https://api.kraken.com/0/public/Time if the api itself doesn't limit it?

Cheers,
Wojtek

nuget

Is there a nuget package for this??

High(er) level library interface?

Would you consider accepting pull requests with higher level functions?

A trivial example would be decoding the unix timestamp as seen below.

public class Trade
{
    public decimal Price { get; set; }
    public decimal Volume { get; set; }
    public double Time { get; set; }
    public string Side { get; set; }
    public string Type { get; set; }
    public string Misc { get; set; }

    [JsonIgnore]
    public DateTime DateTime => DateTimeOffset.FromUnixTimeSeconds((long)Time).DateTime;
}

Similarly options to the client methods such as

... GetRecentTrades(string pair, DateTime? since = null)

Or even adding client properties allowing hard coded asset pairs.

new KrakenClient(...).BTCEUR.GetRecentTrades(DateTime.UtcNow.AddDays(-1));

Would you accept these kind of contributions into the core library?
Alternatives would be a wrapper but it would have to duplicate all models.

Adding Orders with await Task.WhenAll() sends EAPI:Invalid nonce

Hi I'm sending adding a list of taks to execute AddStandardOrder method in parallel like this:

var ordersToSend = new List<Task<KrakenResponse>>();
foreach (var op in pair.Operations)
{
ordersToSend.Add(_client.AddStandardOrder(
pair: op.Pair,
type: op.TradeType,
orderType: op.OrderType,
volume: op.Volume,
price: op.TradeType == "buy" ? op.Buy : op.Sell,
expireTime: expireTime,
validate: _conf.AppConfig.Exchanges[0].Validate == 1
));
}

var orders = await Task.WhenAll(ordersToSend);

But the Kraken API returns randomly the EAPI:Invalid nonce I'm executing no more that 3 orders at the same time

Add raw result to Kraken api call response

Hi, i'm developing a trading engine which is working with my own kraken client and i'd like to adopt this project!
First implementation i need i to have a raw response from the kraken api calls, because for example every 4 hours i save the file obtained in order to have weeks of data ready for backtesting.
For this reason if you agree i will do a PR with these implementations in bold italic

-in KrakenREsponse.cs

/// <summary>
/// Gets or sets the raw result of a request.
/// </summary>
public string Response { get; set; }

-in KrakenClient.cs

private async Task<KrakenResponse<T>> SendRequest<T>(HttpRequestMessage req, RateLimiter rateLimiter, int cost)
{
    // ...

    // Deserialize response.
    string jsonContent = await res.Content.ReadAsStringAsync().ConfigureAwait(false);
    var result = JsonConvert.DeserializeObject<KrakenResponse<T>>(jsonContent, JsonSettings);
    result.Response = jsonContent;

    // ...
}

AddStandardOrder with expiretime +<n> not working

AddStandardOrder does not work if the parameter expireTime (expiretime) is e.g. +60.

It seems like the parameters are applied via query string. So I assume they should be urlencoded. And as space were urlencoded as '+' the '+' is probably interpreted as a space.

So I think in KrakenClient the UrlEncode method should actually urlencode the Value. I did not want to have side effects so I just added:

args.Where(x => x.Value != null).Select(x => x.Key + "=" + x.Value.Replace("+", "%2B"))

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.