Commit Graph

1398 Commits

Author SHA1 Message Date
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
tjs ae7acbbc6b Revert "fix get unsettled funding function"
This reverts commit 708ef68b85.
2022-11-21 12:54:14 -05:00
tjs 708ef68b85 fix get unsettled funding function 2022-11-21 10:47:30 -05: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
tjs 256b948207 parse fill events 2022-11-20 23:50:08 -05:00
tjs 80809c6404 default seq num for load fills 2022-11-20 22:27:29 -05:00
tjs 57b05259f9 copy perp position functions from dev branch 2022-11-20 22:07:15 -05:00
tjs 26d65e9db9 fix mango account client layout 2022-11-20 22:05:09 -05: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
tjs 14e20f9668 fix type error with version txs 2022-11-18 14:22:12 -05: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
tjs 8dcedfb501 bump pkg v 2022-11-17 22:04:53 -05:00
tjs 98f0632ef9 prettier format 2022-11-17 22:04:03 -05:00
tjs 1c70988068 remove reference to yarn 2022-11-17 15:23:53 -05:00
tjs 4a62912284 hardcode spl-token version 2022-11-17 14:38:30 -05:00
tjs 8b128c9cfd use latest spl-token pkg 2022-11-17 13:24:11 -05:00
tjs 679bc05fa8 use switchboard v2 lite client 2022-11-17 13:22:30 -05:00
tjs c4582b0b76 use spl-token v 0.2.0 2022-11-17 12:51:12 -05:00
tjs 4649774347 add back web3.js pkg resolution 2022-11-17 10:51:20 -05: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
tjs 96f707e96d fix pkg json 2022-11-16 23:51:44 -05:00
Christian Kamm 3ccfa3241f Perp: Remove misleading LeafNode::price() 2022-11-16 15:53:07 +01:00
tjs 0d2ae7bf7b remove tx variable in favor of vtx 2022-11-16 09:11:39 -05: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
tjs 60419411dc Merge branch 'ts/tx-v2' into main 2022-11-15 23:10:20 -05:00
tjs 96104fc1cd support versioned txs 2022-11-15 23:10:03 -05:00
tjs a4c9b953df sign version tx in wallets 2022-11-15 15:45:48 -05: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