Commit Graph

2567 Commits

Author SHA1 Message Date
Christian Kamm 79ddbf21f1
Liquidation: Use asset and liab liq fee (#825) 2023-12-28 10:46:43 +01:00
Christian Kamm eb6622b4fc client/liq: support jupiter api tokens 2023-12-27 14:47:58 +01:00
Christian Kamm e2bfa9a1e6 client: configurable jupiter urls (#800)
(cherry picked from commit 71f0e5cc13)
2023-12-27 14:15:45 +01:00
Maximilian Schneider e83052a036
helpers for estimating order sizes (#823) 2023-12-27 09:56:54 +01:00
microwavedcola1 571e8d483c v0.21.5 2023-12-26 11:36:29 +01:00
microwavedcola1 ce3a243749 ts: export class
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-26 11:35:11 +01:00
Christian Kamm d2327f8d11 liquidator: rebalance asynchronously 2023-12-22 09:02:06 +01:00
Christian Kamm 0a55184ec7 liquidator: stop withdraw attempts on delgated accounts 2023-12-22 08:35:21 +01:00
Christian Kamm cdf804e971 liquidator: don't panic when unable to build health cache 2023-12-22 08:11:34 +01:00
Christian Kamm 428e71e07f
Allow delegates to withdraw small token amounts (#820)
- if they're withdrawing to the owner's ata
- if they're closing the token position
- if the amount is small
2023-12-20 11:15:47 +01:00
Christian Kamm b5614e98c3
test: Add interest rate test (#818) 2023-12-20 11:15:29 +01:00
Christian Kamm 7655a87404
Perp: Always allow users to free perp open order slots (#817)
Previously, freeing would be impossible if a canceling fill or out event
was already in-flight - then the order would no longer be on the
orderbook.

Now, FillEvent and OutEvent store the order id and can check if the open
order slot on the account has been reused already. That allows canceling
orders to always free up the user slot immediately.
2023-12-20 11:15:10 +01:00
Christian Kamm 86334020e2
Use custom allocator for the program (#801)
To allow making use of extended heap sizes.
2023-12-20 11:10:18 +01:00
Christian Kamm 27b1ceebe8 Accounts: Expect only the v3 MangoAccounts now (#783) 2023-12-19 10:08:46 +01:00
Christian Kamm 64d6c8c3c4
Add doc comments for new fields (#819) 2023-12-18 17:41:17 +01:00
Christian Kamm b12b998e3a liquidator: cover errors during tcs execution
previously they could abort the liquidator
2023-12-15 11:55:21 +01:00
Christian Kamm 99cb3d4f4c liquidator: Pick better asset/liab for liq_token 2023-12-15 11:40:25 +01:00
Christian Kamm b6ddd991b0 liquidator: early out when no tcs tx were sent 2023-12-14 21:48:01 +01:00
Christian Kamm 06da4768f3 Gov instruction creation helpers
- Add one to make a proposal for all serum markets
- Switch created proposals to be drafts
- Add PROPOSAL_LINK env arg
- Add serum3EditMarketIx()
2023-12-14 11:34:17 +01:00
microwavedcola1 66bb74c2fd ts: add prop to serum3 markets
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-14 05:59:44 +01:00
microwavedcola1 f342595a88 ts keeper: skip broken tokens
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-13 10:52:18 +01:00
Christian Kamm 47faa8a7f1 liq: get rid of separate rebalance job (#815)
Previously, the separate job and the post-liquidation rebalance could
run at the same time and would occasionally perform the same action at
the same time, leading to overshooting.

Now rebalancing never happens twice. In the future it should potentially
just run separately from liquidation, but that needs a review of the
assumptions the liquidation job is making first.

(cherry picked from commit e8e7e445d3)
2023-12-13 09:27:21 +01:00
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 05f03f4ed8
test: Add one for migrating interest rates for v0.21 (#816) 2023-12-12 11:28:37 +01:00
Christian Kamm e8e7e445d3
liq: get rid of separate rebalance job (#815)
Previously, the separate job and the post-liquidation rebalance could
run at the same time and would occasionally perform the same action at
the same time, leading to overshooting.

Now rebalancing never happens twice. In the future it should potentially
just run separately from liquidation, but that needs a review of the
assumptions the liquidation job is making first.
2023-12-11 17:41:11 +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 0e8fc5e10e Merge branch 'deploy-v0.21.0' into dev 2023-12-08 11:39: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
Christian Kamm cb9848252d
update idl and client tokenEdit() (#814) 2023-12-08 11:09:57 +01:00
Robert Chen 986bf34bed
add audit report for v0.21.0 (#812) 2023-12-08 10:23:48 +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 5f8f717430
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
2023-12-06 16:46:57 +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 80c12f95b2
Changelog for v0.21 (#809) 2023-12-06 11:51:43 +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 42e31ae859
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
2023-12-05 15:43:38 +01:00