Christian Kamm
e8bbfbef83
Bank: fix collection of loan fee
...
Instead of changing indexed_borrows, change borrow_index!
2022-08-16 16:27:45 +02:00
Christian Kamm
4c65204c19
Liquidator: Fix condition for starting to liquidate
2022-08-16 16:19:04 +02:00
microwavedcola1
afc95f4498
fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-16 13:49:33 +02:00
Christian Kamm
421b2d3d19
FlashLoan: Fix validation holes
...
- Pass the group to Begin and End and ensure it is the same.
- Enforce target token accounts can't be group-owned.
- Now End can consistently derive the number of vaults/token accounts.
2022-08-16 13:10:05 +02:00
Christian Kamm
54222c5b3f
liq_token_bankruptcy: don't pass redundant index
2022-08-16 13:08:57 +02:00
Christian Kamm
e92561d32e
Liquidation: Fix rounding issues in liq_token_bankruptcy
...
By explicitly dusting trace positive positions.
2022-08-16 13:08:43 +02:00
Christian Kamm
961a81b94f
Liquidation: Fix positive dust issues
2022-08-16 13:08:43 +02:00
Christian Kamm
82864e5f6f
Liquidator: disable allow-borrow, now that fixed program is deployed
2022-08-16 12:13:54 +02:00
Christian Kamm
af5f622bd8
Liquidator: bankruptcy requires borrows
2022-08-16 12:13:54 +02:00
tjs
3c06b718c6
handle when optional param doesnt exist
2022-08-16 01:08:25 -04:00
tjs
2483e7cc18
support passing additional signers to sendTransaction
2022-08-16 01:04:14 -04:00
tjs
a9c4f54917
use custom sendTransaction in the client
2022-08-16 00:27:06 -04:00
microwavedcola1
4ee4ab829f
more defensive coding
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 20:23:51 +02:00
microwavedcola1
da93f1118e
defensive code
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 20:19:09 +02:00
microwavedcola1
20c915f0ee
return 0 for swap from same source to same target
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 20:16:46 +02:00
microwavedcola1
03dbac82f9
error for debugging banks
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 19:13:18 +02:00
microwavedcola1
24524d7cd5
update scripts
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 15:53:51 +02:00
Christian Kamm
c9a5fb5fc1
ScanningAccountRetriever: Don't mut-borrow oracles ( #170 )
...
This allows using the same oracle for different banks, like for ETH and
soETH.
2022-08-15 11:32:54 +02:00
microwavedcola1
551e101b08
fix health ratio computation
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 11:21:29 +02:00
microwavedcola1
4df94615ee
Fix client
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-15 11:10:33 +02:00
Christian Kamm
58105207af
Make anchor's lint pass
2022-08-15 10:48:43 +02:00
Christian Kamm
0265b9b0a9
Account: Change type of net_deposts / net_settled
...
Because f32 doesn't have enough significant digits for large deposits.
2022-08-15 10:48:43 +02:00
Christian Kamm
18857c7b72
Add "client" feature annoations
2022-08-15 10:48:43 +02:00
Christian Kamm
6a77a5c349
tests: fix compilation warnings
2022-08-15 10:48:43 +02:00
Christian Kamm
fcecd21cdb
health: remove duplicated code
2022-08-15 10:48:43 +02:00
microwavedcola1
1b6ed725be
over explaining the code ( #168 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-14 20:45:57 +02:00
Christian Kamm
7a343a9a8d
checked_math: support casts and I80F48::from
2022-08-14 15:01:15 +02:00
Christian Kamm
d91a676e3d
Oracle: Decimal constant cleanup
2022-08-14 15:01:15 +02:00
Christian Kamm
724824d21a
Bank: small fixes from audit
2022-08-14 15:01:15 +02:00
microwavedcola1
b977556426
fix debug scripts
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-14 13:30:08 +02:00
microwavedcola1
017581e863
fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-13 20:51:09 +02:00
microwavedcola1
d59d05eae5
default group is group num 2 on mainnet
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-13 20:10:49 +02:00
microwavedcola1
5221bbd53b
Merge branch 'dev'
...
--wip-- [skip ci]
2022-08-13 19:55:37 +02:00
Christian Kamm
ccba4ee597
Cleanups and bugfixes from the audit ( #163 )
...
* AccountExpand: cleanups from audit
* Group instructions: cleanups from audit
* AccountClose: cleanups from audit
* TokenAddBank: Audit fixes, including significant bugs
Must not take collected_fees and bump from the existing bank.
* Instruction comment updates
* GroupEdit: Add version/testing flag changes
Ported from mc/vanity
2022-08-13 19:54:58 +02:00
microwavedcola1
41e42da620
debug banks helper script
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-13 19:36:09 +02:00
Christian Kamm
21815612ae
Let all PDA seeds start with a unique prefix ( #166 )
...
This is mostly paranoia. Now it's guaranteed that different PDA types
have unique seeds.
2022-08-13 19:30:35 +02:00
Christian Kamm
a3067e2448
Avoid custom Debug impls by using derivative crate
2022-08-13 10:18:04 +02:00
tjs
d68951e77d
add custom sendTransaction to support post send callbacks
2022-08-12 17:15:12 -07:00
Riordan Panayides
8335c5495e
Fix liquidator command
2022-08-12 15:31:53 +01:00
Riordan Panayides
fa82980508
Upgrade docker runtime distro
2022-08-12 14:17:18 +01:00
Riordan Panayides
bd5f874609
Add glibc to runtime image
2022-08-12 13:36:50 +01:00
microwavedcola1
261c856bb2
reduce max source swap targetError so that we dont error out
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-12 11:08:08 +02:00
microwavedcola1
a484aed42b
simulate on non existent token positions ( #162 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-12 11:05:39 +02:00
microwavedcola1
164303e005
uncomment
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-12 10:21:06 +02:00
microwavedcola1
00c533d9d7
Merge branch 'dev'
2022-08-12 08:31:20 +02:00
microwavedcola1
4f25742b26
simHealthWithTokenPositionChanges -> simHealthRatioWithTokenPositionChanges
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-12 08:30:13 +02:00
tjs
ac0155b79d
fix for simHealthWithTokenPositionChanges
...
needs to keep track of health changes in the loop
2022-08-11 16:43:46 -07:00
Christian Kamm
92a37f23ed
Remove is_bankrupt
...
Instead, check for any liquidatable assets in liq_token_bankruptcy.
Bankrupt accounts may use the same operations as any other
negative-health account.
2022-08-11 22:57:53 +02:00
tjs
4507a6a72a
health ratio ui function
2022-08-11 12:06:01 -07:00
conj0iner
52660f1476
Merge pull request #158 from blockworks-foundation/cj/optimisedentryprice
...
Optimised entry position calculation
2022-08-12 01:36:25 +08:00