Skip to content

Feat/upgrades#5

Open
abhay wants to merge 4 commits intomainfrom
feat/upgrades
Open

Feat/upgrades#5
abhay wants to merge 4 commits intomainfrom
feat/upgrades

Conversation

@abhay
Copy link
Copy Markdown
Contributor

@abhay abhay commented Jan 15, 2026

No description provided.

abhay added 3 commits January 15, 2026 10:59
- Switch from blocking RpcClient to solana_client::nonblocking for
  async RPC calls that won't block the tokio runtime under load
- Replace .unwrap() on Mint::unpack_from_slice with proper error
  propagation to prevent panics on malformed data
- Return HTTP 503 on RPC/parse failures instead of misleading "0"
  response (errors are logged internally, not exposed to clients)
- Share RpcClient via Axum state instead of creating new client
  per request for better resource efficiency
- Use async Solana RPC client with proper error handling (503 on failure)
- Share RPC client via state instead of creating per request
- Add router() functions to supply and legacy modules
- Simplify main.rs with clean route composition
- New endpoint: GET /api/stats/staked/{token}
- Queries PositionV0 accounts via getProgramAccounts with registrar filter
- Sums amount_deposited_native and divides by token decimals
- Background task populates cache on startup and refreshes every 15 min
- Requests block on cache miss with double-check locking to prevent parallel fetches
@abhay abhay temporarily deployed to staging-network-explorer January 15, 2026 22:15 Inactive
- Replace runtime PDA derivation with registrar constants
- Use data_slice in gPA to fetch only the 8-byte amount field
spl-token = { version = "7.0", features = ["no-entrypoint"] }
tokio = { version = "1", features = ["full"] }
pretty_env_logger = "0.5"
log = "0.4"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

don't use log if we already have tracing in use.. otherwise, switch to tracing

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