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