microwavedcola1
3fe008da8b
Fix extraction of amount for token account and mm Procfile
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 15:08:05 +01:00
Christian Kamm
cfcda705e6
Bump program version to v0.8.0
2023-02-22 14:49:18 +01:00
Christian Kamm
de0f1a7458
Changelog for program v0.7.0 and idl update
2023-02-22 13:34:51 +01:00
microwavedcola1
e5b7b6fdb1
--wip-- [skip ci]
2023-02-22 10:25:22 +01:00
microwavedcola1
15390043c0
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
microwavedcola1
c0cfc50e7e
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
microwavedcola1
92560f240f
--wip-- [skip ci]
2023-02-22 09:49:15 +01:00
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
tylersssss
f41f2ab337
Ts/client fixes ( #471 )
...
* fix bug with marking perp orders as expired
* support passing in perp books to find mango account orders
* support force reloading of acct perp open orders
* make perp market _bids and _asks public
* dont fetch open order accts if no serum3active
2023-02-22 08:07:06 +01:00
microwavedcola1
ae761c9270
support 32 perp oo by default ( #467 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 10:40:15 +01:00
tylersssss
a87705fa37
fix fillevent type in client ( #460 )
2023-02-16 10:55:12 +01:00
Christian Kamm
023d2f96cb
Settle pnl: Don't avoid settlement on being_liquidated accounts
...
The action doesn't decrease health and is already limited by
perp-settle-health, so it's fine to allow. (the instruction already
allows it, this fix is just for finding counterparties)
2023-02-15 15:11:58 +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
Christian Kamm
820ab36209
Update idl
2023-02-14 16:04:37 +01:00
Adrian Brzeziński
02321e705f
excude perp oracle pk from helthaccount during close account inst
2023-02-13 16:54:14 +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
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
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
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
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
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
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
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
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
66ac32fd4e
Fix script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-01 13:41:19 +01:00
microwavedcola1
a11cbdba21
mm: improve logging ( #408 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-01 09:58:19 +01:00
microwavedcola1
9039e2c586
try exporting explicitly
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-30 14:55:25 +01:00
microwavedcola1
3ad0b39926
add export
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-30 14:37:01 +01:00
microwavedcola1
3d062e8edd
update idl
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-27 18:44:22 +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
microwavedcola1
0192728efc
return order id from a perp place order ix ( #417 )
...
* return order id from a perp place order ix
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-25 09:03:35 +01:00
microwavedcola1
8f8f87727d
update script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-25 09:00:38 +01:00
microwavedcola1
482f43d9ed
update script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 18:05:37 +01:00
microwavedcola1
7ed6e03f34
update script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 17:58:23 +01:00
microwavedcola1
0b3a69631c
update script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 17:52:21 +01:00
microwavedcola1
64b0dd5fdb
Fix env var
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 17:44:43 +01:00
microwavedcola1
1e046685a9
small fix + helper method
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 17:44:22 +01:00
Christian Kamm
1224fa4297
Bump program version to v0.5.0
2023-01-24 10:24:50 +01:00
microwavedcola1
629eaafaf3
add alternative mngo oracle
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-24 07:20:38 +01:00