Skip to content

Logs/Events: Consider adding some basic logging for indexing & analytics #221

Open
@kiranmuddam

Description

@kiranmuddam

It would be helpful to add some structured logs in key places so we can track protocol activity over time. Not urgent, but would make indexing and analytics easier down the road.

Potential places for logs:

  • Deposits
  • Withdrawals
  • Rewards distribution
  • Exchange rate updates (in update_vault_balance)
  • State changes (Vault, Operator, NCN) etc

Simple example:

// Simple native log with msg macro (can use encoding for optimization)
msg!("DEPOSIT: {} lamports from {}", amount, user_pubkey);

##References
https://www.anchor-lang.com/docs/features/events
https://solana.stackexchange.com/questions/19585/how-to-emit-events-from-native-rust-solana-program

Not a high priority, but something to consider for future improvements. Happy to help with this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions