Commit Graph

2358 Commits

Author SHA1 Message Date
Christian Kamm 9ba0004760 bins: Fix restarting on new or changed listings (#802)
- Don't just restart on new listings, but also on significant changes to
  old listings such as oracle changes.
- Cover the liquidator and settler in addition to the keeper.

(cherry picked from commit ce16d79b13)
2023-12-13 09:27:04 +01:00
Christian Kamm 5cfbb8386d liquidator: fix token info for same-name, fix delays (#795)
(cherry picked from commit 0483faef1e)
2023-12-13 09:20:52 +01:00
microwavedcola1 2551fd7e34 v0.21.0 2023-12-13 09:10:56 +01:00
microwavedcola1 e3d405da65 ts: fix scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-13 09:09:38 +01:00
microwavedcola1 e75d279b15 Merge branch 'deploy-v0.21.0' into deploy 2023-12-13 09:04:44 +01:00
microwavedcola1 445be8a1c7 ts: up the size since we are quoting far
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-12 17:32:39 +01:00
microwavedcola1 6aacb2ecd0 ts: small logging update
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-12 15:21:11 +01:00
microwavedcola1 944798c298 ts: make stock mm more safer, quote wide, twap out
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-12 15:08:26 +01:00
Christian Kamm add1647d37 rs client: Use finalized commitment for blockhash
confirmed say occasional errors
2023-12-11 10:31:34 +01:00
microwavedcola1 7722c66826 ts keeper: use confirmed for blockhash
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-11 09:47:24 +01:00
Christian Kamm 0d6d0d2837 rs client: Fix blockhash to be from confirmed commitment 2023-12-11 09:42:03 +01:00
microwavedcola1 95442b993f ts: fix getMaxSerum3OrderForHealthRatio where scaled weights werent used
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-08 15:59:01 +01:00
Christian Kamm f2bde7ba9f Merge tag 'program-v0.21.0' into deploy-v0.21.0 2023-12-08 11:30:44 +01:00
Lou-Kamades a1966dc0bc
TS: allow for multiple providers when sending transactions (#808)
* allow for multiple providers in the client

* v0.20.9
2023-12-07 15:19:25 -06:00
Christian Kamm d6f46bec70 Fix program tests after cherry-picks 2023-12-07 13:23:18 +01:00
Christian Kamm 509afb01b6 adjust token_register_trustless params (#810)
- since there's no borrowing or asset weight, don't put staleness or
  confidence restrictions on the oracle
- disable the tcs fees, they are not enabled anywhere yet

(cherry picked from commit 5f8f717430)
2023-12-06 16:48:00 +01:00
Christian Kamm cbfdbd13ec Changelog for v0.21 (#809)
(cherry picked from commit 80c12f95b2)
2023-12-06 11:52:20 +01:00
Christian Kamm db4e486643 Bump program version to v0.21.0 and update idl 2023-12-05 15:57:42 +01:00
Christian Kamm e7bfa4e03e Deposit limits (#806)
- limit deposits (via deposit, flash loan, tcs)
- limit potential deposits via openbook settle
  by restricting placable orders via potential_serum_tokens
- introduce Serum3PlaceOrderV2 for this purpose
- account for new limits in liquidator, max_swap

(cherry picked from commit 42e31ae859)
2023-12-05 15:57:26 +01:00
Christian Kamm f533d65a58 Openbook token tracking and price bands (#805)
- track min bid, max ask
- track maximal token outflow from oo
- add serum3_place_order_v2 with mutable receiver bank
- placing openbook orders is restricted to a certain distance from the
  oracle

(cherry picked from commit 81501837a9)
2023-12-05 15:48:57 +01:00
Christian Kamm 99790a01e4 revert trustless token registration params to conservative defaults (#804)
This mostly reverts commit 33bc278a2c.

(cherry picked from commit 361ba23df1)
2023-12-05 10:14:48 +01:00
Christian Kamm 04f0f55aa5 Disable TokenAddBank instruction (#803)
It was unused for a long time and it should be reevaluated before being
used.

(cherry picked from commit f03944b5dd)
2023-12-05 10:14:36 +01:00
microwavedcola1 0fda2b0875 ts: fix sig logging
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-03 07:41:40 +01:00
microwavedcola1 603ca0b224 ts: maintain alt script was missing perp market relevant pubkeys
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-27 09:34:09 +01:00
microwavedcola1 755dbd7ec0 v0.20.6 2023-11-24 11:06:44 +01:00
Christian Kamm 2829bef48e ts: tcs hasData was renamed to isConfigured 2023-11-24 11:05:20 +01:00
Christian Kamm eceef44a96
Log emissions: Serialize to buffer on stack instead of using heap (#787)
Emitting many events could previously cause heap exhaustion.
2023-11-22 16:00:47 +01:00
Christian Kamm eeb172e44e
Bank: Close zero position when withdrawing 0 (#793) 2023-11-22 15:54:38 +01:00
microwavedcola1 c52cf59dc9 v0.20.5 2023-11-22 08:04:42 +01:00
microwavedcola1 048983ffe5 ts: extend errors
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-22 08:02:32 +01:00
tjs db7fb39154 npm publish 2023-11-21 17:21:25 -05:00
tjs 97a2a7a194 return slot after sending a transaction 2023-11-21 17:17:01 -05:00
microwavedcola1 a40e7372e4 ts: chunk the ixs
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-20 13:22:08 +01:00
microwavedcola1 2609d56648 ts: fix address used for alt
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-20 13:14:05 +01:00
microwavedcola1 43afa713a9 ts: fix client usage in script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-20 13:11:08 +01:00
microwavedcola1 1b8f3b7cbc
Mc/maintain alts (#788)
* v0.20.3

* ts: script to maintain ALTs

* Fixes from review

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

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-20 12:57:01 +01:00
microwavedcola1 e4c0c247d4
Mc/token sanity check (#789)
* v0.20.3

* ts: token sanity check

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-11-20 12:56:03 +01:00
Christian Kamm 57a9835aa8
Reduce HealthCache heap use (#785)
Growing these vectors is a waste, rough measurements say this saves
around 1k bytes for a 5 tokens and 4 serum account.
2023-11-20 10:15:39 +01:00
Christian Kamm a96fb0f614 Revert "Bank: store interest curve scale and target util separately (#755)"
This reverts commit 3b28856692.

It should not have been in deploy since it changes instruction ABI and
has not been released in v0.20.0
2023-11-17 07:58:41 +01:00
Christian Kamm 0ac930eb8d tests: fix build 2023-11-16 16:44:18 +01:00
microwavedcola1 21b8c0dbfa risk: disable for now
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-16 08:42:18 +01:00
Christian Kamm 2d1bf023c6
TokenRegister: Add arg for group insurance fund flag (#782) 2023-11-16 08:16:18 +01:00
microwavedcola1 c0c96abbec v0.20.2 2023-11-14 17:11:41 +01:00
microwavedcola1 af314d01a5 format
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-14 17:05:55 +01:00
Christian Kamm 93d85c3f71
Bank: allow maint weights to change over time (#780)
- token_edit can set it up to gradually scale to new target values
- security admin can abort an ongoing change via token_edit
- all health computations are now time dependent and get the weight
  based on it
- when the change is done, the keeper "cleans up" and moves the new
  values into the default fields
2023-11-14 14:52:04 +01:00
microwavedcola1 25fd722743 ts: update some typings, commented ones will be improved after next release
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-14 10:29:58 +01:00
microwavedcola1 888a270cf2 Merge branch 'mc/update-risk' into deploy 2023-11-14 08:58:53 +01:00
microwavedcola1 71fc571ca4 ts: add formulas for risk
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-14 08:58:41 +01:00
Lou-Kamades 3ccf2317fe ts: use release 20 idl 2023-11-13 18:48:46 -06:00
Lou-Kamades 56480f2268 ts: don't alter user margin trade Ixs 2023-11-13 15:04:25 -06:00