microwavedcola1
95b03aa5ac
remove filter
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-29 10:40:18 +01:00
Christian Kamm
f6d189ce29
Test fixes
2022-11-28 11:31:51 +01:00
microwavedcola1
1732a5aff4
net borrow limits ( #301 )
...
* net borrow limits
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix client
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix tests
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-25 13:45:17 +01:00
Christian Kamm
502f0767a8
Adjust avg entry price / break even price computation ( #304 )
...
- Don't return result as I80F48, f64 is more honest
- Allow access to avg entry price per base lot without division
- Reset break even price when position changes sign
- Fix occasionally-failing fast division test
- Fix sign of break even price -- it can now be negative if the
position has broken even.
2022-11-25 09:59:52 +01:00
Christian Kamm
f236a0521a
Fast I80F48 division with reduced precision ( #300 )
2022-11-24 11:59:00 +01:00
Christian Kamm
c276353289
Implement a stable_price on banks and perp markets ( #303 )
...
It is tracked in the StablePriceModel and updated on
TokenUpdateIndexAndRate and PerpUpdateFunding instructions.
The stable price is used in health computations.
2022-11-24 11:55:22 +01:00
riordanp
748334d674
Fix liquidator ( #302 )
...
* Fix liquidator
* Remove redundant variable.
Co-authored-by: Nicholas Clarke <nicholasgclarke@gmail.com>
2022-11-22 07:10:23 +01:00
Riordan Panayides
c2e4230a73
Fix submodule reference
2022-11-21 23:37:53 +00:00
microwavedcola1
44d0170ea9
mc/settle pnl ts client ( #292 )
...
* oracle peg client support
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>
* perp pnl settle, candidate finder, and example
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-21 20:36:13 +01:00
Christian Kamm
65362cb4de
AccountRetriever review fixes
...
Done-with: conj0iner
2022-11-21 20:34:23 +01:00
Nicholas Clarke
ff18ad6ba7
Add client function getCumulativeInterest ( #280 )
...
* Add client function getCumulativeInterest
2022-11-21 10:59:26 -08:00
riordanp
4bd37c776f
Make keeper intervals configurable ( #294 )
...
* 1.10.35 compatibility
* cargo update
* Fix build
* cargo fmt
* Add configurable intervals to keeper
* 1.10.35 compatibility
* cargo update
* Fix build
* cargo fmt
* Add configurable intervals to keeper
2022-11-21 19:35:04 +01:00
microwavedcola1
d3661bac7b
mc/oracle peg ts client ( #290 )
...
* oracle peg client support
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>
* Fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-21 19:34:41 +01:00
Christian Kamm
6ea7eddcb3
Compute health based on two prices ( #298 )
...
Now the oracle price and a "safe" price go into the health computation and
init health uses the min of both for assets and the max for liabs.
This has far-reaching consequences for how serum and perp health need to
be computed because many intermediate values depend on the prices, which
now differ for init and maint health computations.
The biggest change is that the serum3 reservation totals need to be done
for each health call from scratch.
This PR increases the health CU host per serum3 market and perp market
significantly, check the test_health_compute tests.
2022-11-21 15:01:10 +01:00
Christian Kamm
860696f74b
Fix anchor submodule checkout
2022-11-21 11:04:01 +01:00
microwavedcola1
d82608ebee
Revert "add support for msrm vault for serum3 discounts ( #285 )"
...
This reverts commit 0a4f7150d6
.
2022-11-20 15:31:16 +01:00
conj0iner
39ed94aa87
client additions + extra tests + safety ( #281 )
...
Co-authored-by: Conj0iner <conj0iner@users.noreply.github.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-18 08:58:56 +01:00
Christian Kamm
19e2b86394
Merge pull request #296 from blockworks-foundation/ckamm/perp-ordertree-price
...
Perp: Remove misleading LeafNode::price()
2022-11-17 10:36:10 +01:00
Christian Kamm
3ccfa3241f
Perp: Remove misleading LeafNode::price()
2022-11-16 15:53:07 +01:00
riordanp
5d780a86dc
Upgrade to Solana 1.10.35 ( #291 )
...
* 1.10.35 upgrade & compatibility
* Patch Anchor
* Fix test compile
* Serum program update
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-16 10:50:40 +00:00
Christian Kamm
1026b2bb85
benchmark improvements
2022-11-16 11:14:46 +01:00
Christian Kamm
e5558f8baa
Merge pull request #288 from blockworks-foundation/ckamm/oracle-staleness
...
Add staleness param to OracleConfig
2022-11-12 12:15:23 +01:00
Christian Kamm
2ee152f7ea
Oracle staleness: Check when accessing oracle price
2022-11-12 12:12:45 +01:00
Christian Kamm
58f7ff2e0e
Add staleness param to OracleConfig
...
Since Bank can't expand the existing OracleConfig, add a new one to Bank
and (temporarily!) copy over the old value to the new one in
TokenUpdateIndexAndRate.
Add some reserved space to OracleConfig to make this easier in the
future.
Breaks the PerpMarket and PerpPosition layouts
2022-11-12 12:11:09 +01:00
Christian Kamm
f5e47c47bd
Clarification of price_data for pegged orders
2022-11-11 08:18:53 +01:00
Christian Kamm
b6361bad37
PerpUpdateFunding: update automatically on PerpPlaceOrder ( #287 )
2022-11-10 14:41:20 +01:00
Christian Kamm
efec1eb906
Test fixes
2022-11-09 10:51:03 +01:00
microwavedcola1
0a4f7150d6
add support for msrm vault for serum3 discounts ( #285 )
...
* add support for msrm vault for serum3 discounts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix client
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* client support
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* More client code and todos
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* prettoer
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* remove mint, not needed
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-09 09:59:42 +01:00
microwavedcola1
e47e17d79f
reduce only flag for perp place order ( #286 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-09 09:59:34 +01:00
microwavedcola1
e8ba511c45
mc/flash loan for delegate ( #271 )
...
* flash loan for delegates
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix rust client
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* prettier
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-09 09:35:13 +01:00
Christian Kamm
7da421ea1c
Fix client and keeper for new perp orderbooks
2022-11-09 09:32:32 +01:00
Christian Kamm
5731ce8faa
Perp oracle peg feature ( #264 )
...
This introduces the ability to use oracle peg orders on perp markets.
This PR has significant non-backwards compatible changes, for example all
order trees are now in a single account instead of separate.
2022-11-08 15:27:56 +01:00
Riordan Panayides
2b8e976956
Allow manual docker builds
2022-11-05 13:10:34 +00:00
Riordan Panayides
fcfb1e8823
Force build
2022-11-05 13:08:03 +00:00
Riordan Panayides
813fc0996a
Run docker build on program changes
2022-11-05 13:05:30 +00:00
Riordan Panayides
a0cb6be83f
Run action on updates
2022-11-04 17:32:06 +00:00
Riordan Panayides
2b694e553f
Merge branch 'dev' of github.com:blockworks-foundation/mango-v4 into dev
2022-11-04 17:21:44 +00:00
Riordan Panayides
014953f30a
Restrict docker build paths, run build on main
2022-11-04 17:21:38 +00:00
riordanp
e6c6820f1f
Merge pull request #284 from blockworks-foundation/pan/liquidator-improvements
...
Liquidator bug fixes
2022-11-04 17:12:29 +00:00
Riordan Panayides
4fb715bab6
Update vulnerable package lz4-sys
2022-11-04 17:09:35 +00:00
Riordan Panayides
16c38975d5
Fix typo
2022-11-04 17:03:59 +00:00
microwavedcola1
446b2e8d66
serum util functions
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-04 15:07:26 +00:00
microwavedcola1
85206c46a3
Merge branch 'main' into dev
2022-11-04 14:49:24 +00:00
microwavedcola1
4e12d85d3d
alt for mainnet group 2 ( #282 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-04 14:48:26 +00:00
Maximilian Schneider
4d134f266b
reloadAll is now idsSource aware ( #275 )
...
add markets to test SOL quote serum trading
tweak dust leverage so we can test isolated markets and liquidation
add unregister token & market
2022-11-04 14:35:40 +00:00
microwavedcola1
2b5527e0b0
Merge branch 'main' into dev
2022-11-04 14:31:34 +00:00
riordanp
df1c2782f1
Use cargo-chef for dependency caching in docker build ( #278 )
...
* Try cargo chef for caching build deps in docker
* Run docker build on pan/cargo-chef
* Replace before cheffing
* Fix serum_dex conflict
* Only build what's needed and only once
* Fix typo
* Force liquidator rebuild
* Upgrade vulnerable package lz4-sys
* Revert "Force liquidator rebuild"
This reverts commit c169779542
.
* Revert "Temporarily run docker build on branch"
This reverts commit 63ee27eb1e
.
2022-11-04 14:30:31 +00:00
Riordan Panayides
21e4b080e3
Fix incorrect open orders start index
2022-11-02 17:13:25 +00:00
microwavedcola1
ccc1d43a55
Port new fields on accounts from program to ts client
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-02 12:13:29 +00:00
microwavedcola1
cae10bcdae
Merge branch 'dev'
2022-11-02 11:52:43 +00:00