Assets & Treasury APIs
All endpoints are READ-ONLY and safe for public consumption. No authentication required.
Base URL:
https://okfamilyfund.comPortfolio & Treasury Data (View Only)
Get Portfolio Dashboard Summary
GET /api/portfolio/dashboard/{walletAddress}
Description: Current treasury value, contributions, and performance metrics.
Path Parameters:
walletAddress– Wallet address to query
Response:
{
"currentValue": 45250.75,
"totalContributions": 42000.00,
"performanceYTD": 7.74,
"totalAssets": 8,
"lastUpdated": "2025-09-28T08:00:00.000Z"
}Get Portfolio History
GET /api/portfolio/history/{walletAddress}?period={period}&limit={limit}
Description: Historical portfolio values with time filtering.
Parameters:
walletAddress(path)period(query):all | 7d | 1m | 1y(default:all)limit(query): Max records (default:1000)
Response:
[
{
"id": 123,
"totalValue": "45250.75",
"createdAt": "2025-09-28T08:00:00.000Z"
}
]Get Portfolio Composition
GET /api/portfolio/composition/{walletAddress}
Description: Current asset allocation breakdown with percentages.
Response:
{
"composition": [
{
"mint": "So11111111111111111111111111111111111111112",
"symbol": "SOL",
"name": "Solana",
"value": 12500.50,
"percentage": 27.62,
"price": 145.75,
"balance": 85.8,
"change24h": 2.34
}
],
"totalValue": 45250.75,
"lastUpdated": "2025-09-28T08:00:00.000Z"
}Treasury Contributions (View Only)
Get Latest Treasury Contributions (Discord Bot Optimized)
GET /api/treasury/latest-contributions?limit={limit}
Description: Latest treasury contributions with parsed token information.
Parameters:
limit(query): Number of contributions (default:10)
Response:
{
"success": true,
"contributions": [
{
"id": 45,
"amountUSD": 1250.75,
"type": "deposit",
"description": "Automatic contribution: SOL (+15.2), BTC (new)",
"tokens": [
{"symbol": "SOL", "amount": "15.2", "type": "increase"},
{"symbol": "BTC", "amount": "new", "type": "new_token"}
],
"timestamp": "2025-09-28T08:00:00.000Z"
}
],
"total": 1,
"walletAddress": "BH5fXuQnHEPUm6jMen8X48PTBigF4s1xDr46nXMTSfzr"
}Get Contribution History
GET /api/contributions?walletAddress={address}&period={period}
Description: All contributions for a wallet with time filtering.
Parameters:
walletAddress(query): Target wallet addressperiod(query):all | 7d | 1m | 1y(default:all)
Response:
[
{
"id": 45,
"walletAddress": "BH5fXuQnHEPUm6jMen8X48PTBigF4s1xDr46nXMTSfzr",
"amount": "1250.75",
"type": "deposit",
"description": "Automatic contribution: SOL (+15.2)",
"createdAt": "2025-09-28T08:00:00.000Z"
}
]Token Information (View Only)
Get All Tracked Tokens
GET /api/tokens
Description: List all tokens in the database with metadata.
Response:
[
{
"id": 1,
"mint": "So11111111111111111111111111111111111111112",
"name": "Solana",
"symbol": "SOL",
"icon": "https://example.com/sol.png",
"decimals": 9,
"isVerified": true,
"createdAt": "2025-09-28T08:00:00.000Z"
}
]Usage Examples
Discord Bot Integration
// Get latest 5 contributions for Discord notifications
const response = await fetch('https://okfamilyfund.com/api/treasury/latest-contributions?limit=5');
const data = await response.json();
data.contributions.forEach(contrib => {
console.log(`New treasury contribution: $${contrib.amountUSD.toLocaleString()}`);
});Portfolio Tracking Dashboard
// Get current treasury status
const dashboard = await fetch('https://okfamilyfund.com/api/portfolio/dashboard/BH5fXuQnHEPUm6jMen8X48PTBigF4s1xDr46nXMTSfzr');
const stats = await dashboard.json();
console.log(`Treasury Value: $${stats.currentValue.toLocaleString()}`);
console.log(`Performance: ${stats.performanceYTD.toFixed(2)}%`);Treasury Wallet Address
Main treasury wallet:
BH5fXuQnHEPUm6jMen8X48PTBigF4s1xDr46nXMTSfzrSecurity & Usage Notes
Security: All APIs are read-only
Use Cases: Portfolio tracking, Discord bots, external dashboards, analytics
Rate Limits: None currently, but please use responsibly
Last updated