@@ -60,15 +60,16 @@ pub enum LendingInstruction {
60
60
/// 6. `[]` Pyth product account.
61
61
/// 7. `[]` Pyth price account.
62
62
/// This will be used as the reserve liquidity oracle account.
63
- /// 8. `[writable]` Reserve collateral SPL Token mint - uninitialized.
64
- /// 9. `[writable]` Reserve collateral token supply - uninitialized.
65
- /// 10 `[]` Lending market account.
66
- /// 11 `[]` Derived lending market authority.
67
- /// 12 `[signer]` Lending market owner.
68
- /// 13 `[signer]` User transfer authority ($authority).
69
- /// 14 `[]` Clock sysvar.
70
- /// 15 `[]` Rent sysvar.
71
- /// 16 `[]` Token program id.
63
+ /// 8. `[]` Switchboard price feed account. used as a backup oracle
64
+ /// 9. `[writable]` Reserve collateral SPL Token mint - uninitialized.
65
+ /// 10`[writable]` Reserve collateral token supply - uninitialized.
66
+ /// 11 `[]` Lending market account.
67
+ /// 12 `[]` Derived lending market authority.
68
+ /// 13 `[signer]` Lending market owner.
69
+ /// 14 `[signer]` User transfer authority ($authority).
70
+ /// 15 `[]` Clock sysvar.
71
+ /// 16 `[]` Rent sysvar.
72
+ /// 17 `[]` Token program id.
72
73
InitReserve {
73
74
/// Initial amount of liquidity to deposit into the new reserve
74
75
liquidity_amount : u64 ,
@@ -82,8 +83,10 @@ pub enum LendingInstruction {
82
83
/// Accounts expected by this instruction:
83
84
///
84
85
/// 0. `[writable]` Reserve account.
85
- /// 1. `[]` Reserve liquidity oracle account.
86
+ /// 1. `[]` Pyth Reserve liquidity oracle account.
86
87
/// Must be the Pyth price account specified at InitReserve.
88
+ /// 1. `[]` Switchboard Reserve liquidity oracle account.
89
+ /// Must be the Switchboard price feed account specified at InitReserve.
87
90
/// 2. `[]` Clock sysvar.
88
91
RefreshReserve ,
89
92
@@ -101,10 +104,11 @@ pub enum LendingInstruction {
101
104
/// 4. `[writable]` Reserve collateral SPL Token mint.
102
105
/// 5. `[]` Lending market account.
103
106
/// 6. `[]` Derived lending market authority.
104
- /// 7. `[]` Reserve liquidity oracle account.
105
- /// 8. `[signer]` User transfer authority ($authority).
106
- /// 9. `[]` Clock sysvar.
107
- /// 10. `[]` Token program id.
107
+ /// 7. `[]` Pyth price oracle account.
108
+ /// 8. `[]` Switchboard price feed oracle account.
109
+ /// 9. `[signer]` User transfer authority ($authority).
110
+ /// 10 `[]` Clock sysvar.
111
+ /// 11 `[]` Token program id.
108
112
DepositReserveLiquidity {
109
113
/// Amount of liquidity to deposit in exchange for collateral tokens
110
114
liquidity_amount : u64 ,
@@ -638,6 +642,7 @@ pub fn init_reserve(
638
642
reserve_collateral_supply_pubkey : Pubkey ,
639
643
pyth_product_pubkey : Pubkey ,
640
644
pyth_price_pubkey : Pubkey ,
645
+ switchboard_feed_pubkey : Pubkey ,
641
646
lending_market_pubkey : Pubkey ,
642
647
lending_market_owner_pubkey : Pubkey ,
643
648
user_transfer_authority_pubkey : Pubkey ,
@@ -657,6 +662,7 @@ pub fn init_reserve(
657
662
AccountMeta :: new( reserve_collateral_supply_pubkey, false ) ,
658
663
AccountMeta :: new_readonly( pyth_product_pubkey, false ) ,
659
664
AccountMeta :: new_readonly( pyth_price_pubkey, false ) ,
665
+ AccountMeta :: new_readonly( switchboard_feed_pubkey, false ) ,
660
666
AccountMeta :: new_readonly( lending_market_pubkey, false ) ,
661
667
AccountMeta :: new_readonly( lending_market_authority_pubkey, false ) ,
662
668
AccountMeta :: new_readonly( lending_market_owner_pubkey, true ) ,
@@ -680,11 +686,13 @@ pub fn init_reserve(
680
686
pub fn refresh_reserve (
681
687
program_id : Pubkey ,
682
688
reserve_pubkey : Pubkey ,
683
- reserve_liquidity_oracle_pubkey : Pubkey ,
689
+ reserve_liquidity_pyth_oracle_pubkey : Pubkey ,
690
+ reserve_liquidity_switchboard_oracle_pubkey : Pubkey ,
684
691
) -> Instruction {
685
692
let accounts = vec ! [
686
693
AccountMeta :: new( reserve_pubkey, false ) ,
687
- AccountMeta :: new_readonly( reserve_liquidity_oracle_pubkey, false ) ,
694
+ AccountMeta :: new_readonly( reserve_liquidity_pyth_oracle_pubkey, false ) ,
695
+ AccountMeta :: new_readonly( reserve_liquidity_switchboard_oracle_pubkey, false ) ,
688
696
AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
689
697
] ;
690
698
Instruction {
0 commit comments