Commit Graph

15 Commits

Author SHA1 Message Date
Christian Kamm 072cd766ca
liquidator: parallel tcs execution (#679) 2023-08-18 15:36:02 +02:00
Christian Kamm ad47e9f2e9 tcs liq test: Add net borrow limit test 2023-08-14 16:15:57 +02:00
Christian Kamm f462c62816 ts: reuse tcs creation function 2023-08-10 13:48:28 +02:00
Christian Kamm b2e578bc61 Merge remote-tracking branch 'origin/deploy' into dev 2023-08-10 13:32:06 +02:00
Christian Kamm e4a9a56f89
Pass all params to token_register (#665)
Makes governance a little easier
2023-08-09 13:55:53 +02:00
Christian Kamm 4810b6afbc
Tcs: store a display-only intention enum (#667)
This way the ui can know what the user created the tcs order for.

Introduces tcs create and trigger v2 logs.
2023-08-08 18:16:59 +02:00
microwavedcola1 a7247ad7e7 fix ts calls
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-08-07 13:11:23 +02:00
microwavedcola1 776545fcdd
token conditional swaps, fixes from review (#653)
* tcs fixes from review, and easy to use helper functions

* Fixes from review

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>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-08-07 13:09:19 +02:00
microwavedcola1 a6b6fbbb82 fix ts calls
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-08-07 11:36:13 +02:00
Christian Kamm c67360071e Fix tcs test script 2023-07-03 15:23:22 +02:00
Christian Kamm 35064d4ab0
Token conditional swaps (#604)
Users can request token swaps to happen when the oracle price
is within a price band. Once the price is right, an executor can
trigger the swap. The executors are rewarded with a premium
over the oracle price.

This allows limit and stop loss orders on arbitrary spot pairs.

The PR comes with basic ts support and adjustments to the liquidator,
to execute available token conditional swaps.

Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2023-07-03 14:09:11 +02:00
Christian Kamm 5fc7aa1092
Configurable perp settle token (#550)
This changes perp market margining to no longer assume all pnl is in USD
while settlement is in USDC. Instead, a configurable settle token is used for
pnl and settlement, defaulting to USDC. 

There is no difference while the USDC price is forced to $1 and the init and liab
weights are 1. But with this patch, it becomes possible to change that.

For now it is not recommended to use a token other than USDC or USDT (or
another USD targeting stable token) for perp settlement.

The patch also updates all insurance vault use to be aware that the insurance
fund is not in USD but in USDC and apply the USDC price before payouts.
To do this, the previous PerpLiqNegativePnlOrBankruptcy was replaced by
a new PerpLiqNegativePnlOrBankruptcyV2 instruction.

Co-authored-by: microwavedcola1 <89031858+microwavedcola1@users.noreply.github.com>
2023-05-17 15:50:05 +02:00
Riordan Panayides 9a289a6e8c v0.9.16 2023-04-07 15:25:05 +01:00
Riordan Panayides b49e41a2eb Fix paths in archived scripts 2023-04-07 14:04:32 +01:00
microwavedcola1 9a77f8d64d reorg
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-04-04 08:36:54 +02:00