piker/piker/brokers/kraken
Guillermo Rodriguez f5b8b9a14f
Add sym registry to PaperBoi as well as a sym ref on Transaction
Add decimal quantize API to Symbol to simplify by-broker truncation
Add symbol info to `pps.toml`
Move _assert call to outside the _async_main context manager
Minor indentation and styling changes, also convert a few prints to log calls
Fix multi write / race condition on open_pps call
Switch open_pps to not write by default
Fix integer math kraken syminfo _tick_size initialization
2023-03-01 21:06:48 -03:00
..
README.rst Renames to `ppu` 2022-07-30 17:33:45 -04:00
__init__.py Create sub-pkg logger once during import 2022-07-05 16:59:47 -04:00
api.py `kraken.`: drop trade history query limit 2023-03-01 17:40:36 -05:00
broker.py Add sym registry to PaperBoi as well as a sym ref on Transaction 2023-03-01 21:06:48 -03:00
feed.py Add sym registry to PaperBoi as well as a sym ref on Transaction 2023-03-01 21:06:48 -03:00

README.rst

kraken backend

though they don't have the most liquidity of all the cexes they sure are accommodating to those of us who appreciate a little xmr.

status

current support is production grade and both real-time data and order management should be correct and fast. this backend is used by core devs for live trading.

config

In order to get order mode support your brokers.toml needs to have something like the following:

[kraken]
accounts.spot = 'spot'
key_descr = "spot"
api_key = "69696969696969696696969696969696969696969696969696969696"
secret = "BOOBSBOOBSBOOBSBOOBSBOOBSSMBZ69696969696969669969696969696"

If everything works correctly you should see any current positions loaded in the pps pane on chart load and you should also be able to check your trade records in the file:

<pikerk_conf_dir>/ledgers/trades_kraken_spot.toml

An example ledger file will have entries written verbatim from the trade events schema:

[TFJBKK-SMBZS-VJ4UWS]
ordertxid = "SMBZSA-7CNQU-3HWLNJ"
postxid = "SMBZSE-M7IF5-CFI7LT"
pair = "XXMRZEUR"
time = 1655691993.4133966
type = "buy"
ordertype = "limit"
price = "103.97000000"
cost = "499.99999977"
fee = "0.80000000"
vol = "4.80907954"
margin = "0.00000000"
misc = ""

your pps.toml file will have position entries like,

[kraken.spot."xmreur.kraken"]
size = 4.80907954
ppu = 103.97000000
bsuid = "XXMRZEUR"
clears = [
 { tid = "TFJBKK-SMBZS-VJ4UWS", cost = 0.8, price = 103.97, size = 4.80907954, dt = "2022-05-20T02:26:33.413397+00:00" },
]