Commit Graph

2390 Commits

Author SHA1 Message Date
Christian Kamm 79ddbf21f1
Liquidation: Use asset and liab liq fee (#825) 2023-12-28 10:46:43 +01:00
Maximilian Schneider e83052a036
helpers for estimating order sizes (#823) 2023-12-27 09:56:54 +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 64d6c8c3c4
Add doc comments for new fields (#819) 2023-12-18 17:41:17 +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 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
Christian Kamm 81501837a9
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
2023-12-05 15:39:24 +01:00
Christian Kamm 71f0e5cc13
client: configurable jupiter urls (#800) 2023-12-05 13:23:11 +01:00
Christian Kamm ce16d79b13
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.
2023-12-05 13:22:24 +01:00
Christian Kamm e2c9cf2de0 tests: drop extra debug output 2023-12-05 11:16:09 +01:00
Christian Kamm ce71c67a88 Bump program version to v0.22 2023-12-05 11:15:50 +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
Christian Kamm 361ba23df1
revert trustless token registration params to conservative defaults (#804)
This mostly reverts commit 33bc278a2c.
2023-12-05 10:13:55 +01:00
Christian Kamm f03944b5dd
Disable TokenAddBank instruction (#803)
It was unused for a long time and it should be reevaluated before being
used.
2023-12-05 10:12:50 +01:00
microwavedcola1 0fda2b0875 ts: fix sig logging
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-12-03 07:41:40 +01:00
Lou-Kamades 838df8cd7c
Merge pull request #790 from blockworks-foundation/lou/fallback-oracle
Add fallback oracles
2023-12-01 12:59:38 -06:00
Lou-Kamades 25aa422e2d also log primary oracle when fallback errors 2023-12-01 12:44:35 -06:00
Britt Cyr 68944747e0
Add serum3 cancel by client order id instruction (#798) 2023-12-01 13:36:29 +01:00
Lou-Kamades ab9d3c37b4 check serum OO headers in ScanningAccountRetriever 2023-11-30 11:03:24 -06:00
Lou-Kamades b19678f874 use a Vec for fallbacks in ScannedBanksAndOracles 2023-11-29 01:03:48 -06:00
Lou-Kamades 59001b3631 reduce CU cost of fallback oracles 2023-11-28 22:55:19 -06:00
Christian Kamm e9198577f1
deposit: remove debug output (#799) 2023-11-28 14:59: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
Christian Kamm 6d80568022
Accounts: Expect only the v3 MangoAccounts now (#783) 2023-11-27 09:30:37 +01:00
microwavedcola1 755dbd7ec0 v0.20.6 2023-11-24 11:06:44 +01:00
Christian Kamm feeb63dab2
ts: tcs hasData was renamed to isConfigured (#796) 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 0483faef1e
liquidator: fix token info for same-name, fix delays (#795) 2023-11-24 11:04:59 +01:00
Christian Kamm 9a68a2dd7d
liquidator: make tcs mode configurable (#794)
tcs devnet tests want borrow-buy-token
2023-11-24 11:04:48 +01:00
silas 3588017fdb
CI updates (#784)
* ci: remove trivy reporting

* ci: add codeql and remove trivy reporting

* ci: add checkout to read config
2023-11-23 09:00:08 +01:00
microwavedcola1 236aee99d8
program: optimize cu usage in token deposit, by computing health only… (#786)
* program: optimize cu usage in token deposit, by computing health only if user is being liquidated

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-11-23 08:59:33 +01:00
shuoer86 8129cf45b4
chore: fix typos (#778) 2023-11-23 08:59:19 +01:00