microwavedcola1
b57b330d1f
increase size
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-29 09:19:31 +02:00
microwavedcola1
1da6493230
Merge branch 'deploy-mm' into ts-client
2023-03-28 07:47:10 +02:00
microwavedcola1
03250d44da
Merge branch 'deploy-mm' into dev
2023-03-28 06:39:27 +02:00
microwavedcola1
847a3bd618
increase size
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-27 20:29:37 +02:00
microwavedcola1
ef23d1406e
minor ts fixes
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-27 13:34:12 +02:00
microwavedcola1
c29c41e20f
Fix interest rate computation in client ( #520 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-27 10:39:26 +02:00
microwavedcola1
f866a49aa9
Fix interest rate computation in client ( #520 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-27 10:39:01 +02:00
microwavedcola1
6acb196c86
fix eth
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-26 16:52:23 +02:00
microwavedcola1
86b11b73fe
fix eth
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-26 16:48:33 +02:00
microwavedcola1
1f3a170886
add eth
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-26 16:46:10 +02:00
tjs
26d7ec505c
make decodePriceFromOracleAi fn public so websockets can update price
2023-03-25 13:37:02 -04:00
microwavedcola1
797e0bf91b
extend script, fix util function
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-22 14:30:25 +01:00
microwavedcola1
89f936c14a
add script to sim accounts with leverage change ( #514 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-22 09:58:20 +01:00
Maximilian Schneider
d0a546381f
Quality of life fixes ( #511 )
...
* breaking: make pegLimit an optional arg
* pass externally cached blockhashes to sendTransaction
* convenience accessors for connection & walletPk on client
2023-03-22 02:01:15 +04:00
microwavedcola1
2e2ac6118d
increase charge
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-21 13:04:55 +01:00
microwavedcola1
0edd11b3df
Merge branch 'ts-client' into deploy-mm
2023-03-20 19:30:06 +01:00
microwavedcola1
d5701372e2
quote less
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-20 19:23:47 +01:00
riordanp
fd4c69b1c2
Add fly deploy scripts ( #490 )
2023-03-20 14:59:43 +01:00
microwavedcola1
3838daf942
quote less
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-20 14:45:57 +01:00
microwavedcola1
fd0bd1d6d5
refactor script ( #509 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-20 13:57:32 +01:00
Christian Kamm
b7dd8e0663
Fee buyback: Respect USDC oracle ( #504 )
2023-03-20 11:18:11 +01:00
microwavedcola1
6406b61d6a
Add missing field on builder
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-20 08:57:27 +01:00
microwavedcola1
9c9509ec60
Merge branch 'ts-client-2' into dev
2023-03-20 08:56:33 +01:00
microwavedcola1
f381147bf6
Merge branch 'deploy-mm' into ts-client
2023-03-20 08:56:05 +01:00
Christian Kamm
91ee9b3e08
Temporarily disable health region use on mm script
2023-03-18 11:14:54 +01:00
Christian Kamm
f98dfafe24
ts: Fix ix gate enum, add code for creating a disable-tx gov ix
2023-03-18 10:56:45 +01:00
riordanp
a7ee8fb2c0
Fix null checks on getters for PerpMarket and Bank ( #505 )
...
* Export OracleProvider
* Fix null checks on getters
2023-03-16 10:10:52 +01:00
riordanp
da473b00b1
Add oracleProvider to Bank and PerpMarket ( #491 )
...
* Add oracleProvider to Bank and PerpMarket
2023-03-15 13:44:51 +00:00
microwavedcola1
1c0c444c3d
add missing field to group
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-13 19:35:13 +01:00
microwavedcola1
355ba59005
Fix script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-13 11:10:51 +01:00
microwavedcola1
2adf7da861
Merge branch 'main' into ts-client
2023-03-13 11:09:19 +01:00
Christian Kamm
68f9f38a3c
Update idl for v0.9.0
2023-03-12 08:37:52 +01:00
Christian Kamm
9a8cb3c7a9
Add idl-compare script to check for binary incompatibilities ( #498 )
2023-03-09 08:32:59 +01:00
microwavedcola1
cb8ee54d0f
Fix price unit used in health sim
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 13:08:54 +01:00
microwavedcola1
c7f577fc8e
Fix price unit used in get max perp trade size
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 12:50:41 +01:00
microwavedcola1
cfdfd2f8a0
cleanup
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 12:34:49 +01:00
microwavedcola1
dc2a3b79de
fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 12:34:19 +01:00
microwavedcola1
a00c65155a
quote more
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 08:33:29 +01:00
microwavedcola1
d9181fc4b5
Merge branch 'deploy-mm' into dev
2023-03-07 08:32:52 +01:00
microwavedcola1
679f8dd29b
some more logginh
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-07 08:32:44 +01:00
Nicholas Clarke
97895dfb1e
buyback fees with mngo logging ( #489 )
...
* buyback fees with mngo logging
* add logging of usdc balances for account_buyback_fees_with_mngo
2023-03-06 14:42:10 +01:00
microwavedcola1
fbeaf1d282
add sol qouting to config
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-04 12:51:09 +01:00
microwavedcola1
2d1f9bb207
add sol qouting to config
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-04 12:50:28 +01:00
Christian Kamm
252210d194
Serum settle funds V2: fees can go to users ( #484 )
...
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-03 14:04:45 +01:00
microwavedcola1
1950d8c84a
support name edit for token and program ( #488 )
...
* support name edit for token and program
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* undo
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-03-03 10:05:12 +01:00
microwavedcola1
71ef2c2d0b
add helper script to decode oracles
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-02 16:56:27 +01:00
microwavedcola1
3793ea0819
Fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-02 11:04:27 +01:00
microwavedcola1
b38bca5517
easy building of governance ixs
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-02 09:20:49 +01:00
microwavedcola1
f192c19fb8
Fix type
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-01 12:28:59 +01:00
microwavedcola1
925440b47e
Fix type
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-01 12:17:46 +01:00
microwavedcola1
6c5c88b1e6
fix access specifier
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-03-01 12:12:01 +01:00
microwavedcola1
c48d9c94d9
Fix types
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-28 15:04:28 +01:00
microwavedcola1
07c46d0129
Revert "fix account in client ix"
...
This reverts commit 1343e70cc6
.
2023-02-28 14:46:22 +01:00
microwavedcola1
1343e70cc6
fix account in client ix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-28 14:45:25 +01:00
microwavedcola1
73b626efff
ts client for max buyback of fees with mngo ( #480 )
...
* ts client for max buyback of fees with mngo
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-28 12:05:02 +01:00
Christian Kamm
e4d46c3c5b
Buyback fees: Add staggered expiry ( #478 )
2023-02-27 16:36:27 +01:00
microwavedcola1
25d94b0e7b
Fix idl
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-27 08:49:43 +01:00
microwavedcola1
d88d44b34a
buyback perp fees with mngo at a discount ( #464 )
...
buyback perp fees with mngo
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-25 20:34:16 +01:00
microwavedcola1
330739364f
ts: add function on perp position to get notional value ( #474 )
...
* ts: add function on perp position to get notional value
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-24 10:43:37 +01:00
tjs
f9bc74b48f
fix return type on perp loadFills
2023-02-23 13:00:22 -05:00
tjs
5c5638ab8d
deploy latest main to npm 0.5.22
2023-02-22 15:18:02 -05:00
microwavedcola1
16a41dfe38
Fix extraction of amount for token account and mm Procfile
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-22 15:08:13 +01:00
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
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
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
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
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
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
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
microwavedcola1
fbbce98ec3
simply debug user
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-18 20:15:04 +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
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
Adrian Brzeziński
c459c09451
fixes
2023-01-13 18:07:13 +01:00
Adrian Brzeziński
3077f57c2f
Merge branch 'dev' into feature/close-mango-account
2023-01-13 17:33:50 +01:00
Adrian Brzeziński
001a528a6e
fix
2023-01-13 17:33:24 +01:00
Adrian Brzeziński
80cf41ff5f
empty and close mango account
2023-01-13 13:19:04 +01:00
Christian Kamm
1dbf55991c
Changelog: update release time and tx
2023-01-13 11:35:31 +01:00
microwavedcola1
22ed8f2385
Ts client temp merge into dev ( #386 )
...
* fix buildHealthRemainingAccounts to not modify the mangoAccount obj
* Fix bug where health accounts were not packed correctly
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix bug in building health accounts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: tjs <tjshipe@gmail.com>
2023-01-13 11:23:37 +01:00
Christian Kamm
70616f74dd
idl update ( #384 )
2023-01-13 10:42:31 +01:00
microwavedcola1
ecc22f85d0
make untrusted till we have figured out perp settling ( #379 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-13 10:08:40 +01:00
Adrian Brzeziński
6e3e72436f
withdraw
2023-01-13 01:38:02 +01:00
Adrian Brzeziński
f5cb67fb3b
start of close
2023-01-12 22:34:48 +01:00
microwavedcola1
60d3f8d403
Fix ids api ( #371 )
...
* Fix ids api
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-12 20:43:37 +01:00
microwavedcola1
a7a5c740c9
Fix typo ( #375 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-12 20:39:46 +01:00
microwavedcola1
7c69197505
mango account freeze ( #372 )
...
* mango account freeze
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* format
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-12 13:08:10 +01:00
microwavedcola1
5ef04d6d08
group halt ( #370 )
...
* group halt
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* format
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-12 09:12:55 +01:00
Christian Kamm
c5d875e04d
Perp settle limit extension to realized pnl ( #359 )
...
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-11 14:32:15 +01:00
tylersssss
75593925aa
fix buildHealthRemainingAccounts to not modify the mangoAccount obj ( #369 )
2023-01-10 16:51:03 +01:00
tjs
57a563a2c4
include quote token fixes
2023-01-07 17:23:58 -05:00
tjs
9d168f56bd
- fix sort order of open order accounts in buildHealthRemainingAccounts
...
- refactor buildHealthRemainingAccounts to be more idiomatic
2023-01-07 17:06:35 -05:00
tjs
9efe95cc75
fix serum3PlaceOrder logic so health remaining accounts are in order
2023-01-07 00:10:50 -05:00
Adrian Brzeziński
c28f3cd07a
fixes for open order creation when placing order
2023-01-07 03:01:11 +01:00
microwavedcola1
b6996419ad
Merge branch 'dev'
2023-01-06 08:42:54 +01:00
microwavedcola1
e34f9be60a
Apply loan origination fee only on loans ( #364 )
...
* Apply loan origination fee only on loans
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-06 08:42:16 +01:00
microwavedcola1
85a33bde5b
setup fast listing admin required for trustless tokens
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-05 20:24:58 +01:00
microwavedcola1
a911a861f9
Merge branch 'dev'
2023-01-05 20:14:26 +01:00
microwavedcola1
292cc9a450
bonk ( #363 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-05 20:08:45 +01:00
tjs
65a31bcd5c
use the non deprecated prioritization fee ix
2023-01-05 12:58:20 -05:00
Adrian Brzeziński
e4f238f489
combine open orders create with place order ( #362 )
...
* wip
* place order fix
* fixes
* comment
* cleanup
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-05 08:31:07 +01:00
Adrian Brzeziński
068fad98f7
combine open orders create with place order ( #362 )
...
* wip
* place order fix
* fixes
* comment
* cleanup
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-05 08:30:15 +01:00
microwavedcola1
5019864b84
Update script to include perp market to reduce only
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-04 16:55:01 +01:00
microwavedcola1
5b41ff89a0
Update script to include perp market to reduce only
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-04 16:54:28 +01:00
microwavedcola1
3ab8c6072a
add reduce only field on ts classes
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-04 13:14:05 +01:00
microwavedcola1
86c9331647
reduce only order type and mode for tokens and perp markets ( #353 )
...
* reduce only order type and mode for tokens and perp markets
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* tests
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* remove token
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fixes
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-04 09:24:40 +01:00
microwavedcola1
b174ee13cc
update script for alts and new admin change
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-04 07:42:19 +01:00
tjs
ae615b7473
Merge branch 'main' into dev
2023-01-03 19:56:45 -05:00
tjs
57040b160a
use passed in prioritization fee
2023-01-03 19:56:33 -05:00
tjs
92f92cb967
Merge branch 'main' into dev
2023-01-02 15:36:08 -05:00
tjs
80f94166bd
add prioritization fee instruction
2023-01-02 15:35:39 -05:00
riordanp
89c024e9df
Setup MM for Heroku deployments ( #358 )
...
* Setup mm for heroku
* Update params
* Update Procfile
* Fix runtime dependencies
* Run linter
2023-01-02 19:21:08 +00:00
tjs
b0164113f0
support healthtype of undefined to calculate with a weight of 1
2022-12-30 15:26:53 -05:00
tjs
d2ed61328a
settle serum after placing order
2022-12-27 18:50:29 -05:00
microwavedcola1
f72c3cd0ae
Fix typings
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-27 08:26:19 +01:00
microwavedcola1
44fb1037cf
Mc/serum fees ( #350 )
...
* maker rebate shouldnt be applied to maxQuoteQuantity
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* update
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* update
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-21 10:21:24 +01:00
microwavedcola1
5def04f6ee
add price band helper ( #349 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-20 19:19:18 +01:00
microwavedcola1
ebeb2328b9
force close mango account script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-20 10:32:33 +01:00
tjs
48b5b81a09
script to add spot market
2022-12-19 20:30:47 -05:00
microwavedcola1
0ba51e6324
move to new authority and admin
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-19 19:50:09 +01:00
microwavedcola1
f3dac89d3e
Fix bug in getMaxBaseForSerum3AskUi where base returned was wrong
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-19 18:30:26 +01:00
microwavedcola1
31f56d0e41
Fix BN creation ( #342 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-19 15:40:14 +01:00
microwavedcola1
6e8f6596e7
rename
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-19 14:46:39 +01:00
Christian Kamm
7231ceea53
ts client: Fix avg entry price and break even price
2022-12-19 13:34:20 +01:00
microwavedcola1
f68a11145f
Filter by account
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-19 09:42:05 +01:00
tjs
13f32c8bae
assume taker fees
2022-12-17 14:08:48 -05:00
tjs
08cc99790c
needs parenthesis in maxQuoteQuantity
2022-12-17 13:06:48 -05:00
tjs
9b0db13c10
fix maxQuoteQuantity in placeSpotOrder
2022-12-17 13:01:57 -05:00
Christian Kamm
071dc34ccc
Client: Rework max_swap function ( #340 )
...
* Client: Rework max_swap function
Determining the amounts at which the health function changes slope
becomes too difficult when serum3 open orders come in.
Instead, generally find the function's maximum and then work with that.
* max_swap: Add test for swapping into a trustless token
* ts port
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-16 16:33:37 +01:00
Christian Kamm
5a38506f04
Liquidator, liqtest and rust client fixes ( #336 )
...
Liquidator, liqtest and rust client fixes
- Make rust MangoClient fully async
- Update and improve liquidation test setup scripts
- Update liquidator to use versioned transactions
- Update liquidator to use mango and jupiter account lookup tables
- Use jupiter v4 api to get versioned transactions
Perp liquidation is still not fully good. See discussion aboult perp_liq_pnl_with_token.
2022-12-16 13:10:46 +01:00
tjs
5df60b48d9
support passing ALT in marginTrade client fn
2022-12-15 17:22:10 -05:00
tjs
95e8bf2d2c
Merge branch 'main' into dev
2022-12-15 15:30:18 -05:00
microwavedcola1
df4a48a558
dont do checks force close flag is used explicitly ( #341 )
...
* dont do checks force close flag is used explicitly
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* comment
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* comment
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix ts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-12-15 21:10:56 +01:00
Adrian Brzeziński
5c329f8800
settle funds in serum3 cancel/modify
2022-12-15 20:06:10 +01:00
Adrian Brzeziński
1125002ba3
make settle funds serum3 ix
2022-12-15 13:41:45 +01:00