Christian Kamm
c8f1f3c821
Net borrow limits: Limit in quote, not native ( #312 )
...
* Net borrow limits: Limit in quote, not native
* make perp settle limit disableable
2022-12-02 12:24:11 +01:00
riordanp
748334d674
Fix liquidator ( #302 )
...
* Fix liquidator
* Remove redundant variable.
Co-authored-by: Nicholas Clarke <nicholasgclarke@gmail.com>
2022-11-22 07:10:23 +01:00
microwavedcola1
44d0170ea9
mc/settle pnl ts client ( #292 )
...
* oracle peg client support
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* perp pnl settle, candidate finder, and example
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-21 20:36:13 +01:00
microwavedcola1
d82608ebee
Revert "add support for msrm vault for serum3 discounts ( #285 )"
...
This reverts commit 0a4f7150d6
.
2022-11-20 15:31:16 +01:00
conj0iner
39ed94aa87
client additions + extra tests + safety ( #281 )
...
Co-authored-by: Conj0iner <conj0iner@users.noreply.github.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-18 08:58:56 +01:00
riordanp
5d780a86dc
Upgrade to Solana 1.10.35 ( #291 )
...
* 1.10.35 upgrade & compatibility
* Patch Anchor
* Fix test compile
* Serum program update
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-11-16 10:50:40 +00:00
Christian Kamm
2ee152f7ea
Oracle staleness: Check when accessing oracle price
2022-11-12 12:12:45 +01:00
microwavedcola1
0a4f7150d6
add support for msrm vault for serum3 discounts ( #285 )
...
* add support for msrm vault for serum3 discounts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix client
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* client support
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* More client code and todos
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* prettoer
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* remove mint, not needed
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-09 09:59:42 +01:00
microwavedcola1
e8ba511c45
mc/flash loan for delegate ( #271 )
...
* flash loan for delegates
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix rust client
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* prettier
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-11-09 09:35:13 +01:00
Christian Kamm
7da421ea1c
Fix client and keeper for new perp orderbooks
2022-11-09 09:32:32 +01:00
Riordan Panayides
21e4b080e3
Fix incorrect open orders start index
2022-11-02 17:13:25 +00:00
Christian Kamm
f2cc869795
Perps: Prepare for settlement token != oracle token
...
Make sure the setting is available and that the needed accounts are
passed to the perp instructions.
2022-10-06 08:32:58 +02:00
Christian Kamm
b906e3dc78
Token deposit: Split into signed and permissionless ix
...
Token accounts are a limited resource, so allowing other users to make
use of them can cause problems.
2022-10-02 16:06:39 +02:00
Christian Kamm
7e180c7b3a
Perps: Support trusted markets
2022-09-29 15:40:31 +02:00
Christian Kamm
8ba52f46c2
Perp settle pnl: incentive for settler ( #252 )
...
This adds three new options to perp markets:
- a flat fee, that is paid for all perp settlements
- given that they exceed the configured min settle amount threshold to
be eligible for fees
- and a fractional fee, that only applies when the benefiting account
has low health and gradually becomes bigger as the account slides
towards liquidation
2022-09-29 12:59:55 +02:00
Christian Kamm
984695e8d0
liquidator: Call liq_perp_bankruptcy
2022-09-29 07:36:00 +02:00
Christian Kamm
15d0a98c94
liquidator: settle pnl on liquidatable accounts
2022-09-28 10:48:41 +02:00
Christian Kamm
11daf4d0eb
client: fetch top settle pnl counterparties
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
Christian Kamm
d86b3dd757
Rust client: Fix remaining accounts perp oracles
2022-09-23 09:07:51 +02:00
Christian Kamm
50be520e99
Rename: LiqToken* -> TokenLiq*
2022-09-14 16:22:42 +02:00
Christian Kamm
8bde9e2bff
Liquidator: Force cancel serum orders
2022-09-02 12:23:59 +02:00
Christian Kamm
1f0cd62846
Don't panic if accounts are shorter than 8 bytes
2022-09-01 12:00:09 +02:00
Christian Kamm
8a2d54cce8
Fix some clippy warnings
2022-08-30 13:59:34 +02:00
Christian Kamm
e0437305ee
SerumPlaceOrder: Only pass the payer bank/vault
2022-08-30 12:05:07 +02:00
Christian Kamm
2d2cef35a0
Add HealthRegion instructions
...
You can do
- HealthRegionBegin
- ... mango instructions ...
- HealthRegionEnd
and the account health will only be checked at the start and end
instead of for every instruction.
2022-08-24 10:07:45 +02:00
Christian Kamm
09fc5f716b
Renames in MangoAccount
...
- Accessors in MangoAccountValue
- PerpPositions -> PerpPosition
2022-08-19 14:58:20 +02:00
Nicholas Clarke
8a1c58e723
FlashLoan: Add flash_loan_type ( #164 )
...
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-08-17 12:36:55 +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
f169bcdafe
Client: add token_withdraw
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
19153b8874
Client: Fix jupiter api field that is sometimes null
2022-08-10 16:24:48 +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
microwavedcola1
e06736660a
remove account size, make mango account feature position counts explicit ( #148 )
...
* remove account size from program, make position counts explicit
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* cargo-fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-07 14:16:06 +02:00
Christian Kamm
681c69e3a5
Client: Add jupiter_swap ( #139 )
2022-08-04 17:01:00 +02:00
Christian Kamm
d3a634c709
Cargo: Fix mango-v4 deps to specify client feature
2022-08-03 09:48:50 +02:00
Christian Kamm
b0dae7ec22
client: construct from account pubkeys
2022-08-02 09:45:12 +02:00
Christian Kamm
16290e07f4
client: fix mango account reading
2022-08-02 09:45:12 +02:00
Christian Kamm
c22590302a
Add "cli" command line tool to generate pda addresses
2022-08-02 09:45:12 +02:00
microwavedcola1
a9a03b97ac
mc/registration time ( #132 )
...
* registration time
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* mc/u32 numbers - consistent numbers in pdas (#133 )
* consistent numbers in pdas
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-01 18:46:45 +02:00
Christian Kamm
16e1e83e26
Client: Move chain_data to client for reuse
2022-07-31 11:03:54 +02:00
microwavedcola1
c88297f42e
mc/ts and keeper improvements ( #127 )
...
* ts and keeper improvements
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* remove stray heroku experiments
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from reviews
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-31 09:25:11 +02:00
microwavedcola1
f2bfb951fd
anchor as submodule ( #121 )
...
* anchor as submodule
* Use anchor submodule as dependency
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-27 08:52:41 +02:00
microwavedcola1
2fb92abad8
Mc/ts upgrade ( #122 )
...
* upgrade anchor fork, supports anchor idl close now
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* upgrade ts deps
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-26 17:14:07 +02:00
microwavedcola1
0b2e1e6e6c
Mc/realloc 4 ( #119 )
...
Realloc + dynamic mango account
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-25 16:07:53 +02:00
microwavedcola1
3eae2cdc34
upgrade anchor to latest, upgrade solana dependencies to match what latest anchor uses
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-20 15:51:10 +02:00