Skip to content

Adrena alp token price#1

Open
the-orex wants to merge 5 commits intomasterfrom
adrena-ALP-token-price
Open

Adrena alp token price#1
the-orex wants to merge 5 commits intomasterfrom
adrena-ALP-token-price

Conversation

@the-orex
Copy link
Copy Markdown

@the-orex the-orex commented Jun 6, 2025

No description provided.

@the-orex
Copy link
Copy Markdown
Author

Thanks for the review @liviuc685, applied all your feedbacks. Sorry I couldn't make cargo to actually run so my vscode isn't really picking things up.

Comment on lines +9 to +23
pub fn validate_adrena_pool(account: &Option<AccountInfo>) -> Result<()> {
let Some(account) = account else {
warn!("No adrena pool account provided");
return err!(ScopeError::ExpectedPriceAccount);
};

let adrena_pool = zero_copy_deserialize::<adrena::state::Pool>(account)?;

if adrena_pool.initialized != 1 {
warn!("Adrena pool account isn't initialized");
return err!(ScopeError::PriceNotValid);
}

Ok(())
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a check of the ownership of the account here please.

To make review of mapping update easier, you could log some info on the pool like the name.

return err!(ScopeError::ExpectedPriceAccount);
};

let adrena_pool = zero_copy_deserialize::<adrena::state::Pool>(account)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a list of the adrena pool account IDs and the token they correspond to?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, there is only ALP 4bQRutgDJs6vuh6ZcWaPVXiQaBzbHketjbCDjL4oRN34

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello all accounts can be viewed here: https://app.adrena.xyz/monitoring?view=full

We have only one pool: 4bQRutgDJs6vuh6ZcWaPVXiQaBzbHketjbCDjL4oRN34

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

},
last_updated_slot: estimate_slot_update_from_ts(
clock,
adrena_pool.last_aum_and_lp_token_price_usd_update,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to double check, last_aum_and_lp_token_price_usd_update is in seconds, right? estimate_slot_update_from_ts expects the timestamp to be in seconds

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thelast_aum_and_lp_token_price_usd_update is in second yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants