Commit Graph

403 Commits

Author SHA1 Message Date
Maximilian Schneider 45d6ebeb0c add instruction parser for switch oracle 2022-05-12 12:14:30 +02:00
Maximilian Schneider 820dc15134 add switch_oracle and temporary admin key 2022-05-12 12:06:20 +02:00
dafyddd e9a15f4deb fix bug in sim_get_val 2022-04-22 09:57:15 -04:00
dafyddd 4efa676a61 add more checked math to sim_get_val and get_val 2022-04-22 09:57:15 -04:00
dafyddd 6b01e3f63d add more checks and rearrange cancel_all_spot_orders 2022-04-21 12:40:58 -04:00
dafyddd e6e3a89df7 upgraded anchor and solana 2022-04-21 10:36:59 -04:00
dafyddd 378bd561bd Pass in MangoCache and RootBank as writable into Deposit instruction. This is in preparation for bug fix 2022-04-20 10:37:13 -04:00
dafyddd 29f6dd6b44 Revert "Allow solana dependecies above `1.10` (#174)"
This reverts commit a12a559476.
2022-04-19 15:40:23 -04:00
Jakob a12a559476
Allow solana dependecies above `1.10` (#174)
* feat: allow deps above 1.10

* feat: allow 1.10 versions
2022-04-19 15:27:26 -04:00
Jakob Povšič 2018309e1c load ref 2022-04-19 15:05:20 -04:00
dafyddd 95e563b193
Dd/serum max ts (#170)
* point to serum dex upstream for now; add in max_ts for PlaceSpotOrder and PlaceSpotOrder2; DOES NOT COMPILE UNTIL OUR SERUM DEX FORK IS UPDATED

* point to blockworks-foundation version of serum-dex

* add serum_dex.so from anchor build registry; fix initialize market in tests; tests still don't pass because of liquidate_token_and_token

* fixed tests breaking because of new fees in serum dex

* got rid of compile warnings in tests; made tests run faster
2022-04-18 17:07:23 -04:00
microwavedcola1 d06a6e3ec1
Merge pull request #168 from blockworks-foundation/mc/place_spot_order2-helper
add place_spot_order2 builder
2022-04-14 15:04:12 +02:00
microwavedcola1 bab74aba48 comment
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-14 14:55:51 +02:00
microwavedcola1 9aacd3ca99 fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-14 14:54:32 +02:00
microwavedcola1 fb6b94c490 format
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-14 10:56:17 +02:00
microwavedcola1 2817b77397 fix from cr
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-14 10:55:28 +02:00
godmodegalactus 58edf81e21
implementing cancel all spot orders instruction (#162)
* implementing cancel all spot orders instruction

* solving formatting issues

* Adding limit as argument, adding checks on root bank

* fixing format

* minor ident changes and adding a check on progId
2022-04-13 15:29:09 -04:00
microwavedcola1 6ad990956c add place_spot_order2 builder
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-13 07:45:57 +02:00
dd f28e0036f5 Remove pyth status check and slot validity entirely 2022-04-03 14:25:15 -04:00
dd 38173ca02e add changelog and update version to v3.4.3 2022-04-03 13:18:45 -04:00
dafyddd 078ecde88d
Dd/oracle (#165)
* use pyth client instead of copied over code; read_oracle now errors for pyth only if last_slot over 50 slots ago

* check in replace_oracle that oracle_index is valid

* remove unused replace_oracle; move PYTH_VALID_SLOTS to const variable

Co-authored-by: dd <dafydd.durairaj@gmail.com>
2022-04-03 13:01:55 -04:00
Maximilian Schneider 85a3c92502 add informative msg 2022-03-28 13:17:18 -04:00
Maximilian Schneider 60d19a230d fix ignore condition 2022-03-28 13:17:18 -04:00
Maximilian Schneider b292fa2c64 allow settle fees to silently fail 2022-03-28 13:17:18 -04:00
dd f0ec18a7cc Update version and changelog to 3.4.2 2022-03-19 10:31:16 -04:00
dd e5a87d8b76 fix solana deps to be below 1.10.0 so tests pass 2022-03-17 12:13:28 -04:00
dd cec5bd2935 update fixed library 2022-03-17 12:13:28 -04:00
dd a56375590f update anchor version and cargo deps and switchboard version 2022-03-17 12:13:28 -04:00
bonedaddy 856be2231e program: add helper functions for interest/deposit rate calculation 2022-03-13 14:34:25 -04:00
dd 0d6546596e use NUM_HEALTHS const; Add explanations for HealthTypes 2022-03-13 12:35:25 -04:00
dd 3ba5909fe8 fix get_health_componenets 2022-03-13 12:35:25 -04:00
Joseph Dunn 3cde46159c Declare processor::read_oracle() public 2022-03-13 12:35:25 -04:00
dd 085dbb1472 Add HealthType::Equity which has weights of 1 2022-03-13 12:35:25 -04:00
dd 3d34b5f7fc add comment explaining the valid interval change in PriceCache::check_valid 2022-03-13 12:34:03 -04:00
dd c23cb4132f double valid interval for price cache--it's low risk and should help with the number of InvalidPriceCache we get during network instability 2022-03-13 12:34:03 -04:00
microwavedcola1 1ea8961c36 doesnt need to be writable
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-03-10 12:21:07 +01:00
Christian Kamm 408e0bc44e Tests: Exercise all perp order types in tests 2022-03-02 11:13:46 +01:00
Christian Kamm a6448c551a Tests: Drop some unnecessary keeper calls
There's still many, _many_ left that unnecessarily slow down test
execution.
2022-03-02 11:13:46 +01:00
dd ae5fe3b2bd update cargo.toml and cargo.lock for v3.4.1 2022-02-28 10:52:29 -05:00
dd 77a40de46f fix market order price 2022-02-28 07:48:21 -08:00
microwavedcola1 38accb1b02
Merge pull request #147 from blockworks-foundation/mc/liquidation-cu-limit-test
mc/liquidation cu limit test
2022-02-23 20:23:05 +01:00
Christian Kamm 6efb84aec1 Bump version to 3.4.0, add changelog 2022-02-23 10:07:03 -08:00
Christian Kamm 1c0e92b2a1 Add back deprecated BookSide::iter() 2022-02-23 10:06:22 -08:00
dd 819f19b453 Fixed bug where expired orders would create OutEvent but would not be removed because new_bid/new_ask don't reach the part of the code where they are removed from book 2022-02-23 10:04:52 -08:00
microwavedcola1 94d695c03f fix compute limit
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-02-23 10:40:29 +01:00
microwavedcola1 d73428d4c5 cargo tests to test max cu usage for liquidation ixs, basically same as other liquidation tests,
in addition, these tests ensure spot open orders account for every market, and open positions on max
number of markets allowed and perp positions for all markets
... all on liqee and liqor

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-02-23 10:29:16 +01:00
dd c16a5cc5b3 make time in force exclusive of expiry_timestamp 2022-02-20 08:56:28 -05:00
Christian Kamm f33973732d Matching: Fix bug in sim_new_bid/ask 2022-02-19 20:46:01 +01:00
Christian Kamm 8677490ce8 PlacePerpOrder2: improve doc comments 2022-02-19 20:36:14 +01:00
Christian Kamm 17b54b3b02 Tests: Change test_full_book into test_perp_matching_limit
Where we don't try to set up a nearly full book, because that takes too
long - and we only need there to be more orders than the matching limit
2022-02-19 20:36:14 +01:00