discosultan / krakencore Goto Github PK
View Code? Open in Web Editor NEW๐ฑ .NET client for Kraken Bitcoin & cryptocurrency exchange API
License: MIT License
๐ฑ .NET client for Kraken Bitcoin & cryptocurrency exchange API
License: MIT License
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.
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
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
Is there a nuget package for this??
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"))
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;
// ...
}
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.