@@ -2157,11 +2157,6 @@ fn kamino_deposit_or_withdraw(
2157
2157
)
2158
2158
. 0 ;
2159
2159
2160
- let reserve_farm_state = reserve. farm_collateral ;
2161
- let reserve_liquidity_supply = reserve. liquidity . supply_vault ;
2162
- let reserve_collateral_mint = reserve. collateral . mint_pubkey ;
2163
- let reserve_destination_deposit_collateral = reserve. collateral . supply_vault ;
2164
-
2165
2160
let obligation_address = kamino_find_obligation_address ( wallet_address, reserve. lending_market ) ;
2166
2161
let obligation = kamino_unsafe_load_obligation ( obligation_address, account_data_cache) ?;
2167
2162
@@ -2172,7 +2167,7 @@ fn kamino_deposit_or_withdraw(
2172
2167
let obligation_farm_user_state = Pubkey :: find_program_address (
2173
2168
& [
2174
2169
b"user" ,
2175
- & reserve_farm_state . to_bytes ( ) ,
2170
+ & reserve . farm_collateral . to_bytes ( ) ,
2176
2171
& obligation_address. to_bytes ( ) ,
2177
2172
] ,
2178
2173
& FARMS_PROGRAM ,
@@ -2275,7 +2270,7 @@ fn kamino_deposit_or_withdraw(
2275
2270
// Reserve
2276
2271
AccountMeta :: new( market_reserve_address, false ) ,
2277
2272
// Reserve Farm State
2278
- AccountMeta :: new( reserve_farm_state , false ) ,
2273
+ AccountMeta :: new( reserve . farm_collateral , false ) ,
2279
2274
// Obligation Farm User State
2280
2275
AccountMeta :: new( obligation_farm_user_state, false ) ,
2281
2276
// Lending Market
@@ -2284,14 +2279,12 @@ fn kamino_deposit_or_withdraw(
2284
2279
AccountMeta :: new_readonly( FARMS_PROGRAM , false ) ,
2285
2280
// Rent
2286
2281
AccountMeta :: new_readonly( sysvar:: rent:: ID , false ) ,
2287
- // Token Program
2288
- AccountMeta :: new_readonly( spl_token:: id( ) , false ) ,
2289
2282
// System Program
2290
2283
AccountMeta :: new_readonly( system_program:: ID , false ) ,
2291
2284
] ,
2292
2285
) ;
2293
2286
2294
- if reserve_farm_state != Pubkey :: default ( ) {
2287
+ if reserve . farm_collateral != Pubkey :: default ( ) {
2295
2288
if account_data_cache
2296
2289
. get ( obligation_farm_user_state) ?
2297
2290
. 0
@@ -2331,12 +2324,14 @@ fn kamino_deposit_or_withdraw(
2331
2324
AccountMeta :: new( lending_market_authority, false ) ,
2332
2325
// Reserve
2333
2326
AccountMeta :: new( market_reserve_address, false ) ,
2327
+ // Reserve Liquidity Mint
2328
+ AccountMeta :: new( reserve. liquidity. mint_pubkey, false ) ,
2334
2329
// Reserve Source Collateral
2335
- AccountMeta :: new( reserve_destination_deposit_collateral , false ) ,
2330
+ AccountMeta :: new( reserve . collateral . supply_vault , false ) ,
2336
2331
// Reserve Collateral Mint
2337
- AccountMeta :: new( reserve_collateral_mint , false ) ,
2332
+ AccountMeta :: new( reserve . collateral . mint_pubkey , false ) ,
2338
2333
// Reserve Liquidity Supply
2339
- AccountMeta :: new( reserve_liquidity_supply , false ) ,
2334
+ AccountMeta :: new( reserve . liquidity . supply_vault , false ) ,
2340
2335
// User Liquidity
2341
2336
AccountMeta :: new(
2342
2337
spl_associated_token_account:: get_associated_token_address(
@@ -2349,6 +2344,8 @@ fn kamino_deposit_or_withdraw(
2349
2344
AccountMeta :: new_readonly( KAMINO_LEND_PROGRAM , false ) ,
2350
2345
// Token Program
2351
2346
AccountMeta :: new_readonly( spl_token:: id( ) , false ) ,
2347
+ // Token Program
2348
+ AccountMeta :: new_readonly( spl_token:: id( ) , false ) ,
2352
2349
// Sysvar: Instructions
2353
2350
AccountMeta :: new_readonly( sysvar:: instructions:: ID , false ) ,
2354
2351
] ,
@@ -2373,17 +2370,19 @@ fn kamino_deposit_or_withdraw(
2373
2370
// Obligation
2374
2371
AccountMeta :: new( obligation_address, false ) ,
2375
2372
// Lending Market
2376
- AccountMeta :: new_readonly( reserve. lending_market, false ) ,
2373
+ AccountMeta :: new_readonly( dbg! ( reserve. lending_market) , false ) ,
2377
2374
// Lending Market Authority
2378
- AccountMeta :: new( lending_market_authority, false ) ,
2375
+ AccountMeta :: new( dbg! ( lending_market_authority) , false ) ,
2379
2376
// Reserve
2380
- AccountMeta :: new( market_reserve_address, false ) ,
2377
+ AccountMeta :: new( dbg!( market_reserve_address) , false ) ,
2378
+ // Reserve Liquidity Mint
2379
+ AccountMeta :: new( reserve. liquidity. mint_pubkey, false ) ,
2381
2380
// Reserve Liquidity Supply
2382
- AccountMeta :: new( reserve_liquidity_supply , false ) ,
2381
+ AccountMeta :: new( reserve . liquidity . supply_vault , false ) ,
2383
2382
// Reserve Collateral Mint
2384
- AccountMeta :: new( reserve_collateral_mint , false ) ,
2383
+ AccountMeta :: new( reserve . collateral . mint_pubkey , false ) ,
2385
2384
// Reserve Destination Deposit Collateral
2386
- AccountMeta :: new( reserve_destination_deposit_collateral , false ) ,
2385
+ AccountMeta :: new( reserve . collateral . supply_vault , false ) ,
2387
2386
// User Source Liquidity
2388
2387
AccountMeta :: new(
2389
2388
spl_associated_token_account:: get_associated_token_address(
@@ -2396,6 +2395,8 @@ fn kamino_deposit_or_withdraw(
2396
2395
AccountMeta :: new_readonly( KAMINO_LEND_PROGRAM , false ) ,
2397
2396
// Token Program
2398
2397
AccountMeta :: new_readonly( spl_token:: id( ) , false ) ,
2398
+ // Token Program
2399
+ AccountMeta :: new_readonly( spl_token:: id( ) , false ) ,
2399
2400
// Sysvar: Instructions
2400
2401
AccountMeta :: new_readonly( sysvar:: instructions:: ID , false ) ,
2401
2402
] ,
@@ -2406,7 +2407,7 @@ fn kamino_deposit_or_withdraw(
2406
2407
} ;
2407
2408
2408
2409
// Instruction: Kamino: Refresh Obligation Farms For Reserve
2409
- if reserve_farm_state != Pubkey :: default ( ) {
2410
+ if reserve . farm_collateral != Pubkey :: default ( ) {
2410
2411
instructions. push ( kamino_refresh_obligation_farms_for_reserve) ;
2411
2412
}
2412
2413
0 commit comments