Commit Graph

7 Commits

Author SHA1 Message Date
tylersssss 4c9f99832f
Update package.json build steps and move js scripts out of src folder (#470)
* extracts scripts from source; update tsc build configs and packages

* publish latest

* remove type module
2023-02-22 08:36:59 +01:00
Christian Kamm a91a9ae998
Perp: Fix liq instructions (#424)
- Rename to perp_liq_base_or_positive_pnl and perp_liq_negative_pnl_or_bankruptcy
- Deal with situations where overall asset weight is zero and base position reduction
  would not improve liqee health
- Add ability for liqors to take over positive unsettled pnl if that improves liqee health
2023-02-02 09:00:37 +01:00
Christian Kamm 50c820ddce
Perps: Rename pnl_asset_weight -> overall_asset_weight (#428)
Calling it "pnl" was confusing, because the thing that is weighted isn't
the pnl, but `(weighted base value + quote position)`.
2023-02-01 16:15:45 +01:00
microwavedcola1 0012907ee3
Mc/ix toggler (#419)
* add gating to individual ixs

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-26 20:27:39 +01:00
Christian Kamm 1a3d0da34a Perp market edit: Separate out stable price resetting, like for tokens 2023-01-19 09:33:27 +01:00
Christian Kamm ec99376a8f
Perp: Allow setting pnl asset weights (#391)
This replaces the previous distinction between trusted and untrusted
markets, they are equivalent to setting the asset weights to 1 or 0
instead.

This way, we can weigh positive pnl in the trusted case at less than 1
which is more correct from a risk point of view and allows for more
flexibility when it comes to liquidation.

Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-16 16:49:09 +01:00
microwavedcola1 13dc5c061d
builder pattern for edit ixs (#387)
* builder pattern for edit ixs

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-14 14:09:26 +01:00