API endpoints for PageDAO Hub providing token metrics and analytics.
GET /token-prices
Returns current PAGE token prices across all networks, TVL data, and market metrics.
{
"timestamp": 1742422339998,
"prices": {
"ethereum": 0.0009987517597018379,
"optimism": 0.000868414092192231,
"base": 0.0012145095571942511,
"osmosis": 0.0012284914202457435,
"weighted": 0.0010876543210987654
},
"ethPrice": 2039.0481063402617,
"tvl": {
"ethereum": 2232.807674748349,
"optimism": 262.83570320986814,
"base": 479.48196085196537,
"osmosis": 2937.0646185289042,
"total": 5912.189957839087
},
"weights": {
"ethereum": 0.3776616940354998,
"optimism": 0.04445657279390989,
"base": 0.08110056752435046,
"osmosis": 0.49678116564623975
},
"supply": {
"circulating": 42500000,
"total": 100000000
},
"marketCap": 46225309.14669935,
"fdv": 108765432.10987654
}
GET /historical-data?chain=all&period=24h
Returns historical price data for the specified chain and time period.
chain
: Chain to get data for (ethereum, optimism, base, osmosis, or all). Default: allperiod
: Time period (24h, 7d, 30d). Default: 24h
{
"period": "24h",
"dataPoints": [
{
"timestamp": 1742422339998,
"ethereum": 0.0009987517597018379,
"optimism": 0.000868414092192231,
"base": 0.0012145095571942511,
"osmosis": 0.0012284914202457435,
"ethPrice": 2039.0481063402617
},
{
"timestamp": 1742422939998,
"ethereum": 0.0009995517597018379,
"optimism": 0.000870414092192231,
"base": 0.0012155095571942511,
"osmosis": 0.0012294914202457435,
"ethPrice": 2042.0481063402617
}
// Additional data points...
]
}
{
"chain": "ethereum",
"period": "24h",
"dataPoints": [
{
"timestamp": 1742422339998,
"price": 0.0009987517597018379
},
{
"timestamp": 1742422939998,
"price": 0.0009995517597018379
}
// Additional data points...
]
}
- Node.js v18 or higher
- Netlify CLI
# Install dependencies
npm install
# Install Netlify CLI globally
npm install -g netlify-cli
# Start local development server
npm run dev
This will start the Netlify dev server at http://localhost:8888.
# Deploy to Netlify
npm run deploy
The API uses the following environment variables:
ETH_RPC_URL
: Ethereum RPC URLETH_BACKUP_RPC_URL
: Backup Ethereum RPC URLOPTIMISM_RPC_URL
: Optimism RPC URLOPTIMISM_BACKUP_RPC_URL
: Backup Optimism RPC URLBASE_RPC_URL
: Base RPC URLBASE_BACKUP_RPC_URL
: Backup Base RPC URLCACHE_DURATION
: Cache duration in milliseconds (default: 300000)
GET /network-comparison
Returns network comparison data including arbitrage opportunities and price differences from the weighted average.
{
"timestamp": 1742422339998,
"weightedPrice": 0.0010876543210987654,
"priceComparison": {
"ethereum": {
"price": 0.0009987517597018379,
"diffFromWeighted": -8.17,
"tvl": 2232.807674748349,
"weight": 0.3776616940354998
},
"optimism": {
"price": 0.000868414092192231,
"diffFromWeighted": -20.15,
"tvl": 262.83570320986814,
"weight": 0.04445657279390989
},
"base": {
"price": 0.0012145095571942511,
"diffFromWeighted": 11.66,
"tvl": 479.48196085196537,
"weight": 0.08110056752435046
},
"osmosis": {
"price": 0.0012284914202457435,
"diffFromWeighted": 12.95,
"tvl": 2937.0646185289042,
"weight": 0.49678116564623975
}
},
"arbitrageOpportunities": [
{
"from": "optimism",
"to": "osmosis",
"fromPrice": 0.000868414092192231,
"toPrice": 0.0012284914202457435,
"priceDifference": 41.46,
"potentialGain": 0.00036007732805351243
},
{
"from": "ethereum",
"to": "osmosis",
"fromPrice": 0.0009987517597018379,
"toPrice": 0.0012284914202457435,
"priceDifference": 23.00,
"potentialGain": 0.00022971290343142273
}
// Additional opportunities...
]
}
## License
MIT