Position accounting refinements, bug fixes, src-asset-pnls, ledgerd
daemon
#515
Labels
accounting
prolly positioning: the accounting of "what/when (is) owned"
clearing
auction and mm tech: EMS, OMS, algo-trading
config
ledger
trade, accounts and other user focal event history tracking, management and storage
The major summary follow up to the
.accounting
subsys introduced in#489 this is the list of outstanding but needed features and bugfixes
that should be resolved asap!
The existing #478 was the older not-as-specific issue for this stuff..
The new set of top level issue-tasks are:
TOML
libs ->tomlkit
for style,tomli(-w)
for speed #496Position.clears
->.events
#510pp
indicators in sidepanel UX #224order_mode
further UX refinement ideas needing feedback #220The high level sections here are:
missing
accounting
calcs and documentationppu
,bep
)UI components to display the above ^
service daemon
ledgerd
oraccountd
to do bookkeeping out of threadMissing critical calcs and accounting:
as per Change
Position.clears
->.events
#510, makePosition.clears
->Position.events
as perChange
Position.clears
->.events
#510 to handle market specific accounting calc modifying occurrences(like stock splits)!
use transfers/withdrawals to modify the
Position.ppu
properly and graphically correct on chart!
add a
Position.bep
:Pertaining notes and tasks from legacy issues:
kraken
position tracking gotchas #263, the originalkraken
position tracking way back before we hadanything 😂
not spot?
https://docs.kraken.com/rest/#operation/getTradeBalance
result
keys are 😂50: https://docs.kraken.com/rest/#operation/getTradeHistory
kraken
: balance <-> position disparities with crypto/crypto pairs #373, morekraken
accounting todos from the comments:for wallet transfers out of an account we get
a
Transaction
-like entry in ouraccount.<>.<>.toml
of the form(note this is a non-real example):
price
field has aNan
valueppu
calc in the sense that on the next clear the weighting of the
position should be more right?
funds take no losses when (eventually) used, which seems like
the sanest way to copy with tracking this account's pp right?
then bring back the transferred out funds and begin to sell
them?
terms of the current next ppu weighting in this position?
xmr/btc
how do we project thatcontribution to this position?
in this case?
projection of
btc/eur
, which would provide the source/basepnl from preceding trades as they contribute to the projection
to EUR; seems like the calculation needs to be
recursive and rely heavily on time stamps?
we aren't tabulating nor using the widthdrawal fee
schedule in our cost field in each ledger entry, obviously this should
resolve any accounting discrepancies a transfer-as-sell clear
should have a cost (that kraken takes) as part of the position calc.
UI stuff we'll probably be innovators of..
How about historical position line graphics on charts which show
breakeven price changes overlayed with actual underlyings, aka pp
liftetime "lines" more or less as super simple FSP style graphics that
show the beginning, changes, and end to a given pp such that users can
easily see past trades and their state changes on top of historical data
🏄
order_mode
further UX refinement ideas needing feedback #220 and much idea-ing during Rekt pps? problem? =>piker.accounting
#489real-time update with flat lines.
given the current level line value B)
will change both your ppu and bep!
lines?
breakeven or lifo prices per clear in the
account<broker>.<account>.toml
configured which could make it easy to enter contextual short term
trades despite an overall breakeven price, egs:
play a bounce so you complete a bounce trade and make a profit and
then your be price goes back to what it was before the scalp trade
your be would bring it's mean price up) and want to show your
original longer term be_price after the trade completes
display as a curve overlay to the actual price history?
the theoretical paper engine clearing history for something like
this:
Add a
ledgerd
actor-daemon?Should we consider a separate actor-service:
ledgerd
which can do allledger record monitoring (via connections to
emsd
) and writingout-of-process from
brokerd
/datad
such that all other actors onlydeal with position data via msgs?
Currently the fs IO is directly serving latency for broker backends
which call this code in thread during startup and possibly on clearing
/ updates.
Premises:
obvsly for testing..
Solutions:
a singleton-style actor that listens to msgs from the ems and
does all the work of computing positions and recording them to
whatever backing storage sys we have (for now
account.broker.account.toml
files) and thus can operate as thewriter in a readers-writer style lock around file access.
we should add support for immediate config file
(ledger or
pps.toml
) writingpiker.accounting
#489 via commit 2f31e40apis
which use a bg thread to avoid main thread latency.
can we make a better incremental update system;
engine, per clear, and in various brokers. backends inside the
trades_dialogue() endpoint.
filesystem format (like parquet? something binary?) we can probably
accomplish this rather easily.
only do ledger file writes on teardown/api-block exit by defaultThe text was updated successfully, but these errors were encountered: