Commit Graph

6 Commits

Author SHA1 Message Date
microwavedcola1 25a90580fd Fix group in script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-08-09 15:01:19 +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