microwavedcola1
efed3a03ab
Merge branch 'dev'
2022-07-14 08:52:12 +02:00
tjshipe
fcf3da0a9b
patch anchor's simulate fn so signing is required for simulation ( #106 )
2022-07-14 08:42:21 +02:00
microwavedcola1
bc4c57911a
Health from health components in ts/client ( #104 )
2022-07-13 19:18:55 +02:00
microwavedcola1
97d936c9ca
attempt to skip wallet approve dialg box - dont sign
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-13 18:02:08 +02:00
microwavedcola1
4ca1e30bf5
Fix comment
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-13 18:01:59 +02:00
Christian Kamm
03882e6dd3
Fix CI build-bpf builds
2022-07-13 14:36:44 +02:00
tjs
c09dff71ed
export all mango account types and functions
2022-07-12 22:09:21 -04:00
microwavedcola1
14147cd395
client functions 2 ( #103 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-12 12:05:19 +02:00
Christian Kamm
86a84396f5
Health: cleanup and new functions for ratio and assets/liabs
2022-07-12 09:47:23 +02:00
Christian Kamm
6f758ff25b
clippy
2022-07-12 09:46:17 +02:00
Christian Kamm
b77af54f15
Fix tests
2022-07-11 22:31:00 +02:00
microwavedcola1
c76d3b1cd2
Update IDL
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-11 17:11:39 +02:00
microwavedcola1
ef7d2862da
wip: dynamic rates ( #98 )
...
* dynamic rates
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fmt
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-11 17:08:32 +02:00
Christian Kamm
f132f30874
Better error messages
2022-07-08 12:48:43 +02:00
Christian Kamm
420132cf89
Merge pull request #99 from blockworks-foundation/ckamm/deactivate-token-positions
...
Deactivate token positions for liquidation and serum instructions
2022-07-08 09:11:55 +02:00
Christian Kamm
469e7fd704
Use get() instead of get_mut() where possible
2022-07-08 09:10:08 +02:00
tjs
9bec0f3c23
remove console logs
2022-07-07 16:43:19 -04:00
tjs
f62b72cd1d
consistent naming for banks and vaults
2022-07-07 13:04:54 -04:00
Christian Kamm
c829fdf59d
Fix keeper build
2022-07-07 14:28:30 +02:00
Christian Kamm
6c7245adaa
Serum3 liq force cancel orders: Deactivate inactive token positions
2022-07-07 13:22:25 +02:00
Christian Kamm
693333b71e
Serum3 place/settle: deactivate inactive token positions
2022-07-07 13:16:23 +02:00
Christian Kamm
9f90c3982f
Fix serum3 loan origination fee withdrawal
...
Paying the loan origination fee must be like a withdrawal and can't be
charged as a borrow if the user has deposits.
2022-07-07 12:33:21 +02:00
Christian Kamm
45da68c6ac
LiqTokenWithToken: Close inactive token positions
2022-07-07 12:24:48 +02:00
Christian Kamm
31831454b4
Return raw position index from get_mut()
2022-07-07 12:01:18 +02:00
tjs
ab0b77f5f6
marginTrade3 with passed in jup instructions
2022-07-07 00:45:01 -04:00
microwavedcola1
0ff269c38c
Merge branch 'main' into dev
2022-07-06 17:47:45 +02:00
microwavedcola1
ab3abc69e7
Fix flash loan3 - fetching of bank from retriever
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-06 17:41:08 +02:00
microwavedcola1
b0f1585541
Merge branch 'main' into dev
2022-07-06 17:11:20 +02:00
microwavedcola1
8a1e9136a6
better error msg
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-06 17:11:12 +02:00
Christian Kamm
ffd83a7a05
Rename instructions to follow naming pattern ( #97 )
2022-07-06 14:51:15 +02:00
Christian Kamm
7d68378189
Add a CHANGELOG
2022-07-06 14:15:03 +02:00
Nicholas Clarke
348fbc1cb9
Track cumulative net deposits (deposits - withdraws) ( #91 )
...
Track cumulative net deposits (deposits - withdraws) using prices at the time of the deposit and withdraw.
This is used for calculating overall pnl (across all tokens).
I want to store UI amount * UI price = (native amount / base decimals) * (oracle price * base decimals / quote decimals) => native amount * oracle price / quote decimals.
I have used f32 here to reduce the space required on the mango account - we don't need so much precision for this as it's purely a display value.
I've also included a field for net_settled - this will be used for perp pnl but is not implemented yet (as perp settling instructions are not ready).
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-06 12:07:30 +02:00
Christian Kamm
5b72e85634
Merge pull request #95 from blockworks-foundation/ckamm/insurance-fund
...
liq_token_bankruptcy for socialized loss and insurance fund
2022-07-06 11:47:28 +02:00
Christian Kamm
de86b69e1a
Client/program interface changes
...
- rearrange structs to have gPA data in front and add comments about the
offsets being relevant
- add insuranceMint to group creation in client
- drop quoteTokenIndex storage on PerpMarket
- fixes to editAccount in example1-user and client
2022-07-06 11:34:07 +02:00
Christian Kamm
f2d8aceebe
Update idl
2022-07-06 11:34:04 +02:00
Christian Kamm
35517bdb75
Review fixes
2022-07-06 11:34:04 +02:00
Christian Kamm
b25f6d5f4f
Insurance fund
2022-07-06 09:07:50 +02:00
Christian Kamm
35ca4d31b3
liq_token_bankruptcy instruction for socialized loss
2022-07-06 09:07:49 +02:00
tjs
1b04f924e3
make jup-ag/core a devdependency
2022-07-05 23:38:53 -04:00
tjs
1451ebc2a1
Merge branch 'ts/deps' into dev
2022-07-05 21:36:45 -04:00
Nicholas Clarke
30fc7def77
Add oracle price to update_index logging. ( #89 )
...
* Add oracle price to update_index logging.
* Update IDL with changes to update_index instruction and logging.
2022-07-05 11:59:44 -07:00
microwavedcola1
d74cc78a84
edit tokens, perp markets, mango accounts, allow delegate to perform certain operations ( #94 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-05 19:31:47 +02:00
tjs
f3b0c883d6
export banks
2022-07-04 19:23:00 -04:00
microwavedcola1
dc4aee885b
add doc
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-04 15:52:32 +02:00
microwavedcola1
301b00a452
add exampole
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-04 15:34:16 +02:00
microwavedcola1
dff3f7cd8c
client functions via program simulation
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-04 14:11:38 +02:00
microwavedcola1
39284c5705
Flash loan 3 minimal example ( #90 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-04 12:09:33 +02:00
tjs
d7f84f6a8e
use price or previousPrice
2022-07-03 21:47:02 -04:00
tjs
9789ec00d6
export utils
2022-07-03 20:30:38 -04:00
microwavedcola1
6a99eb893b
Fix types
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-01 14:31:47 +02:00