pyra-types 0.4.1

Shared account types for Pyra services — Drift positions, spot markets, vaults, and Redis cache wrappers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use serde::{Deserialize, Serialize};

/// Generic cache wrapper for Redis-stored account data.
///
/// The indexer writes accounts to Redis wrapped in this struct,
/// with the account data and the Solana slot at which it was last updated.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Cache<T> {
    pub account: T,
    #[serde(default)]
    pub last_updated_slot: u64,
}