Indexes Partisia liquid staking contract state, transactions, and MPC prices.
cp .env.example .env
# Edit .env: DB credentials, PARTISIA_API_URL, LS_CONTRACT, DEPLOYMENT_BLOCK
npm install
bun run src/index.tsGraphQL (primary): http://localhost:3002/graphql
# Contract state history
contractStates(first: Int, skip: Int, orderBy: OrderBy, where: StateFilter): [ContractState!]!
# Current contract state
currentState: CurrentState!
# Exchange rate and prices
exchangeRate: ExchangeRate!
# MPC price history
priceHistory(hours: Int): [Price!]!
# Daily aggregated data
dailyHistory(days: Int, granularity: String): [DailyData!]!
dailyRewards(days: Int, granularity: String): [DailyRewardActual!]!
# Users and balances
users(first: Int, skip: Int, orderBy: UserOrderBy): [User!]!
# Transactions
transactions(first: Int, skip: Int, orderBy: TransactionOrderBy, where: TransactionFilter): [Transaction!]!
rewards(first: Int, skip: Int, orderBy: TransactionOrderBy): [Transaction!]!Playground: http://localhost:3002/graphql
REST (optional): http://localhost:3002/api/v1
GET /api/v1/health- Health checkGET /api/v1/indexer/status- Indexer sync statusGET /api/v1/contract/current- Current stateGET /api/v1/contract/history- State historyGET /api/v1/transactions- List transactionsGET /api/v1/transactions/:txHash- Transaction detailsGET /api/v1/rewards/accrue- Accrue reward transactionsGET /api/v1/users- List usersGET /api/v1/users/:address- User detailsGET /api/v1/analytics/apy- APY calculationsGET /api/v1/analytics/daily- Daily statsGET /api/v1/analytics/stats- Protocol statsGET /api/v1/analytics/exchange-rates- Exchange rate historyGET /api/v1/prices/current- Current MPC priceGET /api/v1/prices/history- MPC price history
Frontend: http://localhost:3002/
- Runtime: Bun
- Database: PostgreSQL 14+
- Blockchain: Partisia Blockchain
- Price data: CoinGecko API
Key .env variables:
# Blockchain
PARTISIA_API_URL=http://95.216.235.72:18080
LS_CONTRACT=02fc82abf81cbb36acfe196faa1ad49ddfa7abdda6
DEPLOYMENT_BLOCK=10682802
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=ls_indexer
DB_USER=indexer
DB_PASSWORD=changeme
# Performance
BATCH_SIZE=1000
CONCURRENCY=100
TX_CONCURRENCY=5
# API
API_PORT=3002
COINGECKO_API_KEY=your_key_here