microwavedcola1
4e9f27ddbc
todo
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-23 20:31:10 +01:00
microwavedcola1
51e3a671e3
make public
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-23 17:31:50 +01:00
microwavedcola1
80f4bd8048
security admin can bring markets to reduce only ( #394 )
...
* security admin can bring markets to reduce only
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review; security admin can only turn on reduce only, security admin can only reduce init asset weight
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* --wip-- [skip ci]
* 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-23 15:02:48 +01:00
microwavedcola1
64dda20cb5
group level token deposit limit ( #415 )
...
* group level token deposit limit
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
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-23 14:58:03 +01:00
microwavedcola1
f0c797a2e4
zero out perp position and orders for a broken market ( #413 )
...
* zero out perp position and orders for a broken market
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* client code
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-23 12:50:20 +01:00
microwavedcola1
c30fa1dbb3
client support for security admin ( #414 )
...
* client support for security admin
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* update script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-23 12:02:36 +01:00
Christian Kamm
b3aabfadfc
Perp: Clarify has_open_orders use during liquidation ( #412 )
2023-01-23 10:45:45 +01:00
microwavedcola1
308bc307fe
update idl
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-21 14:12:51 +01:00
microwavedcola1
469ace8265
Fix call
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-21 14:10:34 +01:00
microwavedcola1
5e934760c1
debug perp: observe that base positions cancel each other out, and un… ( #397 )
...
* debug perp: observe that base positions cancel each other out, and unsettled pnl also cancels each out
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* dont log account level details
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-21 12:43:25 +01:00
microwavedcola1
265f6a1a48
add helper method: settleTokenNativeToUi ( #405 )
...
* add helper method: settleTokenNativeToUi
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Revert "add helper method: settleTokenNativeToUi"
This reverts commit 43b19b3056
.
* we can assume that quote is always in usd
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-21 11:35:43 +01:00
microwavedcola1
800fe73a9c
abort if new tokens or perp markets listed ( #411 )
...
* abort if new tokens or perp markets listed
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-21 11:35:31 +01:00
silas
3f0ed5978c
ci: add PR labels and combine workflows ( #407 )
...
* Automatically labels PRs based on change paths to make it easier to see what is in scope of a PR at a glance
* Merges dependency security scanning into single CI workflows for Rust/TS changes
2023-01-20 13:57:09 +00:00
microwavedcola1
bb35aa66dc
ensure that freshly fetched objects have valid prices until we fetch … ( #409 )
...
* ensure that freshly fetched objects have valid prices until we fetch oracles again
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
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-20 14:52:43 +01:00
Christian Kamm
8b4a4c82fb
Perp: move Book::new_order() code around
2023-01-20 14:42:35 +01:00
Christian Kamm
be37f33946
Perp: Add PerpOpenOrder::is_active_for_market()
2023-01-20 14:42:35 +01:00
Christian Kamm
30ebf173ee
Perp: documentation in bookside_iterator.rs
2023-01-20 14:42:35 +01:00
Christian Kamm
d65e0794f4
Perp: Documentation in nodes.rs
2023-01-20 14:42:35 +01:00
Christian Kamm
549d9a8108
Perp: Remove EventQueue::empty() - is_empty() exists as well
2023-01-20 14:42:35 +01:00
Christian Kamm
1b4140c078
Perp: Don't allow orders with effective price_lots<1
2023-01-20 14:42:35 +01:00
microwavedcola1
8bf6210991
better debug logs
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-20 09:15:03 +01:00
microwavedcola1
3fd8d7f615
add sim health calls to debug script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-20 08:29:36 +01:00
Christian Kamm
e7b51d1dbf
Perp: Simplify consume events ( #406 )
2023-01-19 13:41:36 +01:00
Christian Kamm
a28fd49099
Delete perp_liq_bankruptcy again
...
Snuck back in in unrelated PR, but was unused
2023-01-19 12:59:24 +01:00
microwavedcola1
919f09bb8c
fix bug where serum oo where not loaded ( #403 )
...
* fix bug where serum oo where not loaded
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-19 11:31:54 +01:00
microwavedcola1
44f599ca62
dont process orders which have 0 lots; dont return early, we still want to apply ioc penalty ( #404 )
...
* skip iteration if the incoming order has no lots to process
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-19 11:29:00 +01:00
tylersssss
8fb231f2fc
fix getAverageEntryPrice so it divides instead of multiplies ( #402 )
2023-01-19 10:52:49 +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
2db617cea5
Perp ix: Mention and reference important constraints
2023-01-19 09:33:27 +01:00
Christian Kamm
f16f1a6c92
Perp market field documentation pass
2023-01-19 09:31:59 +01:00
Christian Kamm
0a86257309
Perp: Move best_price/impact_price from Orderbook to BookSide
2023-01-19 09:31:59 +01:00
Christian Kamm
886a6696da
Perp audit: ix constraint fixes ( #399 )
2023-01-19 09:31:03 +01:00
microwavedcola1
fbbce98ec3
simply debug user
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-18 20:15:04 +01:00
Christian Kamm
7d74c5a6a6
Liquidator: Change metric printing interval to 10min
2023-01-18 12:28:43 +01:00
Christian Kamm
ff90c85874
Liquidator: reduce perp base pos if possible ( #398 )
...
- send reduce-only ioc order if possible
- settle pnl if needed
- deactivate position
2023-01-18 10:50:23 +01:00
riordanp
2f78bd336f
Add oracleLastUpdatedSlot to Bank and PerpMarket ( #395 )
...
* Parse last updated slot from oracle
* Fix typo
* Remove unused package
2023-01-17 18:03:16 +00:00
Christian Kamm
71b13efc95
Bump program version to v0.4.0
2023-01-17 15:01:04 +01:00
Christian Kamm
eb14518482
v0.3.0 deployment notice
2023-01-17 14:59:04 +01:00
Christian Kamm
5eb1472471
Changelog for v0.3.0
2023-01-17 14:50:08 +01:00
microwavedcola1
be15f54225
agg pub slot was recent even if price was not updated, switch to last slot which seems more relevant ( #393 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-17 14:48:06 +01:00
Christian Kamm
9346c8e546
Perps: track overall realized pnl relating to a position ( #392 )
...
This includes trade pnl, funding and fees. Tracking this makes it easier
for uis to display a consistent position overall pnl value that doesn't
decrease by settling.
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-17 14:07:58 +01:00
Adrian Brzeziński
6206bbb953
Merge pull request #389 from blockworks-foundation/feature/close-mango-account
...
Feature/close mango account
2023-01-17 12:46:42 +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
Christian Kamm
da1dfb2c3c
Add a liquidation test case for negative pnl ( #388 )
2023-01-16 12:30:34 +01:00
microwavedcola1
6d801bb4b0
log oracle address for quickly identifying which oracle belongs to which bank, remove accounts since its spammy
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-16 12:26:44 +01:00
Adrian Brzeziński
572a80d1d0
review fix
2023-01-15 01:31:06 +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
Adrian Brzeziński
d2b8d76ab6
fix
2023-01-13 23:32:12 +01:00
Adrian Brzeziński
e3bf0adca2
fix
2023-01-13 18:59:22 +01:00
Adrian Brzeziński
448cdf7c09
fix
2023-01-13 18:54:25 +01:00