This is the cl-kraken Reference Manual, version 0.0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:06:02 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-kraken
cl-kraken/src/main
cl-kraken/src/http
cl-kraken/src/globals
cl-kraken/src/cryptography
cl-kraken/src/time
cl-kraken
A Common Lisp API client for the Kraken exchange
Jon Atack <jon@atack.com>
MIT
0.0.3
cl-kraken/src/main
(system).
cl-kraken/src/main
Jon Atack <jon@atack.com>
MIT
cl-kraken/src/http
(system).
cl-kraken/src/http
Jon Atack <jon@atack.com>
MIT
dexador
(system).
jsown
(system).
quri
(system).
cl-kraken/src/globals
(system).
cl-kraken/src/cryptography
(system).
cl-kraken/src/time
(system).
cl-kraken/src/cryptography
Jon Atack <jon@atack.com>
MIT
ironclad
(system).
cl-base64
(system).
quri
(system).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-kraken/cl-kraken.asd
cl-kraken/src/main/file-type.lisp
cl-kraken/src/http/file-type.lisp
cl-kraken/src/globals/file-type.lisp
cl-kraken/src/cryptography/file-type.lisp
cl-kraken/src/time/file-type.lisp
cl-kraken/src/main/file-type.lisp
cl-kraken/src/main
(system).
asset-pairs
(function).
assets
(function).
balance
(function).
depth
(function).
ohlc
(function).
server-time
(function).
spread
(function).
ticker
(function).
trade-balance
(function).
trade-volume
(function).
trades
(function).
cl-kraken/src/http/file-type.lisp
cl-kraken/src/http
(system).
request
(function).
get-public
(function).
post-http-headers
(function).
post-private
(function).
cl-kraken/src/globals/file-type.lisp
cl-kraken/src/globals
(system).
*api-key*
(special variable).
*api-secret*
(special variable).
+api-host+
(special variable).
+api-private-path+
(special variable).
+api-public-path+
(special variable).
+api-scheme+
(special variable).
+api-version+
(special variable).
+version+
(special variable).
cl-kraken/src/cryptography/file-type.lisp
cl-kraken/src/cryptography
(system).
signature
(function).
hash-sha256
(function).
hmac-sha512
(function).
message
(function).
cl-kraken/src/time/file-type.lisp
cl-kraken/src/time
(system).
generate-kraken-nonce
(function).
unix-time-in-microseconds
(function).
+one-million+
(special variable).
+one-thousand+
(special variable).
Packages are listed by definition order.
cl-kraken/src/time
CL-Kraken time utilities.
common-lisp
.
generate-kraken-nonce
(function).
unix-time-in-microseconds
(function).
+one-million+
(special variable).
+one-thousand+
(special variable).
cl-kraken/src/cryptography
Cryptographic functions for authenticating private POST requests.
common-lisp
.
signature
(function).
hash-sha256
(function).
hmac-sha512
(function).
message
(function).
cl-kraken/src/http
HTTP request functions.
common-lisp
.
request
(function).
get-public
(function).
post-http-headers
(function).
post-private
(function).
cl-kraken
CL-Kraken is Common Lisp client for the Kraken cryptocurrency exchange. Copyright (c) 2019-2020 Jon Atack <jon@atack.com>. See LICENSE for details. The Kraken API is documented here: https://www.kraken.com/help/api.
cl-kraken/src/main
common-lisp
.
asset-pairs
(function).
assets
(function).
balance
(function).
depth
(function).
ohlc
(function).
server-time
(function).
spread
(function).
ticker
(function).
trade-balance
(function).
trade-volume
(function).
trades
(function).
cl-kraken/src/globals
CL-Kraken global parameters, variables and constants.
common-lisp
.
*api-key*
(special variable).
*api-secret*
(special variable).
+api-host+
(special variable).
+api-private-path+
(special variable).
+api-public-path+
(special variable).
+api-scheme+
(special variable).
+api-version+
(special variable).
+version+
(special variable).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Get tradeable asset pairs.
URL: https://api.kraken.com/0/public/AssetPairs
Input:
‘pair’ = optional, comma-delimited, case-insensitive asset pair string;
if not provided, defaults to all pairs.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is a hash of pair keys, each with a values hash containing:
‘altname’ = alternate pair name
‘aclass_base’ = asset class of base component
‘base’ = asset id of base component
‘aclass_quote’ = asset class of quote component
‘quote’ = asset id of quote component
‘lot’ = volume lot size
‘pair_decimals’ = scaling decimal places for pair
‘lot_decimals’ = scaling decimal places for volume
‘lot_multiplier’ = multiply lot volume by this to get currency volume
‘leverage_buy’ = array of leverage amounts available when buying
‘leverage_sell’ = array of leverage amounts available when selling
‘fees’ = fee schedule array in [volume, percent fee] tuples
‘fees_maker’ = maker fee schedule array in [volume, percent fee]
tuples (if on maker/taker)
‘fee_volume_currency’ = volume discount currency
‘margin_call’ = margin call level
‘margin_stop’ = stop-out/liquidation margin level
If an asset pair is on a maker/taker fee schedule, the taker side is given in
‘fees’ and maker side in ‘fees_maker’.
For asset pairs not on maker/taker, the rates will only be given in ‘fees’.
Get asset info.
URL: https://api.kraken.com/0/public/Assets
Input:
‘asset’ = optional, comma-delimited, case-insensitive asset list string;
if not provided, defaults to all assets.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is a hash of asset name keys, each with a values hash containing:
‘altname’ = alternate name, like EUR, USD, XBT
‘aclass’ = asset class, currently always set to ’currency’
‘decimals’ = decimal places for record keeping
‘display_decimals’ = decimal places for display (usually fewer)
Get order book public price data for an asset pair.
URL: https://api.kraken.com/0/public/Depth
Input:
PAIR = required single asset pair for which to query order book
COUNT = optional integer of maximum asks and bids to receive
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is an array containing a pair name and the keys ‘asks’ and ‘bids’
each followed by an array of ‘price’, ‘volume’, and ‘timestamp>’.
Kraken requires the nonce to be an always-increasing unsigned integer between 51 and 64 bits in length. For this, we use UNIX-TIME-IN-MICROSECONDS below, expressed as a string. This is analogous to the nonce implementations in the various other Kraken API libraries in C, C++, Go, Python, and Ruby.
Get OHLC (Open, High, Low, Close) public price data for an asset pair.
URL: https://api.kraken.com/0/public/OHLC
Input:
PAIR = required single asset pair for which to query OHLC data
INTERVAL = optional integer time interval in minutes defaulting to 1,
permitted values are 1, 5, 15, 30, 60, 240, 1440, 10080, 21600;
Kraken returns an Invalid Arguments error for other values
SINCE = optional integer Unix Time id from when to return new committed
OHLC data, corresponding to previous OHLC ‘last’ values.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is an array containing a pair name and a ‘last’ Unix Time id.
- The pair name contains an array of arrays, each containing values for
‘time’, ‘open’, ‘high’, ‘low’, ‘close’, ‘VWAP’, ‘volume’ and ‘count’.
- ‘last’ is a Unix Time id for the current not-yet-committed frame.
Useful as value for SINCE when querying for new committed OHLC data.
General HTTP GET/POST request and JSON parsing function.
Get server time. Useful to approximate skew time between server and client.
URL: https://api.kraken.com/0/public/Time
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is an array of hashes with keys:
‘unixtime’ = unix timestamp
‘rfc1123’ = RFC 1123 time format
Signature generated from the HMAC SHA512 of a message and key:
message = (PATH + SHA256(NONCE + POST DATA)) in octets
key = base64-decoded SECRET in octets
Before returning, the signature is converted from octets to a base64 string.
Get recent spread data for an asset pair.
URL: https://api.kraken.com/0/public/Spread
Input:
PAIR = required single asset pair for which to query spread data
SINCE = optional integer Unix Time id from when to return spread data,
corresponding to previous spread ‘last’ values.
Note: SINCE is inclusive, so any returned data with the same time as
a previous set should overwrite all of the previous set’s entries.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is an array containing a pair name and a ‘last’ Unix Time id.
- The pair name contains an array of arrays for ‘time’, ‘bid’, and ‘ask’.
- ‘last’ is a Unix Time id to use for SINCE when querying new spread.
Get ticker data for asset pairs.
URL: https://api.kraken.com/0/public/Ticker
Input:
‘pair’ = required comma-delimited list of one or more asset pairs.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is a hash of pair keys, each with a values hash of ticker data:
a = ask array (price, whole lot volume, lot volume)
b = bid array (price, whole lot volume, lot volume)
c = last trade closed array (price, lot volume)
v = volume array (today, last 24 hours)
p = volume weighted avg price array (today, last 24 hours)
t = number of trades array (today, last 24 hours)
l = low array (today, last 24 hours)
h = high array (today, last 24 hours)
o = opening price (today, at 00:00:00 UTC)
Get trade volume.
URL: https://api.kraken.com/0/private/TradeVolume
Input:
PAIR = optional, comma-delimited, case-insensitive asset pair string;
if not provided, defaults to all pairs.
FEE-INFO = optional boolean whether or not to include fee info in results.
Note: Currently appears to be not implemented by Kraken, since
the fee info is always returned.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is a hash of pair keys, each with a values hash containing:
‘currency’ = volume currency
‘volume’ = current discount volume
‘fees’ = array of asset pairs with *taker* fee tier data
‘fee’ = current fee in percent
‘minfee’ = minimum fee for pair (if not fixed fee)
‘maxfee’ = maximum fee for pair (if not fixed fee)
‘nextfee’ = next tier’s fee for pair
(if not fixed fee, nil if at lowest fee tier)
‘nextvolume’ = volume level of next tier
(if not fixed fee, nil if at lowest fee tier)
‘tiervolume’ = volume level of current tier
(if not fixed fee, nil if at lowest fee tier)
‘fees_maker’ = array of asset pairs with *maker* fee tier data for any
pairs on a maker/taker fee schedule
‘fee’ = current fee in percent
‘minfee’ = minimum fee for pair (if not fixed fee)
‘maxfee’ = maximum fee for pair (if not fixed fee)
‘nextfee’ = next tier’s fee for pair
(if not fixed fee, nil if at lowest fee tier)
‘nextvolume’ = volume level of next tier
(if not fixed fee, nil if at lowest fee tier)
‘tiervolume’ = volume level of current tier
(if not fixed fee, nil if at lowest fee tier)
If an asset pair is on a maker/taker fee schedule, the taker side is given in
‘fees’ and maker side in ‘fees_maker’.
For asset pairs not on maker/taker, the rates will only be given in ‘fees’.
Get recent trades public price data for an asset pair.
URL: https://api.kraken.com/0/public/Trades
Input:
PAIR = required single asset pair for which to query trades data
SINCE = optional integer timestamp id from when to return new trades data,
corresponding to previous trades ‘last’ values.
Kraken returns a hash with keys ‘error’ and ‘result’.
‘result’ is an array containing a pair name and a ‘last’ Unix Time id.
- The pair name is followed by an array of maximum 1000 trades containing
‘price’, ‘volume’, ‘time’, ‘buy/sell’, ‘market/limit’, ‘miscellaneous’.
- ‘last’ is a timestamp id to use for SINCE when querying new trades.
Unix Time in usec using SBCL’s SB-EXT:GET-TIME-OF-DAY.
This is an empty account for testing. Replace this value with your API key.
This is an empty account for testing. Replace this vaule with your API secret.
HTTP GET request for public API queries.
Evaluates to an SHA256 digest of the message. Input and output in octets.
Evaluates to an HMAC SHA512 signature. Inputs and output in octets.
(PATH + SHA256(NONCE + POST DATA)) in octets.
Kraken POST HTTP headers must contain the API key and signature.
HTTP POST request for private authenticated API queries.
Jump to: | A B D F G H M O P R S T U |
---|
Jump to: | A B D F G H M O P R S T U |
---|
Jump to: | *
+
S |
---|
Jump to: | *
+
S |
---|
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|