lib.rs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. // This file is autogenerated with https://github.com/acheroncrypto/native-to-anchor
  2. use anchor_lang::prelude::*;
  3. declare_id!("11111111111111111111111111111111");
  4. #[program]
  5. pub mod spl_token_lending {
  6. use super::*;
  7. pub fn init_lending_market(
  8. ctx: Context<InitLendingMarket>,
  9. owner: Pubkey,
  10. quote_currency: [u8; 32],
  11. ) -> Result<()> {
  12. Ok(())
  13. }
  14. pub fn set_lending_market_owner(
  15. ctx: Context<SetLendingMarketOwner>,
  16. new_owner: Pubkey,
  17. ) -> Result<()> {
  18. Ok(())
  19. }
  20. pub fn init_reserve(
  21. ctx: Context<InitReserve>,
  22. liquidity_amount: u64,
  23. config: ReserveConfig,
  24. ) -> Result<()> {
  25. Ok(())
  26. }
  27. pub fn refresh_reserve(ctx: Context<RefreshReserve>) -> Result<()> {
  28. Ok(())
  29. }
  30. pub fn deposit_reserve_liquidity(
  31. ctx: Context<DepositReserveLiquidity>,
  32. liquidity_amount: u64,
  33. ) -> Result<()> {
  34. Ok(())
  35. }
  36. pub fn redeem_reserve_collateral(
  37. ctx: Context<RedeemReserveCollateral>,
  38. collateral_amount: u64,
  39. ) -> Result<()> {
  40. Ok(())
  41. }
  42. pub fn init_obligation(ctx: Context<InitObligation>) -> Result<()> {
  43. Ok(())
  44. }
  45. pub fn refresh_obligation(ctx: Context<RefreshObligation>) -> Result<()> {
  46. Ok(())
  47. }
  48. pub fn deposit_obligation_collateral(
  49. ctx: Context<DepositObligationCollateral>,
  50. collateral_amount: u64,
  51. ) -> Result<()> {
  52. Ok(())
  53. }
  54. pub fn withdraw_obligation_collateral(
  55. ctx: Context<WithdrawObligationCollateral>,
  56. collateral_amount: u64,
  57. ) -> Result<()> {
  58. Ok(())
  59. }
  60. pub fn borrow_obligation_liquidity(
  61. ctx: Context<BorrowObligationLiquidity>,
  62. liquidity_amount: u64,
  63. ) -> Result<()> {
  64. Ok(())
  65. }
  66. pub fn repay_obligation_liquidity(
  67. ctx: Context<RepayObligationLiquidity>,
  68. liquidity_amount: u64,
  69. ) -> Result<()> {
  70. Ok(())
  71. }
  72. pub fn liquidate_obligation(
  73. ctx: Context<LiquidateObligation>,
  74. liquidity_amount: u64,
  75. ) -> Result<()> {
  76. Ok(())
  77. }
  78. pub fn flash_loan(ctx: Context<FlashLoan>, amount: u64) -> Result<()> {
  79. Ok(())
  80. }
  81. }
  82. #[derive(Accounts)]
  83. pub struct InitLendingMarket<'info> {
  84. #[account(mut)]
  85. lending_market: AccountInfo<'info>,
  86. rent: Sysvar<'info, Rent>,
  87. token_program: Program<'info, Token>,
  88. oracle_program: AccountInfo<'info>,
  89. }
  90. #[derive(Accounts)]
  91. pub struct SetLendingMarketOwner<'info> {
  92. #[account(mut)]
  93. lending_market: AccountInfo<'info>,
  94. lending_market_owner: Signer<'info>,
  95. }
  96. #[derive(Accounts)]
  97. pub struct InitReserve<'info> {
  98. #[account(mut)]
  99. source_liquidity: AccountInfo<'info>,
  100. #[account(mut)]
  101. destination_collateral: AccountInfo<'info>,
  102. #[account(mut)]
  103. reserve: AccountInfo<'info>,
  104. reserve_liquidity_mint: AccountInfo<'info>,
  105. #[account(mut)]
  106. reserve_liquidity_supply: AccountInfo<'info>,
  107. #[account(mut)]
  108. reserve_liquidity_fee_receiver: AccountInfo<'info>,
  109. #[account(mut)]
  110. reserve_collateral_mint: AccountInfo<'info>,
  111. #[account(mut)]
  112. reserve_collateral_supply: AccountInfo<'info>,
  113. pyth_product: AccountInfo<'info>,
  114. pyth_price: AccountInfo<'info>,
  115. lending_market: AccountInfo<'info>,
  116. lending_market_authority: AccountInfo<'info>,
  117. lending_market_owner: Signer<'info>,
  118. user_transfer_authority: Signer<'info>,
  119. clock: Sysvar<'info, Clock>,
  120. rent: Sysvar<'info, Rent>,
  121. token_program: Program<'info, Token>,
  122. }
  123. #[derive(Accounts)]
  124. pub struct RefreshReserve<'info> {
  125. #[account(mut)]
  126. reserve: AccountInfo<'info>,
  127. reserve_liquidity_oracle: AccountInfo<'info>,
  128. clock: Sysvar<'info, Clock>,
  129. }
  130. #[derive(Accounts)]
  131. pub struct DepositReserveLiquidity<'info> {
  132. #[account(mut)]
  133. source_liquidity: AccountInfo<'info>,
  134. #[account(mut)]
  135. destination_collateral: AccountInfo<'info>,
  136. #[account(mut)]
  137. reserve: AccountInfo<'info>,
  138. #[account(mut)]
  139. reserve_liquidity_supply: AccountInfo<'info>,
  140. #[account(mut)]
  141. reserve_collateral_mint: AccountInfo<'info>,
  142. lending_market: AccountInfo<'info>,
  143. lending_market_authority: AccountInfo<'info>,
  144. user_transfer_authority: Signer<'info>,
  145. clock: Sysvar<'info, Clock>,
  146. token_program: Program<'info, Token>,
  147. }
  148. #[derive(Accounts)]
  149. pub struct RedeemReserveCollateral<'info> {
  150. #[account(mut)]
  151. source_collateral: AccountInfo<'info>,
  152. #[account(mut)]
  153. destination_liquidity: AccountInfo<'info>,
  154. #[account(mut)]
  155. reserve: AccountInfo<'info>,
  156. #[account(mut)]
  157. reserve_collateral_mint: AccountInfo<'info>,
  158. #[account(mut)]
  159. reserve_liquidity_supply: AccountInfo<'info>,
  160. lending_market: AccountInfo<'info>,
  161. lending_market_authority: AccountInfo<'info>,
  162. user_transfer_authority: Signer<'info>,
  163. clock: Sysvar<'info, Clock>,
  164. token_program: Program<'info, Token>,
  165. }
  166. #[derive(Accounts)]
  167. pub struct InitObligation<'info> {
  168. #[account(mut)]
  169. obligation: AccountInfo<'info>,
  170. lending_market: AccountInfo<'info>,
  171. obligation_owner: Signer<'info>,
  172. clock: Sysvar<'info, Clock>,
  173. rent: Sysvar<'info, Rent>,
  174. token_program: Program<'info, Token>,
  175. }
  176. #[derive(Accounts)]
  177. pub struct RefreshObligation<'info> {
  178. #[account(mut)]
  179. obligation: AccountInfo<'info>,
  180. clock: Sysvar<'info, Clock>,
  181. // optional_pubkey: AccountInfo<'info>,
  182. }
  183. #[derive(Accounts)]
  184. pub struct DepositObligationCollateral<'info> {
  185. #[account(mut)]
  186. source_collateral: AccountInfo<'info>,
  187. #[account(mut)]
  188. destination_collateral: AccountInfo<'info>,
  189. deposit_reserve: AccountInfo<'info>,
  190. #[account(mut)]
  191. obligation: AccountInfo<'info>,
  192. lending_market: AccountInfo<'info>,
  193. obligation_owner: Signer<'info>,
  194. user_transfer_authority: Signer<'info>,
  195. clock: Sysvar<'info, Clock>,
  196. token_program: Program<'info, Token>,
  197. }
  198. #[derive(Accounts)]
  199. pub struct WithdrawObligationCollateral<'info> {
  200. #[account(mut)]
  201. source_collateral: AccountInfo<'info>,
  202. #[account(mut)]
  203. destination_collateral: AccountInfo<'info>,
  204. withdraw_reserve: AccountInfo<'info>,
  205. #[account(mut)]
  206. obligation: AccountInfo<'info>,
  207. lending_market: AccountInfo<'info>,
  208. lending_market_authority: AccountInfo<'info>,
  209. obligation_owner: Signer<'info>,
  210. clock: Sysvar<'info, Clock>,
  211. token_program: Program<'info, Token>,
  212. }
  213. #[derive(Accounts)]
  214. pub struct BorrowObligationLiquidity<'info> {
  215. #[account(mut)]
  216. source_liquidity: AccountInfo<'info>,
  217. #[account(mut)]
  218. destination_liquidity: AccountInfo<'info>,
  219. #[account(mut)]
  220. borrow_reserve: AccountInfo<'info>,
  221. #[account(mut)]
  222. borrow_reserve_liquidity_fee_receiver: AccountInfo<'info>,
  223. #[account(mut)]
  224. obligation: AccountInfo<'info>,
  225. lending_market: AccountInfo<'info>,
  226. lending_market_authority: AccountInfo<'info>,
  227. obligation_owner: Signer<'info>,
  228. clock: Sysvar<'info, Clock>,
  229. token_program: Program<'info, Token>,
  230. // #[account(mut)]
  231. // optional_host_fee_receiver: AccountInfo<'info>,
  232. }
  233. #[derive(Accounts)]
  234. pub struct RepayObligationLiquidity<'info> {
  235. #[account(mut)]
  236. source_liquidity: AccountInfo<'info>,
  237. #[account(mut)]
  238. destination_liquidity: AccountInfo<'info>,
  239. #[account(mut)]
  240. repay_reserve: AccountInfo<'info>,
  241. #[account(mut)]
  242. obligation: AccountInfo<'info>,
  243. lending_market: AccountInfo<'info>,
  244. user_transfer_authority: Signer<'info>,
  245. clock: Sysvar<'info, Clock>,
  246. token_program: Program<'info, Token>,
  247. }
  248. #[derive(Accounts)]
  249. pub struct LiquidateObligation<'info> {
  250. #[account(mut)]
  251. source_liquidity: AccountInfo<'info>,
  252. #[account(mut)]
  253. destination_collateral: AccountInfo<'info>,
  254. #[account(mut)]
  255. repay_reserve: AccountInfo<'info>,
  256. #[account(mut)]
  257. repay_reserve_liquidity_supply: AccountInfo<'info>,
  258. withdraw_reserve: AccountInfo<'info>,
  259. #[account(mut)]
  260. withdraw_reserve_collateral_supply: AccountInfo<'info>,
  261. #[account(mut)]
  262. obligation: AccountInfo<'info>,
  263. lending_market: AccountInfo<'info>,
  264. lending_market_authority: AccountInfo<'info>,
  265. user_transfer_authority: Signer<'info>,
  266. clock: Sysvar<'info, Clock>,
  267. token_program: Program<'info, Token>,
  268. }
  269. #[derive(Accounts)]
  270. pub struct FlashLoan<'info> {
  271. #[account(mut)]
  272. source_liquidity: AccountInfo<'info>,
  273. #[account(mut)]
  274. destination_liquidity: AccountInfo<'info>,
  275. #[account(mut)]
  276. reserve: AccountInfo<'info>,
  277. #[account(mut)]
  278. reserve_liquidity_fee_receiver: AccountInfo<'info>,
  279. #[account(mut)]
  280. host_fee_receiver: AccountInfo<'info>,
  281. lending_market: AccountInfo<'info>,
  282. lending_market_authority: AccountInfo<'info>,
  283. token_program: Program<'info, Token>,
  284. flash_loan_receiver_program: AccountInfo<'info>,
  285. }
  286. #[account]
  287. pub struct Obligation {
  288. /// Version of the struct
  289. pub version: u8,
  290. /// Last update to collateral, liquidity, or their market values
  291. pub last_update: LastUpdate,
  292. /// Lending market address
  293. pub lending_market: Pubkey,
  294. /// Owner authority which can borrow liquidity
  295. pub owner: Pubkey,
  296. /// Deposited collateral for the obligation, unique by deposit reserve address
  297. pub deposits: Vec<ObligationCollateral>,
  298. /// Borrowed liquidity for the obligation, unique by borrow reserve address
  299. pub borrows: Vec<ObligationLiquidity>,
  300. /// Market value of deposits
  301. pub deposited_value: Decimal,
  302. /// Market value of borrows
  303. pub borrowed_value: Decimal,
  304. /// The maximum borrow value at the weighted average loan to value ratio
  305. pub allowed_borrow_value: Decimal,
  306. /// The dangerous borrow value at the weighted average liquidation threshold
  307. pub unhealthy_borrow_value: Decimal,
  308. }
  309. #[account]
  310. pub struct LendingMarket {
  311. /// Version of lending market
  312. pub version: u8,
  313. /// Bump seed for derived authority address
  314. pub bump_seed: u8,
  315. /// Owner authority which can add new reserves
  316. pub owner: Pubkey,
  317. /// Currency market prices are quoted in
  318. /// e.g. "USD" null padded (`*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"`) or a SPL token mint pubkey
  319. pub quote_currency: [u8; 32],
  320. /// Token program id
  321. pub token_program_id: Pubkey,
  322. /// Oracle (Pyth) program id
  323. pub oracle_program_id: Pubkey,
  324. }
  325. #[account]
  326. pub struct Reserve {
  327. /// Version of the struct
  328. pub version: u8,
  329. /// Last slot when supply and rates updated
  330. pub last_update: LastUpdate,
  331. /// Lending market address
  332. pub lending_market: Pubkey,
  333. /// Reserve liquidity
  334. pub liquidity: ReserveLiquidity,
  335. /// Reserve collateral
  336. pub collateral: ReserveCollateral,
  337. /// Reserve configuration values
  338. pub config: ReserveConfig,
  339. }
  340. #[derive(AnchorSerialize, AnchorDeserialize)]
  341. pub struct LastUpdate {
  342. /// Last slot when updated
  343. pub slot: u64,
  344. /// True when marked stale, false when slot updated
  345. pub stale: bool,
  346. }
  347. #[derive(AnchorSerialize, AnchorDeserialize)]
  348. pub struct Decimal(pub U192);
  349. #[derive(AnchorSerialize, AnchorDeserialize)]
  350. pub struct ObligationCollateral {
  351. /// Reserve collateral is deposited to
  352. pub deposit_reserve: Pubkey,
  353. /// Amount of collateral deposited
  354. pub deposited_amount: u64,
  355. /// Collateral market value in quote currency
  356. pub market_value: Decimal,
  357. }
  358. #[derive(AnchorSerialize, AnchorDeserialize)]
  359. pub struct ObligationLiquidity {
  360. /// Reserve liquidity is borrowed from
  361. pub borrow_reserve: Pubkey,
  362. /// Borrow rate used for calculating interest
  363. pub cumulative_borrow_rate_wads: Decimal,
  364. /// Amount of liquidity borrowed plus interest
  365. pub borrowed_amount_wads: Decimal,
  366. /// Liquidity market value in quote currency
  367. pub market_value: Decimal,
  368. }
  369. #[derive(AnchorSerialize, AnchorDeserialize)]
  370. pub struct ReserveLiquidity {
  371. /// Reserve liquidity mint address
  372. pub mint_pubkey: Pubkey,
  373. /// Reserve liquidity mint decimals
  374. pub mint_decimals: u8,
  375. /// Reserve liquidity supply address
  376. pub supply_pubkey: Pubkey,
  377. /// Reserve liquidity fee receiver address
  378. pub fee_receiver: Pubkey,
  379. /// Reserve liquidity oracle account
  380. pub oracle_pubkey: Pubkey,
  381. /// Reserve liquidity available
  382. pub available_amount: u64,
  383. /// Reserve liquidity borrowed
  384. pub borrowed_amount_wads: Decimal,
  385. /// Reserve liquidity cumulative borrow rate
  386. pub cumulative_borrow_rate_wads: Decimal,
  387. /// Reserve liquidity market price in quote currency
  388. pub market_price: Decimal,
  389. }
  390. #[derive(AnchorSerialize, AnchorDeserialize)]
  391. pub struct ReserveCollateral {
  392. /// Reserve collateral mint address
  393. pub mint_pubkey: Pubkey,
  394. /// Reserve collateral mint supply, used for exchange rate
  395. pub mint_total_supply: u64,
  396. /// Reserve collateral supply address
  397. pub supply_pubkey: Pubkey,
  398. }
  399. #[derive(AnchorSerialize, AnchorDeserialize)]
  400. pub struct ReserveFees {
  401. /// Fee assessed on `BorrowObligationLiquidity`, expressed as a Wad.
  402. /// Must be between 0 and 10^18, such that 10^18 = 1. A few examples for
  403. /// clarity:
  404. /// 1% = 10_000_000_000_000_000
  405. /// 0.01% (1 basis point) = 100_000_000_000_000
  406. /// 0.00001% (Aave borrow fee) = 100_000_000_000
  407. pub borrow_fee_wad: u64,
  408. /// Fee for flash loan, expressed as a Wad.
  409. /// 0.3% (Aave flash loan fee) = 3_000_000_000_000_000
  410. pub flash_loan_fee_wad: u64,
  411. /// Amount of fee going to host account, if provided in liquidate and repay
  412. pub host_fee_percentage: u8,
  413. }
  414. #[derive(AnchorSerialize, AnchorDeserialize)]
  415. pub struct ReserveConfig {
  416. /// Optimal utilization rate, as a percentage
  417. pub optimal_utilization_rate: u8,
  418. /// Target ratio of the value of borrows to deposits, as a percentage
  419. /// 0 if use as collateral is disabled
  420. pub loan_to_value_ratio: u8,
  421. /// Bonus a liquidator gets when repaying part of an unhealthy obligation, as a percentage
  422. pub liquidation_bonus: u8,
  423. /// Loan to value ratio at which an obligation can be liquidated, as a percentage
  424. pub liquidation_threshold: u8,
  425. /// Min borrow APY
  426. pub min_borrow_rate: u8,
  427. /// Optimal (utilization) borrow APY
  428. pub optimal_borrow_rate: u8,
  429. /// Max borrow APY
  430. pub max_borrow_rate: u8,
  431. /// Program owner fees assessed, separate from gains due to interest accrual
  432. pub fees: ReserveFees,
  433. }
  434. #[error_code]
  435. pub enum LendingError {
  436. // 0
  437. /// Invalid instruction data passed in.
  438. #[msg("Failed to unpack instruction data")]
  439. InstructionUnpackError,
  440. /// The account cannot be initialized because it is already in use.
  441. #[msg("Account is already initialized")]
  442. AlreadyInitialized,
  443. /// Lamport balance below rent-exempt threshold.
  444. #[msg("Lamport balance below rent-exempt threshold")]
  445. NotRentExempt,
  446. /// The program address provided doesn't match the value generated by the program.
  447. #[msg("Market authority is invalid")]
  448. InvalidMarketAuthority,
  449. /// Expected a different market owner
  450. #[msg("Market owner is invalid")]
  451. InvalidMarketOwner,
  452. // 5
  453. /// The owner of the input isn't set to the program address generated by the program.
  454. #[msg("Input account owner is not the program address")]
  455. InvalidAccountOwner,
  456. /// The owner of the account input isn't set to the correct token program id.
  457. #[msg("Input token account is not owned by the correct token program id")]
  458. InvalidTokenOwner,
  459. /// Expected an SPL Token account
  460. #[msg("Input token account is not valid")]
  461. InvalidTokenAccount,
  462. /// Expected an SPL Token mint
  463. #[msg("Input token mint account is not valid")]
  464. InvalidTokenMint,
  465. /// Expected a different SPL Token program
  466. #[msg("Input token program account is not valid")]
  467. InvalidTokenProgram,
  468. // 10
  469. /// Invalid amount, must be greater than zero
  470. #[msg("Input amount is invalid")]
  471. InvalidAmount,
  472. /// Invalid config value
  473. #[msg("Input config value is invalid")]
  474. InvalidConfig,
  475. /// Invalid config value
  476. #[msg("Input account must be a signer")]
  477. InvalidSigner,
  478. /// Invalid account input
  479. #[msg("Invalid account input")]
  480. InvalidAccountInput,
  481. /// Math operation overflow
  482. #[msg("Math operation overflow")]
  483. MathOverflow,
  484. // 15
  485. /// Token initialize mint failed
  486. #[msg("Token initialize mint failed")]
  487. TokenInitializeMintFailed,
  488. /// Token initialize account failed
  489. #[msg("Token initialize account failed")]
  490. TokenInitializeAccountFailed,
  491. /// Token transfer failed
  492. #[msg("Token transfer failed")]
  493. TokenTransferFailed,
  494. /// Token mint to failed
  495. #[msg("Token mint to failed")]
  496. TokenMintToFailed,
  497. /// Token burn failed
  498. #[msg("Token burn failed")]
  499. TokenBurnFailed,
  500. // 20
  501. /// Insufficient liquidity available
  502. #[msg("Insufficient liquidity available")]
  503. InsufficientLiquidity,
  504. /// This reserve's collateral cannot be used for borrows
  505. #[msg("Input reserve has collateral disabled")]
  506. ReserveCollateralDisabled,
  507. /// Reserve state stale
  508. #[msg("Reserve state needs to be refreshed")]
  509. ReserveStale,
  510. /// Withdraw amount too small
  511. #[msg("Withdraw amount too small")]
  512. WithdrawTooSmall,
  513. /// Withdraw amount too large
  514. #[msg("Withdraw amount too large")]
  515. WithdrawTooLarge,
  516. // 25
  517. /// Borrow amount too small
  518. #[msg("Borrow amount too small to receive liquidity after fees")]
  519. BorrowTooSmall,
  520. /// Borrow amount too large
  521. #[msg("Borrow amount too large for deposited collateral")]
  522. BorrowTooLarge,
  523. /// Repay amount too small
  524. #[msg("Repay amount too small to transfer liquidity")]
  525. RepayTooSmall,
  526. /// Liquidation amount too small
  527. #[msg("Liquidation amount too small to receive collateral")]
  528. LiquidationTooSmall,
  529. /// Cannot liquidate healthy obligations
  530. #[msg("Cannot liquidate healthy obligations")]
  531. ObligationHealthy,
  532. // 30
  533. /// Obligation state stale
  534. #[msg("Obligation state needs to be refreshed")]
  535. ObligationStale,
  536. /// Obligation reserve limit exceeded
  537. #[msg("Obligation reserve limit exceeded")]
  538. ObligationReserveLimit,
  539. /// Expected a different obligation owner
  540. #[msg("Obligation owner is invalid")]
  541. InvalidObligationOwner,
  542. /// Obligation deposits are empty
  543. #[msg("Obligation deposits are empty")]
  544. ObligationDepositsEmpty,
  545. /// Obligation borrows are empty
  546. #[msg("Obligation borrows are empty")]
  547. ObligationBorrowsEmpty,
  548. // 35
  549. /// Obligation deposits have zero value
  550. #[msg("Obligation deposits have zero value")]
  551. ObligationDepositsZero,
  552. /// Obligation borrows have zero value
  553. #[msg("Obligation borrows have zero value")]
  554. ObligationBorrowsZero,
  555. /// Invalid obligation collateral
  556. #[msg("Invalid obligation collateral")]
  557. InvalidObligationCollateral,
  558. /// Invalid obligation liquidity
  559. #[msg("Invalid obligation liquidity")]
  560. InvalidObligationLiquidity,
  561. /// Obligation collateral is empty
  562. #[msg("Obligation collateral is empty")]
  563. ObligationCollateralEmpty,
  564. // 40
  565. /// Obligation liquidity is empty
  566. #[msg("Obligation liquidity is empty")]
  567. ObligationLiquidityEmpty,
  568. /// Negative interest rate
  569. #[msg("Interest rate is negative")]
  570. NegativeInterestRate,
  571. /// Oracle config is invalid
  572. #[msg("Input oracle config is invalid")]
  573. InvalidOracleConfig,
  574. /// Expected a different flash loan receiver program
  575. #[msg("Input flash loan receiver program account is not valid")]
  576. InvalidFlashLoanReceiverProgram,
  577. /// Not enough liquidity after flash loan
  578. #[msg("Not enough liquidity after flash loan")]
  579. NotEnoughLiquidityAfterFlashLoan,
  580. // 45
  581. }