Analytics Rail
Real-time analytics and insights endpoints.
Overview
The Analytics rail provides:
- Real-time metrics
- Historical analysis
- Custom queries
- Dashboard data
Powered by our analytics engine for high-performance analytics.
Endpoints
Query Metrics
http
POST /v1/analytics/querytypescript
const metrics = await iof.analytics.query({
metric: "contract_volume",
dimensions: ["type", "jurisdiction"],
period: {
start: "2024-01-01",
end: "2024-01-31",
},
granularity: "daily",
});Response:
json
{
"data": [
{
"date": "2024-01-15",
"type": "MURABAHA",
"jurisdiction": "MY",
"value": 150,
"amount": 5000000
}
],
"summary": {
"total": 450,
"totalAmount": 15000000
}
}Get Dashboard
http
GET /v1/analytics/dashboardtypescript
const dashboard = await iof.analytics.getDashboard({
workspaceId: "ws_123",
period: "30d",
});Response:
json
{
"overview": {
"totalContracts": 450,
"activeContracts": 380,
"totalVolume": 15000000,
"monthlyGrowth": 0.12
},
"charts": {
"volumeByDay": [...],
"contractsByType": [...],
"topCounterparties": [...]
}
}Create Report
http
POST /v1/analytics/reportstypescript
const report = await iof.analytics.createReport({
type: "monthly_summary",
period: {
start: "2024-01-01",
end: "2024-01-31",
},
format: "pdf",
});Get Trends
http
GET /v1/analytics/trendstypescript
const trends = await iof.analytics.getTrends({
metric: "transaction_volume",
comparison: "mom", // month-over-month
});Available Metrics
| Metric | Description |
|---|---|
contract_volume | Number of contracts |
contract_value | Total contract value |
transaction_volume | Transaction count |
transaction_value | Transaction value |
kyc_completion_rate | KYC success rate |
average_processing_time | Processing time |
Dimensions
| Dimension | Description |
|---|---|
type | Contract type |
jurisdiction | Geographic region |
counterparty | Counterparty ID |
status | Resource status |
currency | Currency code |
Granularity
| Value | Description |
|---|---|
hourly | Per hour |
daily | Per day |
weekly | Per week |
monthly | Per month |
Next Steps
- Reporting Rail - Regulatory reports
- Search Rail - Data queries