Skip to content

Commit

Permalink
v2.0.3 (#180)
Browse files Browse the repository at this point in the history
* oracle price multiplier (#174)

* oracle price multiplier

* changing added price weight to be i64

* rename added price weight

* Allow risk authority to change rate limiter config in the lending market (#167)

* account for risk authority in set lending market owner and config

* PR fixes

* only let risk authority disable outflows

* Optional, extra oracle on reserve (#176)

* minor refactoring of price fields in reserve

* adding extra oracle pubkey and extra market price to reserve

* using extra market price everywhere

* https://www.youtube.com/watch?v=uLHqpjW3aDs

* validate extra_oracle_pubkey in init reserve / update reserve

* writing tests

* more tests

* more refresh reserve checks

* adding some unit tests for extra_oracle stuff

* test init reserve

* clippy

* pr fixes

* don't care about staleness or variance for the extra oracle

* Collateralization Limits Final (#177)

* forgot to update smoothed price with price scale in switchboard case

* remove redundant multiply

* remove clock (#179)
  • Loading branch information
0xripleys authored Jan 22, 2024
1 parent 77dc842 commit 8068964
Show file tree
Hide file tree
Showing 34 changed files with 3,680 additions and 360 deletions.
6 changes: 6 additions & 0 deletions token-lending/cli/src/lending_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl SolendState {
*pubkey,
reserve.liquidity.pyth_oracle_pubkey,
reserve.liquidity.switchboard_oracle_pubkey,
reserve.config.extra_oracle_pubkey,
)
}));

Expand Down Expand Up @@ -128,6 +129,11 @@ impl SolendState {
self.obligation_pubkey,
withdraw_reserve.lending_market,
self.obligation.owner,
self.obligation
.deposits
.iter()
.map(|d| d.deposit_reserve)
.collect(),
));

instructions
Expand Down
11 changes: 11 additions & 0 deletions token-lending/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,12 @@ fn main() {

let added_borrow_weight_bps = value_of(arg_matches, "added_borrow_weight_bps").unwrap();
let reserve_type = value_of(arg_matches, "reserve_type").unwrap();
let scaled_price_offset_bps = value_of(arg_matches, "scaled_price_offset_bps").unwrap();
let extra_oracle_pubkey = pubkey_of(arg_matches, "extra_oracle_pubkey").unwrap();
let attributed_borrow_limit_open =
value_of(arg_matches, "attributed_borrow_limit_open").unwrap();
let attributed_borrow_limit_close =
value_of(arg_matches, "attributed_borrow_limit_close").unwrap();

let borrow_fee_wad = (borrow_fee * WAD as f64) as u64;
let flash_loan_fee_wad = (flash_loan_fee * WAD as f64) as u64;
Expand Down Expand Up @@ -1194,6 +1200,10 @@ fn main() {
protocol_take_rate,
added_borrow_weight_bps,
reserve_type,
scaled_price_offset_bps,
extra_oracle_pubkey: Some(extra_oracle_pubkey),
attributed_borrow_limit_open,
attributed_borrow_limit_close,
},
source_liquidity_pubkey,
source_liquidity_owner_keypair,
Expand Down Expand Up @@ -1542,6 +1552,7 @@ fn command_liquidate_obligation(
*pubkey,
reserve.liquidity.pyth_oracle_pubkey,
reserve.liquidity.switchboard_oracle_pubkey,
reserve.config.extra_oracle_pubkey,
)
}));

Expand Down
Loading

0 comments on commit 8068964

Please sign in to comment.