Commit Graph

993 Commits

Author SHA1 Message Date
Christian Kamm f169bcdafe Client: add token_withdraw 2022-08-10 16:24:48 +02:00
Christian Kamm 7fcee1af96 Liquidator: reload account between rebalance steps 2022-08-10 16:24:48 +02:00
Christian Kamm e8479e2e7c liq_token_with_token: Correctly adjust health cache for dusting
Previously the health cache adjustments didn't take into account that
positions between 0 and 1 native token would be dusted to 0.

This makes a difference for valuable tokens with few decimals. For
example 1 BTC-native token is currently worth 500k SOL-native tokens.
That means 0.9 BTC-native would easily be enough collateral for a 10k
SOL-native borrow -- but if the 0.9 get dusted, then the whole account
is bankrupt instead.
2022-08-10 16:24:48 +02:00
Christian Kamm 3139b0816a Client: Jupiter swaps preserve ata/token instructions 2022-08-10 16:24:48 +02:00
Christian Kamm 38f5502dc7 Liquidator: round up when paying back borrows to close token pos 2022-08-10 16:24:48 +02:00
Christian Kamm 19153b8874 Client: Fix jupiter api field that is sometimes null 2022-08-10 16:24:48 +02:00
Christian Kamm 6d8290bebd ts: script to decode anchor events 2022-08-10 16:22:58 +02:00
Christian Kamm ad3cee5568 ts: improve liqtest scripts 2022-08-10 16:22:58 +02:00
Christian Kamm 222358ff14 ts: script to make liquidation candidates 2022-08-10 16:22:58 +02:00
Christian Kamm 79e3b2db98 ts: disable loan fees in liq tests 2022-08-10 16:22:58 +02:00
Christian Kamm 68c52dbdc8 ts: Settle and close in script, including borrows 2022-08-10 16:22:58 +02:00
Christian Kamm 3257017770 ts: client and script fixes 2022-08-10 16:22:56 +02:00
Christian Kamm 55e891417e ts: also close accounts after withdraws 2022-08-10 16:20:25 +02:00
Christian Kamm 45327e7dd1 ts: script to withdraw everything, to lose fewer funds on close 2022-08-10 16:20:25 +02:00
Christian Kamm b2056c82e0 ts: script to add funds to liqtest group 2022-08-10 16:20:25 +02:00
Christian Kamm aff011c774 ts: script to create liqtest group with stub oracles 2022-08-10 16:20:25 +02:00
Christian Kamm 29c7d5b45a ts: mb-admin-close script closes all groups for the key 2022-08-10 16:20:23 +02:00
Christian Kamm 13e4d0a432 Client: Fix loan amount for jupiter ExactOut swaps 2022-08-10 16:18:41 +02:00
Christian Kamm 2552bffc66 Liquidator: blocking-wait for data after actions
To avoid sending a second jupiter-swap while the first one is still
in-flight.
2022-08-10 16:18:41 +02:00
Christian Kamm cce1881223 Liquidator: basic sell/buy to keep only quote 2022-08-10 16:18:41 +02:00
Christian Kamm 9bb125d016 Client: Allow getting the jupiter route 2022-08-10 16:18:41 +02:00
Christian Kamm 5c40c12cf5 Liquidator: cleanups 2022-08-10 16:18:41 +02:00
microwavedcola1 5c34b60105 Fix health account builder code
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 10:15:28 +02:00
microwavedcola1 68de248c5b fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 09:31:58 +02:00
microwavedcola1 476241e8b8 fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 09:29:08 +02:00
microwavedcola1 2728aaeb2d revamp script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 09:26:16 +02:00
microwavedcola1 dd05fade76 Fix scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 09:16:07 +02:00
microwavedcola1 d6468082b6 Merge branch 'dev' 2022-08-10 09:08:11 +02:00
microwavedcola1 8b086b3e87 more logging
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 08:22:31 +02:00
microwavedcola1 e0c57af53f some debugging scripts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 07:32:21 +02:00
tjs 85bb7e3a25 add idempotent ata ix to withdraw fn 2022-08-09 18:16:08 -07:00
tjs e2acd28de9 use idempotentata instruction in marginTrade 2022-08-09 15:27:34 -07:00
microwavedcola1 970187af41
rename env vars (#154)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-09 13:50:37 +02:00
riordanp 9fd4817da8
Merge pull request #150 from blockworks-foundation/mc/docker
mc/docker
2022-08-09 12:17:13 +01:00
Riordan Panayides 1ce160e524 Revert changes to client.ts 2022-08-09 12:16:27 +01:00
Riordan Panayides f94c7c3bed Update trigger branch 2022-08-09 12:14:48 +01:00
Riordan Panayides 434cf61424 Revert changes to client.ts 2022-08-09 12:14:13 +01:00
Christian Kamm 7c72a1956a Withdraw: Allow withdrawing all funds with allow_borrow=false
We should also add the ability to withdraw as much as possible without
borrowing and without specifying the exact amount, for convenience.
2022-08-09 11:56:08 +02:00
microwavedcola1 5733a05a36 update rates only once every 60 secs
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-09 11:20:42 +02:00
tjs 49538df6ab skippreflight on accountCreate 2022-08-08 16:14:30 -07:00
Riordan Panayides 3a4327f50d Change registry URL, tidy up diff 2022-08-08 23:34:15 +01:00
riordanp 5af39e7956
Merge branch 'dev' into mc/docker 2022-08-08 20:54:31 +01:00
Riordan Panayides e3d69a588d Remove push trigger 2022-08-08 20:32:32 +01:00
Riordan Panayides 458fea705b Force run 2022-08-08 20:29:10 +01:00
Riordan Panayides dbb1c314da Add ci-docker-heroku-deploy.yml 2022-08-08 20:25:56 +01:00
Riordan Panayides e97e8a085a Remove ci-docker-heroku-deploy.yml 2022-08-08 20:24:24 +01:00
Riordan Panayides a53c061d1f Superficial change to force workflow parsing 2022-08-08 20:20:17 +01:00
Riordan Panayides 49ee6416b1 Trigger Build 2022-08-08 20:17:40 +01:00
Riordan Panayides 4024e76bd0 Fix YAML 2022-08-08 20:15:14 +01:00
Riordan Panayides 442b6a6ff0 Fix yaml 2022-08-08 20:14:07 +01:00