📊 Data · Transparency

Data Methodology

How Dalil Finance sources, updates, and displays financial market data for Morocco and global markets.

Open Live Dashboard →

How Dalil Thinks About Data Quality

Dalil is operated by a single independent engineer and everything on the site is built around a simple principle: the reader should always know where a number came from and how stale it might be. That principle drives the pipeline described below — the source hierarchy, the validation rules, the way missing data is handled, and the way conflicts between feeds are resolved.

Source Hierarchy

Not all sources carry equal weight. For any given metric, Dalil follows a declared priority order and prefers the highest-priority source that is currently available.

If a higher-priority source is missing but a lower one is available, the lower source is shown with its provenance label intact. Sources are never silently substituted.

Update Process and Caching

Dalil runs on Cloudflare Workers at the edge. When a user opens the dashboard, the browser requests data from the Dalil API, which in turn fetches from upstream providers, caches the response in Cloudflare KV, and returns consolidated JSON to the frontend. The cache TTL per asset class is declared on the Data Sources page. Multiple users benefit from the same cached call, which reduces both upstream cost and rate-limit consumption.

Financial filings (used by the stock pages for IAM, ATW, BCP) are ingested on a separate automated schedule. When a new annual (RFA) or half-year (RFS) report appears on the AMMC, the parser extracts revenue, net income, EPS, and ROE from the consolidated statements and writes the result into a Supabase table. The stock page reads from that table at render time.

Validation and Parsing Rules

Every fundamental metric extracted from a filing goes through a chain of validation rules before it is displayed:

Handling Missing or Ambiguous Data

When a metric is genuinely unavailable — because the parser could not extract it reliably, because the filing is not yet published, or because the upstream provider is down — Dalil hides the field instead of showing a placeholder or a dash. This matters on company pages: if ROE is not reliably extractable from a given year's filing, the ROE row simply does not render for that year. No "N/A", no "—", no fabricated estimate.

The one exception is reserved for dashboard live prices, where a short "loading" state is acceptable because the fetch completes within a few seconds and the surrounding context makes it obvious.

Ambiguous metrics — for example, a bank that discloses a ratio without saying whether it is calculated on group or social accounts — are treated conservatively: if the interpretation is not unambiguous, the parser leaves the field empty rather than guessing.

Dedup and Conflict Resolution

The filings ingest pipeline uses a delete-then-insert pattern keyed by ticker and period. When a new half-year report arrives for the same period as a previously parsed version (for example, a restatement), the older row is replaced cleanly. This prevents two competing values for the same period from ever sitting in the database simultaneously.

For live market data, when two upstream providers disagree, the higher tier in the source hierarchy wins. Where neither provider is clearly authoritative (for example, conflicting crypto prices across exchanges), the dashboard displays the value from the declared primary source and does not blend or average.

Data Sources

Dalil Finance aggregates data from multiple specialised providers to ensure the broadest possible coverage of Moroccan and global financial markets.

Casablanca Stock Exchange (CSE)

Moroccan stock market data - including MASI, MASI20, and individual stock prices - is sourced via Drahmi, a Morocco-focused financial data provider. Data reflects official CSE prices and is updated during trading hours (Monday to Friday, 09:30–15:30 Morocco time). Prices are delayed by at least 15 minutes as per CSE data licensing terms.

Foreign Exchange Rates

Dirham exchange rates against 20 currencies are sourced from Open Exchange Rates, updated every 30 minutes. Rates are mid-market reference rates and do not represent buying or selling rates available at banks or exchange bureaux. The USD/MAD rate is used as the base for all cross-currency conversions displayed on the platform.

Precious Metals

Gold, silver, platinum, and palladium spot prices are sourced from Metals.Dev using their free tier, updated every 8 hours. Prices are displayed in USD per troy ounce and converted to MAD per gram using the latest available USD/MAD rate. The troy ounce to gram conversion factor used is 31.1035.

Energy and Agricultural Commodities

Brent crude oil, WTI crude, natural gas, wheat, corn, coffee, cocoa, and soybean prices are sourced from Twelve Data. These are updated every 30 minutes during active trading sessions for each respective commodity exchange.

Global Indices

Major global stock market indices including the Dow Jones, S&P 500, NASDAQ, FTSE 100, DAX, CAC 40, Nikkei 225, and others are sourced from Twelve Data, updated every 30 minutes. Index values represent the most recent available quote during trading hours for each respective exchange.

Government Bond Yields

US Treasury yields (2Y, 5Y, 10Y, 30Y) use the DGS series from the Federal Reserve Economic Data (FRED) database and are updated daily. European and Asian government yields use OECD series, accessed where available through FRED.

Moroccan treasury yields (3M, 6M, 1Y, 2Y, 5Y, 10Y) are displayed when available from upstream providers. When provider data is unavailable, the dashboard may fall back to previously cached or estimated reference values, labeled as "fallback" in the data source attribution. These fallback values are approximate and should not be used for trading, valuation, or investment decisions.

Cryptocurrency

Cryptocurrency prices are sourced from Luzia via Binance market data, updated every 5 minutes. Prices are denominated in USDT and converted to MAD using the latest available USD/MAD rate. Cryptocurrency markets are highly volatile - prices may change significantly between updates.

Financial News

Market news is aggregated from RSS feeds including Hespress Économie, Medias24, Reuters Africa, and Reuters Business. News items are refreshed every 30 minutes. Dalil Finance does not produce or edit news content - all articles link to the original source publication.

MAD Price Conversions

All MAD price conversions displayed on the platform use the latest available USD/MAD reference rate from Open Exchange Rates, updated approximately every 30 minutes. Gold and silver prices in MAD per gram are calculated as: (USD spot price per troy ounce ÷ 31.1035) × USD/MAD rate. Cryptocurrency MAD prices are calculated as: USD price × USD/MAD rate.

Update Frequency Summary

CSE stocks and MASI update during trading hours (09:30–15:30 Morocco time). FX rates update every 30 minutes. Precious metals update every 8 hours. Energy and indices update every 30 minutes. Bond yields update daily. Cryptocurrency prices update every 5 minutes. News updates every 30 minutes.

Disclaimers

All data on Dalil Finance is provided for informational purposes only. Prices are delayed and may not reflect real-time market conditions. Dalil Finance is not a licensed financial adviser and nothing on this platform constitutes investment advice. Users should verify prices with their broker or bank before making any financial decision.