tjs
55db713862
add getEquityUi
2022-12-03 14:47:01 -05:00
microwavedcola1
fa09c557a1
ts client sync with program ( #311 )
...
mostly health related code
2022-12-02 15:48:43 +01:00
Christian Kamm
9bfa574ee6
Doc: note about final health slope in max_swap_source
2022-12-02 14:08:13 +01:00
Christian Kamm
c8f1f3c821
Net borrow limits: Limit in quote, not native ( #312 )
...
* Net borrow limits: Limit in quote, not native
* make perp settle limit disableable
2022-12-02 12:24:11 +01:00
Christian Kamm
cf34a5b4b7
Health: Add soft deposit and borrow limits
2022-12-02 08:20:22 +01:00
Christian Kamm
512eef96ea
Perp pegged orders: Add stub max oracle staleness arg
2022-12-02 08:19:51 +01:00
Christian Kamm
9757f7a509
Fix perp liq computation; doc liq fee in token liq
2022-12-02 08:19:29 +01:00
Christian Kamm
524fe110e3
Health client: Fix max perp trade ( #309 )
...
Previously we didn't take the health cap for untrusted perp markets into
account correctly.
2022-12-01 11:26:01 +01:00
Christian Kamm
7bbf045823
Separate health code into multiple files
2022-11-30 13:21:32 +01:00
microwavedcola1
d64d9285f4
limit settleable pnl ( #295 )
...
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-30 13:20:19 +01:00
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
tjs
0192b16d90
slightly better errors
2022-11-21 17:03:11 -05:00
tjs
717d3f7711
use provider connection to fetch switchboard idl
2022-11-21 16:48:35 -05:00
tjs
20ff7c99c6
use sendRawTx in rpc.ts
2022-11-21 14:50:24 -05: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
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