Commit Graph

1679 Commits

Author SHA1 Message Date
microwavedcola1 a53e1e6daa keeper fix filter
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-15 09:18:07 +01:00
Christian Kamm 8916c28b99
License: Mark instructions GPLv3 and everything else MIT (#454)
To do that, split up the Accounts objects and the instruction
implementations.

GPL code is only used when the "enable-gpl" feature is enabled. That
means compiling the program or running tests need explicit feature
activation now.
2023-02-15 08:42:07 +01:00
microwavedcola1 719f14a900 fix for clippy
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-15 08:38:21 +01:00
microwavedcola1 fa41c1c543
keeper: dont try to update mngo-perp-old since its in reduce only with no oi (#455)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-15 08:14:28 +01:00
Christian Kamm 30a84ce6c0 Bump to program version to v0.7.0 2023-02-14 16:09:53 +01:00
Christian Kamm 4ee591e991 Add program v0.6.0 release info 2023-02-14 16:07:15 +01:00
Christian Kamm 820ab36209 Update idl 2023-02-14 16:04:37 +01:00
Christian Kamm 8eb177fb32 Changelog for program v0.6.0 2023-02-14 16:03:34 +01:00
Christian Kamm f6abd9579d
Perp cancel all: Don't error when orders are filled/expired (#453) 2023-02-14 10:44:51 +01:00
microwavedcola1 02d980f4e4
restrict what a security admin can do (#452)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-13 20:02:47 +01:00
Adrian Brzeziński 5534b9e46b
Merge pull request #451 from blockworks-foundation/feature/fix-close-account
exclude perp oracle pk from helthaccount during close account inst
2023-02-13 16:58:15 +01:00
Adrian Brzeziński 02321e705f excude perp oracle pk from helthaccount during close account inst 2023-02-13 16:54:14 +01:00
riordanp 6139c716ba
Add doc generation job (#450)
* Add doc generation job

* Debug cargo doc

* Checkout submodules

* Remove unused build artifacts

* Remove debug commands

* Build on pushes to dev and main
2023-02-13 08:29:50 +01:00
Christian Kamm 1f66bef88f
Change liquidation end target to a new, third health type (#447)
Due to the safety features in v4, the init health can differ from maint
health a lot more than it used to in v3. This is because of stable-price
adjusted oracle prices used in init health, and the weight scaling based
on total deposits and borrows used in init health.

The effect is that once an account becomes liquidatable, it could be
liquidated a lot until it reaches init>=0.

The original idea of liquidating until init>=0 was just to provide some
buffer, such that liquidated accounts wouldn't immediately become
liquidatable again.

This patch decouples the buffer idea explicit from init health by
creating a new LiquidationEnd health type. Liquidation proceeds until
the LiquidationEnd health becomes positive.

Co-authored-by: microwavedcola1 <89031858+microwavedcola1@users.noreply.github.com>
2023-02-10 09:00:36 +01:00
microwavedcola1 b2b029e21e
upgrade a bunch of ts packages (#449)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-09 18:02:28 +01:00
microwavedcola1 184cf82e22
update settle limit before returning settleable pnl (#445)
* update settle limit before returning settleable pnl

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

* Revert "update settle limit before returning settleable pnl"

This reverts commit 29e38a85ef.

* provide a canSettlePnl to reflect constraints in perp settle pnl ix

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-02-09 13:31:56 +01:00
microwavedcola1 74a6c72f45
fix log amount in token deposit (#446)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-09 13:31:41 +01:00
Christian Kamm e65eb79860
CI: Fix soteria action (#443) 2023-02-09 11:28:53 +01:00
silas 5e637c3b79
change 'ci' to 'devops' label (#444) 2023-02-09 10:14:09 +01:00
microwavedcola1 a1b3b8bfc0 set start quote on banks
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-08 10:41:58 +01:00
microwavedcola1 0639681c33 configure max staleness slots
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-08 10:29:11 +01:00
microwavedcola1 0dba464a28 make dai reduce only
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-08 10:19:47 +01:00
Christian Kamm 2cb4da8b58
Liquidation: Fix amounts when stable price != oracle price (#440)
Previously liquidation would overestimate the amount required, because
it used the oracle price for computing the health gain from
liquidation.

Now it uses the correct (stable price adjusted) price for figuring out
the amount of liquidation required, while still executing at
fee-adjusted oracle price.
2023-02-08 09:05:17 +01:00
riordanp e4bcb218a2
Add branch labels to docker images (#441) 2023-02-07 15:48:44 +01:00
microwavedcola1 d4a41aa96e
various readme updates (#431)
* add release notes

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

* Update readme

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

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-06 11:59:22 +01:00
microwavedcola1 4e3a7f22b9
remove perp zero out, was only added to cleanup testing perp market, can be re-added if needed (#430)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-06 11:59:12 +01:00
Christian Kamm 257aeb298c
Enable release-mode overflow checks (#438)
The checked_math macro is still needed for I80F48 though
2023-02-06 08:33:08 +01:00
Maximilian Schneider 4c9490f004
update serum to most recent openbook version (#437) 2023-02-05 10:26:04 +09:00
Christian Kamm 75ec640820 liqtest: script fixes
- perp market should have zero asset weight to allow positive pnl
  takeover tests
- stable price should be reset, to allow better reasoning about health
2023-02-03 17:23:25 +01:00
Christian Kamm cbd3d915ba liqtest: Confirm ALT tx before proceeding
Not waiting can leave the alt-create and alt-extend in the same slot,
and ordered incorrectly.
2023-02-03 17:23:25 +01:00
Christian Kamm 3b9e8c7d2b ts: Add new convenience sendAndConfirmTx function 2023-02-03 17:23:25 +01:00
Christian Kamm 6c8204e9ef ts: Allow control over tx confirmation commitment level
When talking to a load balanced endpoint it can be useful to read data
from rpc nodes at processed while waiting for confirmed commitment
on transactions.
2023-02-03 17:23:25 +01:00
Christian Kamm 38d408126e client: Increase binary search iter limit 2023-02-03 17:23:25 +01:00
Christian Kamm 2ca430eaa7 rust client: Fix slippage arg for jupiter 2023-02-03 17:23:25 +01:00
Christian Kamm d0260e071c rust client: Find settle pnl counterparties on the same group only 2023-02-03 17:23:25 +01:00
microwavedcola1 0ba7ecd506 Fix health region ix code
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-02 19:02:30 +01:00
microwavedcola1 a6a07307b0 fix mm
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-02 18:58:08 +01:00
Christian Kamm d9a253947c
ts: add back tokenWithdrawNative() (#434) 2023-02-02 15:08:57 +01:00
Christian Kamm 51a649ac60
Rust client: Add prioritization fee option (#433) 2023-02-02 14:23:33 +01:00
Christian Kamm 628feafcb0
ts: Use sendAndConfirmTransaction instead of anchor's .rpc() (#432)
This allows us to configure a prioritization fee for these calls.
2023-02-02 14:23:22 +01:00
Christian Kamm 40696f40a1 Bump program version to 0.6.0 2023-02-02 10:54:54 +01:00
Christian Kamm 9cf66f5e7a Program v0.5.0 deployment info 2023-02-02 10:52:50 +01:00
Christian Kamm 828a18f990 Changelog for program v0.5.0 2023-02-02 10:46:39 +01:00
Nicholas Clarke 4c93a2740a
Add market index to Serum3OpenOrdersBalanceLog (#429) 2023-02-02 10:01:19 +01:00
Christian Kamm df1f7418af update idl 2023-02-02 09:17:22 +01:00
Christian Kamm 5328003183
Perp: Reorganize fill events, add client order id to LeafNodes (#426)
- don't store internal order ids: unneeded
- provide the maker client order id for user correlation
- store fees as f32 to waste fewer bytes
- new FillLogV2
2023-02-02 09:15:06 +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 bac15698e6
Add explicit self-liquidation checks (#427)
Just for safety, the other conditions and borrowing pattern would
already make it impossible.
2023-02-01 16:15:58 +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 b84212aeed add script to rename tag added by npm
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-01 13:49:31 +01:00