David is built for financial agents. Its point-in-time guarantees let you step an agent through a scenario day by day without it ever seeing the future. This guide outlines the loop.
Every artifact in David carries a release date and a visible_from timestamp. When you pass as_of, David returns only what would have been visible at that point. So a backtest is simply: set the clock, query with as_of, let the agent decide, advance the clock, and repeat until you reach the scenario’s end_date.
This gives you the scenario’s date range, available_tickers, and public_summary (including path_mode and date_semantics) so you know the clock you’re stepping through.
After the run, score the agent against what actually happened in the scenario. Because the world is fixed and consistent, you can grade decisions by replaying realized outcomes: forward prices from /prices, realized earnings from /earnings, and the full event timeline, all queried without an as_of bound so you see the complete path.
Keep the grading queries in your evaluation layer, separate from the agent’s own request path. The agent should only ever see data bounded by its current as_of.
Use separate scenarios for train, validation, test, and holdout. David curates the library across all four splits; filter it to assemble each set. Because worlds are isolated, there’s no cross-split leakage.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"David","description":"Synthetic financial data API for building, training, and evaluating financial AI agents.","colors":{"primary":"#1F3A60","light":"#6C8CC7","dark":"#142A4A"},"logo":{"light":"https://mintcdn.com/davidandbksinc/inEMAHcS2v3dHpIe/logo/david_data_logo_navy_transparent.svg?fit=max\u0026auto=format\u0026n=inEMAHcS2v3dHpIe\u0026q=85\u0026s=3b671f77af402fccf1f11ac791edd60d","dark":"https://mintcdn.com/davidandbksinc/inEMAHcS2v3dHpIe/logo/david_data_logo_white_transparent.svg?fit=max\u0026auto=format\u0026n=inEMAHcS2v3dHpIe\u0026q=85\u0026s=d79b40c230dc8b9788f4bdc80db7f428"},"favicon":"https://mintcdn.com/davidandbksinc/gv22QHmJdsoEI3sJ/favicon.png?fit=max\u0026auto=format\u0026n=gv22QHmJdsoEI3sJ\u0026q=85\u0026s=2b91fe691e74bfb75b3115c8fe29622c","navbar":{"links":[{"href":"mailto:founders@davidhf.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://data.davidhf.com"}},"contextual":{"options":["copy","view","chatgpt","claude","mcp"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"davidandbksinc","hasAudioNarration":false,"actualSubdomain":"davidandbksinc","customDomains":["docs.davidhf.com"],"gitSource":{"type":"github","owner":"david-hedgefund","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"collectionId":"6ecdedb3-ec85-4498-a704-0d4fd0ac0e2d","liveDeploymentHistoryId":"6a570be78b065dcdadbc263a","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae95a5bdbcba01b9ab7fd1d:success","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"API reference","count":18},{"language":"default","tag":"Documentation","count":15},{"language":"default","tag":"Core concepts","count":5},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Guides","count":4},{"language":"default","tag":"Earnings \u0026 estimates","count":3},{"language":"default","tag":"Market \u0026 macro","count":3},{"language":"default","tag":"Disclosures","count":3},{"language":"default","tag":"Financials","count":3},{"language":"default","tag":"Ownership","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"guides/point-in-time-agents","slug":"/guides/point-in-time-agents","pageMetadata":{"title":"Building point-in-time agents","description":"Run a leakage-free backtest loop over a scenario.","href":"/guides/point-in-time-agents"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Run a leakage-free backtest loop over a scenario.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Tip}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`David is built for financial agents. Its point-in-time guarantees let you step an agent through a scenario day by day without it ever seeing the future. This guide outlines the loop.`}),`\n`,_jsx(Heading,{level:`2`,id:`the-core-idea`,children:`The core idea`}),`\n`,_jsxs(_components.p,{children:[`Every artifact in David carries a release date and a `,_jsx(_components.code,{children:`visible_from`}),` timestamp. When you pass `,_jsx(_components.code,{children:`as_of`}),`, David returns only what would have been visible at that point. So a backtest is simply: set the clock, query with `,_jsx(_components.code,{children:`as_of`}),`, let the agent decide, advance the clock, and repeat until you reach the scenario’s `,_jsx(_components.code,{children:`end_date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`1-choose-a-scenario-and-horizon`,children:`1. Choose a scenario and horizon`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.davidhf.com/scenarios/\u003cid>\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-KEY: YOUR_API_KEY\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`dd.scenarios.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cid>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`This gives you the scenario’s date range, `,_jsx(_components.code,{children:`available_tickers`}),`, and `,_jsx(_components.code,{children:`public_summary`}),` (including `,_jsx(_components.code,{children:`path_mode`}),` and `,_jsx(_components.code,{children:`date_semantics`}),`) so you know the clock you’re stepping through.`]}),`\n`,_jsx(Heading,{level:`2`,id:`2-step-the-clock`,children:`2. Step the clock`}),`\n`,_jsxs(_components.p,{children:[`At each `,_jsx(_components.code,{children:`as_of`}),` date, pull the information set:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Market state`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.davidhf.com/prices/snapshot/market?scenario_id=\u003cid>\u0026as_of=2026-03-26\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-KEY: YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# News visible so far`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.davidhf.com/news?scenario_id=\u003cid>\u0026as_of=2026-03-26\u0026limit=50\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-KEY: YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Events visible so far`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.davidhf.com/events/timeline?scenario_id=\u003cid>\u0026as_of=2026-03-26\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-KEY: YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Consensus as of now`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.davidhf.com/analyst-estimates?scenario_id=\u003cid>\u0026ticker=AAPL\u0026as_of=2026-03-26\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-KEY: YOUR_API_KEY\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`dd.prices.market_snapshot(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`scenario_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cid>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`as_of`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-26\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`dd.news.list(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`scenario_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cid>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`as_of`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-26\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`dd.events.timeline(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`scenario_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cid>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`as_of`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-26\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`dd.analyst.estimates(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AAPL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`scenario_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cid>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`as_of`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-26\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Because each call is bounded by `,_jsx(_components.code,{children:`as_of`}),`, nothing from after that date can leak into the agent’s reasoning.`]}),`\n`,_jsx(Heading,{level:`2`,id:`3-decide-advance-repeat`,children:`3. Decide, advance, repeat`}),`\n`,_jsxs(_components.p,{children:[`Feed the visible data to your agent, record its decision, advance `,_jsx(_components.code,{children:`as_of`}),` to the next trading day, and loop until you reach the scenario’s `,_jsx(_components.code,{children:`end_date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`4-grade-the-run`,children:`4. Grade the run`}),`\n`,_jsxs(_components.p,{children:[`After the run, score the agent against what actually happened in the scenario. Because the world is fixed and consistent, you can grade decisions by replaying realized outcomes: forward prices from `,_jsx(_components.a,{href:`/api-reference/prices`,children:_jsx(_components.code,{children:`/prices`})}),`, realized earnings from `,_jsx(_components.a,{href:`/api-reference/earnings`,children:_jsx(_components.code,{children:`/earnings`})}),`, and the full `,_jsx(_components.a,{href:`/api-reference/sectors-and-events#event-timeline`,children:`event timeline`}),`, all queried `,_jsx(_components.em,{children:`without`}),` an `,_jsx(_components.code,{children:`as_of`}),` bound so you see the complete path.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Keep the grading queries in your evaluation layer, separate from the agent’s own request path. The agent should only ever see data bounded by its current `,_jsx(_components.code,{children:`as_of`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`scaling-to-train/test`,children:`Scaling to train/test`}),`\n`,_jsxs(_components.p,{children:[`Use separate scenarios for train, validation, test, and holdout. David curates the library across all four splits; `,_jsx(_components.a,{href:`/api-reference/scenarios#list-scenarios`,children:`filter it`}),` to assemble each set. Because worlds are isolated, there’s no cross-split leakage.`]}),`\n`,_jsx(Heading,{level:`2`,id:`next`,children:`Next`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Date semantics`,icon:`clock`,href:`/concepts/date-semantics`}),_jsx(Card,{title:`Scenarios`,icon:`layer-group`,href:`/concepts/scenarios`})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Building point-in-time agents","description":"Run a leakage-free backtest loop over a scenario.","href":"/guides/point-in-time-agents"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The core idea","slug":"the-core-idea","depth":2,"children":[]},{"title":"1. Choose a scenario and horizon","slug":"1-choose-a-scenario-and-horizon","depth":2,"children":[]},{"title":"2. Step the clock","slug":"2-step-the-clock","depth":2,"children":[]},{"title":"3. Decide, advance, repeat","slug":"3-decide-advance-repeat","depth":2,"children":[]},{"title":"4. Grade the run","slug":"4-grade-the-run","depth":2,"children":[]},{"title":"Scaling to train/test","slug":"scaling-to-train/test","depth":2,"children":[]},{"title":"Next","slug":"next","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"davidandbksinc","siteName":"David","title":"Building point-in-time agents - David","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-25T06:36:28.132Z","originalFileLocation":"guides/point-in-time-agents.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Run a leakage-free backtest loop over a scenario.\">\u003cmeta data-mint-head name=\"application-name\" content=\"David\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Building point-in-time agents - David\">\u003cmeta data-mint-head property=\"og:description\" content=\"Run a leakage-free backtest loop over a scenario.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"David\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.davidhf.com/guides/point-in-time-agents\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://davidandbksinc.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Building+point-in-time+agents\u0026amp;description=Run+a+leakage-free+backtest+loop+over+a+scenario.\u0026amp;theme=ee662ea2618d84ee101000d9\u0026amp;signature=892041205911d9eabbc9d6c9f88d96a75346ed47b580712d1e60526aab92958d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Building point-in-time agents - David\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Run a leakage-free backtest loop over a scenario.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://davidandbksinc.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Building+point-in-time+agents\u0026amp;description=Run+a+leakage-free+backtest+loop+over+a+scenario.\u0026amp;theme=ee662ea2618d84ee101000d9\u0026amp;signature=892041205911d9eabbc9d6c9f88d96a75346ed47b580712d1e60526aab92958d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/davidandbksinc/pLmx2bSVF5aPHwFd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"David\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1F3A60\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.davidhf.com/guides/point-in-time-agents\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/point-in-time-agents.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.davidhf.com/#organization\",\"name\":\"David\",\"url\":\"https://docs.davidhf.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/davidandbksinc/inEMAHcS2v3dHpIe/logo/david_data_logo_navy_transparent.svg?fit=max\u0026auto=format\u0026n=inEMAHcS2v3dHpIe\u0026q=85\u0026s=3b671f77af402fccf1f11ac791edd60d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.davidhf.com#website\",\"name\":\"David\",\"url\":\"https://docs.davidhf.com\",\"publisher\":{\"@id\":\"https://docs.davidhf.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.davidhf.com/guides/point-in-time-agents#webpage\",\"url\":\"https://docs.davidhf.com/guides/point-in-time-agents\",\"name\":\"Building point-in-time agents\",\"description\":\"Run a leakage-free backtest loop over a scenario.\",\"dateModified\":\"2026-06-25T06:36:28.132Z\",\"isPartOf\":{\"@id\":\"https://docs.davidhf.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.davidhf.com/guides/point-in-time-agents#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.davidhf.com/guides/point-in-time-agents#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.davidhf.com/guides/get-fundamentals\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building point-in-time agents\",\"item\":\"https://docs.davidhf.com/guides/point-in-time-agents\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.davidhf.com/guides/point-in-time-agents#article\",\"headline\":\"Building point-in-time agents\",\"name\":\"Building point-in-time agents\",\"description\":\"Run a leakage-free backtest loop over a scenario.\",\"url\":\"https://docs.davidhf.com/guides/point-in-time-agents\",\"mainEntityOfPage\":{\"@id\":\"https://docs.davidhf.com/guides/point-in-time-agents#webpage\"},\"dateModified\":\"2026-06-25T06:36:28.132Z\",\"publisher\":{\"@id\":\"https://docs.davidhf.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.davidhf.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"David\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"David","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Introduction","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Errors \u0026 rate limits","href":"/errors"}]},{"group":"Core concepts","pages":[{"title":"Scenarios","href":"/concepts/scenarios"},{"title":"Synthetic data \u0026 provenance","href":"/concepts/synthetic-data"},{"title":"Market coverage","href":"/concepts/market-coverage"},{"title":"Ticker universe","href":"/concepts/ticker-universe"},{"title":"Date semantics","href":"/concepts/date-semantics"}]},{"group":"Clients","pages":[{"title":"Python SDK","href":"/sdk/python"},{"title":"MCP server","href":"/mcp"}]},{"group":"Guides","pages":[{"title":"How to get fundamentals","href":"/guides/get-fundamentals"},{"title":"How to get stock prices","href":"/guides/get-stock-prices"},{"title":"How to search SEC filings","description":"Find filings, drill into item-level text, and trace them to events.","href":"/guides/search-filings"},{"title":"Building point-in-time agents","href":"/guides/point-in-time-agents"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/overview"}]}]},"basePath":"","title":"Building point-in-time agents - David","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":[],"chunks":[]}