Commit Graph

419 Commits

Author SHA1 Message Date
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 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
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 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
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
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
Nicholas Clarke e509a3ae9c
Clarkeni/overall pnl (#232)
* Add getPNL client function
2022-09-23 11:39:51 -07:00
Nicholas Clarke 1320451e1a
Add serum open orders balance logging. Remove price from token and perp balances. (#236) 2022-09-23 10:42:43 -07:00
microwavedcola1 bb6790e678
ts: use price factor in maxSourceForSwap + max perp bid and ask + tests (#237)
* ts: use price factor in maxSourceForSwap
ts: max perp bid and ask
ts: mocha test for max swap

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* ts: comemnt

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-23 11:43:26 +02:00
Christian Kamm 39bdf20813 ts: Add group.findPerpMarket() 2022-09-23 09:48:35 +02:00
microwavedcola1 4090cf407e ts: fix max serum bid and ask that can be placed by a mango account (#241)
* ts: fix getMaxQuoteForSerum3BidUi and getMaxBaseForSerum3AskUi where the zero amount was not tight enough for binary search

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-23 09:34:28 +02:00
Christian Kamm ecbd4028f7 ts client: Fix remaining accounts when opening a perp position 2022-09-23 08:42:01 +02:00
Conj0iner a8ae59f0fe IDL and client changes 2022-09-23 01:03:45 +08:00
Christian Kamm 96218fb7ba Update IDL and merge issue fixups 2022-09-21 10:19:23 +02:00
Christian Kamm 52f8b61240 Merge remote-tracking branch 'origin/dev' 2022-09-21 10:14:34 +02:00
Christian Kamm a41a245e24 PerpLiqBankruptcy instruction 2022-09-21 09:46:54 +02:00
conj0iner 1c67b8ed5f
remove base_token_index from perps and include oracles (#224)
Co-authored-by: Conj0iner <conj0iner@users.noreply.github.com>
2022-09-21 09:42:45 +02:00
microwavedcola1 f96b9ded0d ts: fix event queue rawevents
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-20 19:50:21 +02:00
Christian Kamm 8c91541d12 ts client: Fix serum3DeregisterMarket
The indexReservation arg wasn't passed.
2022-09-20 16:58:07 +02:00
Christian Kamm 6399e6cb6c Fix PerpMarket data layout breakage
The new fees_settled must be added at the end and the reserved amount
needs to be reduced.
2022-09-20 16:58:07 +02:00
Christian Kamm 347b225480 TokenEdit: remove bank_num arg 2022-09-20 14:22:25 +02:00
microwavedcola1 b7e79a4663
WIP: ts/perps (#220)
* ts: further fleshing out of perps code

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* cleanup scripts

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from reviews

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-20 12:57:01 +02:00
Christian Kamm 1b3a2b07db Update idl 2022-09-15 09:24:35 +02:00
Christian Kamm 899b51e91c ts: fix getMaxWithdrawWithBorrowForToken 2022-09-14 10:23:06 -04:00
Christian Kamm 3e94ff4605 ts: fix getMaxWithdrawWithBorrowForToken 2022-09-14 09:03:29 +02:00
tjs 2b96965cc5 use send transaction in client 2022-09-14 01:44:00 -04:00
tjs fc63328af1 set lastValidBlockHeight for tx confirmation 2022-09-05 17:36:42 -04:00
tjs 27c42e70e9 reload mango account with slot 2022-09-05 12:31:57 -04:00
tjs 2d0772833b filter out jupiter token ledger instruction to save space 2022-09-02 18:47:26 -04:00
tjs c359ce26a7 return new mango account instance from reload 2022-09-02 18:47:09 -04:00
tjs 3f456393a5 use custom sendTransaction in closeMangoAccount 2022-09-02 13:50:01 -04:00
Christian Kamm 3fbc3ca32d TokenEdit: remove bank_num arg 2022-09-02 13:55:00 +02:00
Christian Kamm ef5552c1c0 Liqtest: Build serum test case 2022-09-02 12:24:18 +02:00
Christian Kamm 90630fa3de ts client: Enable accounts to have serum slots by default 2022-09-02 12:24:04 +02:00
Christian Kamm d566db7db0 Liqtest: Settle-and-close settles and closes open serum orders 2022-09-02 12:24:04 +02:00
Christian Kamm 3b3258769f ts: TokenEdit takes optional arguments 2022-09-02 12:24:04 +02:00
Christian Kamm 22dc07df1d Liquidation test: Fix scripts 2022-09-02 10:22:35 +02:00
Christian Kamm 3b93a38395
Merge pull request #208 from blockworks-foundation/ckamm/fix-index-reservation
Serum: Index reservation account has 8 bytes
2022-09-01 13:23:27 +02:00
Christian Kamm 868c55fef1 Serum index reservation: use a real account
Makes it easier and more future-proof
2022-09-01 12:28:37 +02:00
Christian Kamm c31f11013f Serum deregister: Close index reservation account
Only safe because this is a testing-only instruction
2022-09-01 12:15:00 +02:00
microwavedcola1 c420d71943 ts: fix withdraw wrapped sol -> sol
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-01 12:11:31 +02:00
microwavedcola1 0222ca8954
ts fixes (#207)
* ts: use gpa path if rest services has not caught up yet

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* ts: convert wrapped sol to sol when withdrawing

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-01 11:25:58 +02:00
microwavedcola1 149e0eb0c7 Fix client and remove excessive logging in scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-01 10:48:50 +02:00
microwavedcola1 2479107d9a
Prepare serum3 release (#206) 2022-09-01 10:18:47 +02:00
microwavedcola1 a889e6c206 Fix scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-09-01 09:56:17 +02:00
microwavedcola1 5ff181d01d Merge branch 'dev' 2022-09-01 09:52:29 +02:00