Christian Kamm
c276353289
Implement a stable_price on banks and perp markets ( #303 )
...
It is tracked in the StablePriceModel and updated on
TokenUpdateIndexAndRate and PerpUpdateFunding instructions.
The stable price is used in health computations.
2022-11-24 11:55:22 +01:00
Christian Kamm
58f7ff2e0e
Add staleness param to OracleConfig
...
Since Bank can't expand the existing OracleConfig, add a new one to Bank
and (temporarily!) copy over the old value to the new one in
TokenUpdateIndexAndRate.
Add some reserved space to OracleConfig to make this easier in the
future.
Breaks the PerpMarket and PerpPosition layouts
2022-11-12 12:11:09 +01:00
Christian Kamm
b6361bad37
PerpUpdateFunding: update automatically on PerpPlaceOrder ( #287 )
2022-11-10 14:41:20 +01:00
Nicholas Clarke
96344d7de1
Clarkeni/perp logging ( #265 )
...
* Perp instruction logging
* Onchain funding calculation
* perp_spot_transfers field on perp positions
* Logging on register token, perp market
* Additional fields on update token index logging
* maker and taker volume fields on perp position
2022-10-07 12:12:55 -07: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
microwavedcola1
d594286266
reserve for ALTs ( #152 )
...
* reserve for ALTs
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* add explicit padding
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>
2022-08-08 18:50:59 +02:00
Christian Kamm
dded844693
Update dynamic interest and default token parameters
2022-08-06 21:06:34 +02:00
microwavedcola1
59d28c97a1
fix name and error message check in flash loan ( #145 )
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-06 12:59:13 +02:00
Christian Kamm
a994626ef5
TokenRegister: Fix anchor seed derivation
...
It likes names constant, but not constant literals.
2022-08-04 08:25:41 +02:00
microwavedcola1
b62c0cd9be
fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-03 15:45:10 +02:00
microwavedcola1
9d117c84ac
fix from review
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-03 15:45:10 +02:00
microwavedcola1
505cbd48aa
fixes from review
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-03 15:45:10 +02:00
microwavedcola1
59dd3aa66e
insurance fund for trustless vs not trustful
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-03 15:45:10 +02:00
microwavedcola1
e31ad9ce34
token register trustless
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-03 15:45:10 +02:00