add oracle to to token registration

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-02-28 14:44:08 +01:00
parent ccab3b867f
commit 362b180069
2 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,8 @@ pub struct RegisterToken<'info> {
)]
pub vault: Account<'info, TokenAccount>,
pub oracle: UncheckedAccount<'info>,
#[account(mut)]
pub payer: Signer<'info>,
@ -81,6 +83,7 @@ pub fn register_token(
group: ctx.accounts.group.key(),
mint: ctx.accounts.mint.key(),
vault: ctx.accounts.vault.key(),
oracle: ctx.accounts.oracle.key(),
deposit_index: INDEX_START,
borrow_index: INDEX_START,
indexed_total_deposits: I80F48::ZERO,

View File

@ -8,6 +8,7 @@ pub struct TokenBank {
pub group: Pubkey,
pub mint: Pubkey,
pub vault: Pubkey,
pub oracle: Pubkey,
/// the index used to scale the value of an IndexedPosition
/// TODO: should always be >= 0, add checks?