How Dalil fetches, caches, validates, and displays financial market data — including update frequencies, what "delayed" means in practice, and how fallback data works.
Dalil operates a server-side data pipeline running on Cloudflare Workers at the edge. When a user opens the dashboard, the browser requests data from our API endpoint, which in turn fetches from upstream financial data providers, caches the results in Cloudflare KV storage, and returns a consolidated JSON response to the frontend.
This architecture means that multiple users benefit from the same cached API call — reducing costs and API rate limit consumption while ensuring consistent data across all visitors at any given moment.
| Asset Class | Source | Cache TTL | Status Label |
|---|---|---|---|
| Cryptocurrency | Luzia | 5 minutes | Live |
| Forex / MAD | Open Exchange Rates | 30 minutes | Delayed |
| Global Indices | Twelve Data | 30 minutes | Delayed |
| Morocco CSE Stocks | Drahmi | 60 minutes | Delayed |
| Bonds & Rates | FRED | 60 minutes | Delayed |
| Precious Metals | Metals.Dev | 8 hours | Delayed |
| Energy & Agriculture | Twelve Data | 30 minutes | Delayed |
| ETFs | FMP | 24 hours | Indicative |
| US/Europe/GCC/Asia Stocks | Static | Static | Indicative |
| News | RSS Feeds | 30 minutes | Live |
"Delayed" means the price shown is not the current market price — it reflects a price from sometime in the past, within the cache TTL window shown above. For example, a forex rate marked "delayed" could be up to 30 minutes old. For most informational purposes this is acceptable, but it is not suitable for executing trades or making time-sensitive financial decisions.
The delay is a combination of two factors: the upstream provider's own data delay (most forex and equity APIs provide 15-minute delayed data on free and standard tiers), plus our own cache TTL which adds additional time on top of that.
"Indicative" data is static or near-static data that serves as a reference rather than a live price. This applies to US, European, GCC, and Asian equity listings — which display representative prices from the most recent available data but are not updated in real time. ETF data falls into a similar category, updated once per day at most. These sections are useful for general reference and portfolio context, but should not be used for trading decisions.
"Live" data is updated as frequently as our cache TTL allows and reflects the most current available price from the upstream provider. Cryptocurrency data (5-minute TTL) is the closest to real-time on the platform. News RSS feeds are also live, aggregated from Moroccan and international sources every 30 minutes.
When an upstream API call fails — due to rate limits, network errors, or provider outages — Dalil displays fallback data. Fallback data consists of recent static values embedded in the application code. It is clearly labeled as such where possible. Fallback data should be treated as indicative only.
The system automatically retries on the next user request and resumes live data once the upstream provider is available again. Cloudflare KV cache entries expire according to the TTL table above, at which point fresh data is fetched.
Gold, silver, platinum, and palladium prices are sourced from Metals.Dev on a free tier that allows approximately 100 requests per month. To stay within this limit, we cache precious metals data for 8 hours — meaning the displayed price could be up to 8 hours old. This is clearly marked in the data source attribution. For real-time precious metals prices, we recommend checking dedicated commodities platforms.
Casablanca Stock Exchange data is sourced from Drahmi, a Moroccan financial data API. CSE stocks are cached for 60 minutes. Since the BVC only trades Monday to Friday from 09:30 to 15:30 WAT, data outside these hours reflects the previous session's closing prices.
Some currency cross rates against the dirham (MAD) are calculated rather than directly quoted. For example, GBP/MAD is derived from USD/MAD and GBP/USD rates from Open Exchange Rates. The calculation is: GBP/MAD = USD/MAD ÷ GBP/USD. This introduces a small rounding difference compared to directly quoted rates.