Commit Graph

22 Commits (db1e0a04f8cfe9f13594d92e87227f24ad18e19d)

Author SHA1 Message Date
Guillermo Rodriguez 0474d66531
Switch msgspec struct ordering to always have required fields first and optionals last 2023-01-09 18:43:50 -03:00
Tyler Goodlet 2cf1742999 Always apply at least the pos size as the limit 2022-09-21 15:43:35 -04:00
Tyler Goodlet d5c1cdd91d Configure allocator from pos msg on startup
This fixes a regression added after moving the msg parsing to later in
the order mode startup sequence. The `Allocator` needs to be configured
*to* the initial pos otherwise default settings will show in the UI..

Move the startup config logic from inside `mk_allocator()` to
`PositionTracker.update_from_pp()` and add a flag to allow setting the
`.startup_pp` from the current live one as is needed during initial
load.
2022-08-29 11:39:28 -04:00
Tyler Goodlet 46d3fe88ca Fix sub-slot-remains limiting for -ve sizes
In the short case (-ve size) we had a bug where the last sub-slots worth
of exit size would never be limited to zero once the allocator limit pos
size was hit (i.e. you could keep going more -ve on the pos,
exponentially per slot over the limit). It's a simple fix, just
a `max()` around the `l_sub_pp` var used in the next-step-size calc.

Resolves #392
2022-08-28 13:51:54 -04:00
Tyler Goodlet ae71168216 Change name `be_price` -> `ppu` throughout codebase 2022-07-27 12:18:36 -04:00
Tyler Goodlet 2baea21c7d Drop pydantic from allocator 2022-07-09 12:09:38 -04:00
Tyler Goodlet c617a06905 Port everything to `Position.be_price` 2022-06-28 10:07:56 -04:00
Tyler Goodlet 05a1a4e3d8 Use new `Position.bsuid` field throughout 2022-06-28 10:07:56 -04:00
Tyler Goodlet 1eb7e109e6 Start `piker.pp` module, LIFO pp updates
Start a generic "position related" util mod and bring in the `Position`
type from the allocator , convert it to a `msgspec.Struct` and add
a `.lifo_update()` method. Implement a WIP pp parser from a trades
ledger and use the new lifo method to gather position entries.
2022-06-28 10:07:56 -04:00
Tyler Goodlet ed03d77e6e Make a derivs intrustment type table for alloc config checks 2022-04-30 11:36:23 -04:00
Tyler Goodlet 772f871272 Use units by default for continuous futes 2022-04-30 11:36:23 -04:00
Tyler Goodlet 16b9e39e11 Dis-allow an allocator limit less then the current pp size 2022-03-02 10:05:33 -05:00
Tyler Goodlet c737de7c74 Rage drop the limit size unit enum 2021-11-05 10:05:11 -04:00
Tyler Goodlet 8f70398d88 Fix exit-slot-edge-case when only one discrete unit remains 2021-11-05 10:05:11 -04:00
Tyler Goodlet d706f35668 Keep slots ratio of 1 on derivs at startup 2021-11-05 10:05:11 -04:00
Tyler Goodlet f4740da6a2 Drop `.accounts` field from allocator 2021-09-14 13:10:39 -04:00
Tyler Goodlet f81d47efc4 Detail some comments 2021-09-11 13:10:20 -04:00
Tyler Goodlet 15aba154f2 Return account name in next order info 2021-09-09 10:33:52 -04:00
Tyler Goodlet 0d2cddec9a Return accounts in `bidict` 2021-09-08 14:01:54 -04:00
Tyler Goodlet 09d34f7355 Make `accounts` field public, add an account name method 2021-09-07 09:21:55 -04:00
Tyler Goodlet d38a6bf032 Create alloc instance in factory body, template out defaults loading 2021-09-07 08:38:24 -04:00
Tyler Goodlet 214c622328 Move allocator components to clearing sub-pkg 2021-09-06 22:05:42 -04:00