microwavedcola1
5402012064
apply loan origination fee buffer
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-11 17:59:49 +02:00
microwavedcola1
185b077285
remove stray log
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-11 17:48:43 +02:00
microwavedcola1
eee10a22bb
mc/max swap ( #159 )
...
* rework getMaxSourceForTokenSwap
* Fix assets and liabs method
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-11 17:44:12 +02:00
Conj0iner
02c19a6eb4
Optimise entry price calculations
2022-08-11 22:58:47 +08:00
Christian Kamm
ac58081430
Audit: Fix some account constraints
2022-08-11 13:30:04 +02:00
Christian Kamm
7dc3fc2ad9
Merge remote-tracking branch 'origin/main' into dev
2022-08-10 17:18:42 +02:00
microwavedcola1
cfdd59379e
improve logging
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-10 17:17:16 +02:00
Christian Kamm
fbdc5ee6b4
Merge pull request #147 from blockworks-foundation/ckamm/liq-and-rebalance
...
Liquidate and buy/sell to keep only quote
2022-08-10 17:09:16 +02:00
Christian Kamm
2f3c5e281c
ts: prettier
2022-08-10 16:25:06 +02:00
Christian Kamm
b52aad82e1
Liquidator: more pyth -> oracles renames
2022-08-10 16:24:48 +02:00
Christian Kamm
405c41edcf
Liquidator: Fix rebalance to empty token accounts
...
By withdrawing to the liqor wallet if necessary.
2022-08-10 16:24:48 +02:00
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