Maximilian Schneider
28c542be3f
fix too aggressively flooring BN math ( #276 )
2022-10-27 20:49:19 +02:00
tjs
3993c5926b
v0.0.1-beta.5
2022-10-27 11:25:24 -04:00
microwavedcola1
3efebb3ea6
ts: market maker improvements ( #270 )
...
* ts: fix typechecking on scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: market maker round of improvements
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-11 09:39:57 +02:00
microwavedcola1
cd8c500be5
ts: fix typechecking on scripts ( #269 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-11 09:38:52 +02:00
microwavedcola1
a66177a77e
ts: match client class definitions 1-1 to program state struct definitions ( #268 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-11 09:34:02 +02:00
tjs
286563b0ef
add minordersize and ticksize to perpmarket
2022-10-10 18:59:44 -04:00
microwavedcola1
7466123934
ts: fix script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-10 08:07:27 +02:00
microwavedcola1
cc92389666
Changelog
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-08 14:42:32 +02:00
microwavedcola1
3939d48dc6
ts: fix script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-08 14:32:50 +02:00
tjs
f7787ea828
remove duplicate function
2022-10-07 13:48:12 -04:00
tjs
cfd6fd2ca8
remove unnecessary undefined type returns
2022-10-07 13:48:05 -04:00
tjs
73039e1b39
Merge remote-tracking branch 'origin/dev' into main
2022-10-07 13:21:47 -04:00
tjs
69a0ac32b7
add perp market script
2022-10-07 13:21:25 -04:00
microwavedcola1
8f6fa5134d
ts: comment out, tsc complains
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-07 14:05:49 +02:00
microwavedcola1
8e919bb741
ts: perp improvements ( #263 )
...
* ts: perp improvements
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-07 13:52:04 +02:00
microwavedcola1
6808171ee3
ts: disable versioned txs for now because wallets dont support them
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-07 08:28:05 +02:00
Christian Kamm
f2cc869795
Perps: Prepare for settlement token != oracle token
...
Make sure the setting is available and that the needed accounts are
passed to the perp instructions.
2022-10-06 08:32:58 +02:00
tjs
dfcb9117b6
Merge branch 'main' into dev
2022-10-04 16:35:46 -04:00
tjs
dd4175b401
add back get serum3marketbypk
2022-10-04 16:35:38 -04:00
tjs
8cdd0233d4
fix merge issues
2022-10-04 15:13:24 -04:00
tjs
56313b6eac
Merge branch 'dev' into main
2022-10-04 14:54:42 -04:00
microwavedcola1
5b549fb59f
program: fix bug where expansion would not move positions whose size remained same ( #262 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-10-03 13:06:04 +02:00
Christian Kamm
b906e3dc78
Token deposit: Split into signed and permissionless ix
...
Token accounts are a limited resource, so allowing other users to make
use of them can cause problems.
2022-10-02 16:06:39 +02:00
microwavedcola1
bafaf73745
Mc/ts numbers - cleanup usage of all numbers ( #259 )
...
* ts: a higher error tolerance is sufficient
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: move stuff around
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: string representation while printing
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: number cleanup
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fix tsc errors
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: cleanup creation of I80F48 from BN
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fixed from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* revert
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fix from call
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-30 15:07:43 +02:00
microwavedcola1
d1079bb1b9
Mc/ts increase error tolerance for binary search ( #258 )
...
* ts: a higher error tolerance is sufficient
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* program: fix error size
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-30 14:59:12 +02:00
microwavedcola1
a2f4cef940
mc/ts derive and not hardcode size ( #257 )
...
* ts: simplify getOrCreateMangoAccount
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: derive and not hardcode sizes for perp accounts when creating
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fix script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: remove todo, not relevant anymore
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-30 13:33:21 +02:00
microwavedcola1
4b52d9a072
ts: simplify getOrCreateMangoAccount ( #256 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-30 12:16:24 +02:00
microwavedcola1
c22302a1da
ts client improvement ( #254 )
...
* Perps: Support trusted markets
* ts: health on client side
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: change perp lookup
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: reword error messages, refactor common uses of lookups
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: reformat
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: improve typing
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fix some todos
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fix some todos
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: type aliasing
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: remove '| undefined' where not required as return type
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* ts: use trusted market flag for perp health
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-09-29 15:51:09 +02:00
Christian Kamm
7e180c7b3a
Perps: Support trusted markets
2022-09-29 15:40:31 +02:00
Christian Kamm
8ba52f46c2
Perp settle pnl: incentive for settler ( #252 )
...
This adds three new options to perp markets:
- a flat fee, that is paid for all perp settlements
- given that they exceed the configured min settle amount threshold to
be eligible for fees
- and a fractional fee, that only applies when the benefiting account
has low health and gradually becomes bigger as the account slides
towards liquidation
2022-09-29 12:59:55 +02:00
Nicholas Clarke
01a958cd22
Clarkeni/onchain interest ( #244 )
...
* Onchain interest calculation
* Fix to TokenBalanceLog for token_liq_bankruptcy (was previously using liqee liab position for liqor liab position).
* Log cumulative interest when token position is deactivated.
2022-09-28 23:04:33 -07:00
Christian Kamm
984695e8d0
liquidator: Call liq_perp_bankruptcy
2022-09-29 07:36:00 +02:00
Christian Kamm
12864e15a6
Merge pull request #245 from blockworks-foundation/ckamm/perp-settle
...
Liquidator: Settle pnl on perp accounts
2022-09-29 07:35:37 +02:00
Christian Kamm
77abfd0529
Perp liq: Fix base position liquidation amount computation
...
It was wrong for quote weights != 1.
2022-09-29 07:34:52 +02:00
microwavedcola1
dd83aeb156
ts: ALTs integration
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-28 17:09:59 +02:00
Christian Kamm
15d3a0cdfa
ts client: fix reading perp event queue
2022-09-28 10:48:41 +02:00
Christian Kamm
15d0a98c94
liquidator: settle pnl on liquidatable accounts
2022-09-28 10:48:41 +02:00
Christian Kamm
11daf4d0eb
client: fetch top settle pnl counterparties
2022-09-28 10:48:41 +02:00
Christian Kamm
9cbc352197
liquidator: force-cancel perp orders, liq perp base positions
2022-09-28 10:47:05 +02:00
conj0iner
a97b40a521
Merge pull request #234 from blockworks-foundation/cj/ioc_fees
...
Extra fees for IOC orders
2022-09-28 00:05:25 +08:00
tjs
1380481781
script to view unowned mango account
2022-09-27 11:40:22 -04:00
microwavedcola1
8d86883190
ts: remove debug code
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-27 17:33:51 +02:00
microwavedcola1
b57e50c75b
ts: fix tsc issues
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-27 13:59:00 +02:00
tjs
0def209608
allow fetching mango account by publickey
2022-09-26 17:12:58 -04:00
tjs
5b4a810c5e
push latest client
2022-09-26 10:10:01 -04:00
tjs
3b1ea91903
consistent naming to get serum markets
2022-09-25 21:11:38 -04:00
tjs
92a33a0bf5
return the correct type
2022-09-25 20:27:44 -04:00
tjs
b6bcc55fcb
add type guard
2022-09-25 20:26:02 -04:00
tjs
f486a6c381
helper fn to get serum3 external market
2022-09-25 16:23:43 -04:00
microwavedcola1
b7aa6dbd5d
ts: tiny liabs pushes health ratio beyond what I80F48 can support ( #243 )
...
* ts: tiny liabs pushes health ratio beyond what I80F48 can support
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* add alias
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-24 07:11:57 +02:00