The Small Trusted Network: Building a Trading-Partner Fund Intelligence Service with AWS Lambda Web Functions - Part 2
The Small Trusted Network: Building a Trading-Partner Fund Intelligence Service with AWS Lambda Web Functions - Part 2
Series: Financial Service (33 articles)
- …
- 25The Small Trusted Network: Building a Trading-Partner Fund Intelligence Service with AWS Lambda Web Functions - Part 2 This article
Economics and long-term ownership
The direct infrastructure bill for a small service can be modest, but the meaningful comparison is total operating cost. An EC2 design includes instance hours, operating-system patching, vulnerability remediation, load balancing, certificates, scaling, backups, monitoring, failover capacity, and engineering time. A fragmented multi-provider design adds vendor contracts, identities, data-processing review, duplicated logs, egress paths, support escalation, and portability work. A Lambda Web Functions design includes requests, active CPU, memory for active environments, CloudFront, WAF, data transfer, CloudWatch, S3, KMS, DynamoDB or Aurora, Step Functions, EventBridge, and external data licenses.
The service should measure cost per trusted partner decision rather than celebrate a low compute line item. Useful operating measures include time to onboard a partner, time to revoke access, percentage of responses with complete lineage, source freshness compliance, mean time to detect stale data, mean time to reproduce a disputed metric, override frequency, calculation escape rate, false authorization denials, partner p95 latency, and monthly cost per active partner.
Frugality is achieved when the team removes undifferentiated work while preserving durable controls. Running entirely within AWS can reduce operational fragmentation, but concentration risk must be acknowledged. The institution remains responsible for recovery objectives, service quotas, Region strategy, data portability, tested backups, and a documented response to an AWS impairment. One-cloud simplicity is not an excuse for one-path fragility.
The standard worth raising
The industry does not need more endpoints that make uncertain information look exact. It needs small services that are honest about what is known, what is estimated, what is stale, who is entitled, how the result was calculated, and who approved publication. Lambda Web Functions makes the HTTP layer simpler. Amazon S3 and CloudFront make the landing page simpler. EventBridge Scheduler, Step Functions, Event Functions, SQS, DynamoDB, Aurora, KMS, CloudWatch, CloudTrail, and WAF make the supporting controls composable. None of them removes the need for judgment.
The human system must be designed with the same care. Psychological safety allows the first warning to be heard. Radical truth places evidence above hierarchy. Appropriate transparency makes reasoning inspectable without exposing restricted information. Adlerian belonging gives people status for serving the collective outcome. Nonviolent Communication makes conflict specific and actionable. Tactical empathy allows partners and control teams to recognize each other’s constraints. Amazon Leadership Principles turn these ideas into daily mechanisms built around customers, ownership, depth, standards, trust, backbone, and results.
The highest standard for this product is not maximum traffic. It is maximum integrity per interaction. Every authorized partner should receive the right information, at the right freshness, with the right meaning, through a controlled path. Every denied request should be explainable. Every metric should be reproducible. Every revision should be reversible. Every incident should improve the mechanism. Every infrastructure component should earn its place through long-term customer value.
That is the promise of the small trusted network. It does not imitate the machinery of a large public platform. It gives a focused trading community exactly the reliability, transparency, and restraint that high-consequence decisions deserve. It uses serverless technology to own fewer servers and uses that recovered attention to own more of the truth.
Enterprise account, identity, and environment design
The production implementation should begin in the AWS organization rather than in the Lambda console. The institution should place the service in a dedicated production workload account governed by AWS Organizations and AWS Control Tower, with separate development, testing, security, log-archive, and shared-services accounts. The production account should inherit service control policies that deny unapproved Regions, prevent CloudTrail and AWS Config from being disabled, restrict creation of public S3 buckets, require approved encryption controls, and limit changes to security services. The deployment role should be assumed through AWS IAM Identity Center with short-lived credentials and multifactor authentication. Human users should not hold long-lived access keys.
The account boundary reduces the blast radius of a trader-built application and creates clean cost, evidence, and ownership boundaries. It also allows the security team to centralize CloudTrail organization trails, GuardDuty administration, Security Hub findings, and AWS Config aggregation without granting the application team unrestricted access to the security account. Development data should be synthetic or irreversibly masked. Production fund data, partner identity, and material nonpublic information should never be copied into a developer sandbox to simplify debugging.
The naming convention should make ownership and environment visible. Resources can use names such as
tpf-intel-prod-web , tpf-intel-prod-published , and tpf-intel-prod-raw . Required tags should include application ID, environment, business owner, technical owner, data classification, recovery tier, cost center, and record-retention class. An AWS tag policy can validate accepted keys and values. AWS Budgets and Cost Anomaly Detection should alert the product owner and FinOps team when spend departs from the expected low-volume profile.Partner onboarding and entitlement lifecycle
Partner onboarding is a controlled business process, not merely an identity configuration task. The sponsor records the legal entity, approved business purpose, contract, market-data rights, permitted funds, permitted metrics, geographic restrictions, named users or workload identities, activation date, expiry date, and accountable relationship owner. Compliance confirms that the disclosure does not violate confidentiality, restricted-list, wall-crossing, data-license, investment-adviser, broker-dealer, or contractual obligations. Information Security approves the authentication pattern. The data owner approves field-level release.
Each entitlement should expire automatically. A quarterly access recertification should require the business owner to confirm that the partner, users, funds, and fields remain appropriate. Employment termination, role change, contract expiry, suspected credential compromise, or restricted-list status should trigger immediate revocation. DynamoDB conditional writes can prevent two administrators from overwriting each other’s changes, while DynamoDB Streams can preserve a durable entitlement-change event for monitoring and evidence.
An entitlement record should carry a policy version and decision attributes rather than a single boolean. These attributes can include
partnerId , subjectId , fundIds , metricScopes , positionDetailLevel , permittedDelay , purpose , effectiveFrom , expiresAt , and approvalId . The application should deny by default when an attribute is absent or inconsistent. The response serializer should remove unauthorized fields even after the route has authorized the general request. This prevents a future developer from adding a sensitive field to the domain object and unintentionally exposing it through JSON serialization.Machine-to-machine access should use a separate client identity for each partner and environment. Credentials should be short-lived wherever possible. If an API credential must be issued, it should be stored by the partner in an enterprise secret manager, hashed or encrypted at rest on the issuer side, rotated on a defined schedule, scoped to the minimum operation, and revocable without affecting other partners. A credential should never identify an entire market-making consortium.
Data contracts and canonical financial records
The platform should publish explicit data contracts. An API schema should define field type, unit, currency, precision, nullability, freshness, confidentiality, and economic meaning. OpenAPI can describe the HTTP contract, but it is not a substitute for a financial definition. The definition of paid-in capital must state whether it includes management fees, organizational expenses, equalization, recallable distributions, and recycled proceeds. The definition of NAV must identify valuation date and source.
Raw cash flows should use immutable identifiers and correction chains. A corrected distribution should not overwrite the original row. The new record should reference the superseded record and carry a correction reason. Holdings should distinguish legal issuer, economic issuer, security, share class, vehicle, currency, quantity, price, valuation method, and look-through mapping. Regulatory records should preserve the source filing identity and amendment sequence.
Decimal values should be stored using decimal types or scaled integers rather than uncontrolled binary floating point. Money can be stored as minor units when the currency supports a stable minor unit, while ratios and rates should use an agreed decimal scale. Presentation rounding must occur at the API boundary. Downstream calculations must use unrounded values. A displayed TVPI of 1.80 must not become the input for a subsequent benchmark calculation when the approved internal value is 1.795437.
The API should return an explicit schema version such as
2026-10-01 and support a documented compatibility window. Breaking field changes require a new route version or negotiated migration. Additive fields can still create risk when consumers deserialize strictly, so they should be tested with partner clients before release. Contract tests should run against representative partner integrations in preproduction.Detailed calculation engineering
For DPI, the engine should calculate cumulative qualifying distributions divided by cumulative qualifying paid-in capital as of a defined date. It should separately expose recallable distributions and recycled capital. The manifest should record the policy treatment. A denominator of zero should return a not-calculable status rather than infinity or zero.
For TVPI, the engine should calculate distributions plus residual value divided by paid-in capital. RVPI should be exposed as residual value divided by paid-in capital, allowing TVPI to reconcile to DPI plus RVPI subject to rounding. Validation should assert the algebraic relationship before publication. The system should show the percentage of residual value based on stale marks, manager marks, market prices, recent financing rounds, or internal adjustments.
For IRR, a bracketed numerical method is safer than an unconstrained Newton iteration when derivatives are unstable. The engine should identify whether the cash-flow stream changes sign, search a governed rate interval, detect multiple sign changes, and return a status when multiple economically plausible roots exist. Golden cases should include a single contribution and distribution, uneven dates, same-day flows, all-positive flows, all-negative flows, multiple-root examples, extreme rates, and leap-year dates. Property tests should confirm that scaling every cash flow by a positive constant leaves IRR unchanged and that increasing a terminal positive distribution does not reduce IRR for a conventional cash-flow sequence.
Gross and net metrics need independent source lenses. Gross performance is constructed before fund-level fees and carry at the investment or gross-fund level. Net performance follows limited-partner cash flows. Subscription-line treatment should be visible because delayed capital calls can increase reported IRR without changing the underlying asset outcome. The service should consider presenting an unlevered or adjusted view where policy permits, alongside the reported view, rather than silently modifying the official metric.
For public-market-equivalent analysis, the engine should replay each contribution and distribution against an approved total-return index series. A Kaplan-Schoar PME calculation should preserve every synthetic index unit purchase and sale. The benchmark series must be licensed for the intended partner distribution. The platform should not assume that permission to view market data internally includes permission to redistribute derived values externally.
Near-real-time publication pipeline
A near-real-time pipeline begins with event time, source time, processing time, and publication time as separate concepts. An object received at 10:03 can contain a valuation effective at the prior quarter-end. The API should not call it current merely because processing was fast. Each record should preserve these clocks and a business-effective date.
EventBridge Scheduler can initiate predictable collection, while EventBridge events or S3 notifications can initiate source-driven processing. SQS queues should isolate each provider so a slow or failing provider does not block all sources. Visibility timeout must exceed normal processing duration, and the consumer must extend it or fail safely for longer work. Redrive policy should move repeatedly failing messages to a dead-letter queue. Replay tooling should require an authorized operator, preserve the original message identity, and create a new replay identifier.
Step Functions should express the financial control path. A typical execution records the run, acquires data, writes raw evidence, verifies checksums, validates schema, validates business date, normalizes identifiers, calculates metrics, reconciles against the prior publication, evaluates thresholds, requests approval when needed, writes the approved view, and invalidates the relevant CloudFront object if caching is enabled. A failed state should preserve the exact stage and error class. Operators should never need to infer workflow state from a sequence of unrelated log messages.
Material-change thresholds should be metric-specific. A one-basis-point move in a benchmark series may be immaterial, while a one-basis-point change in an entitlement decision is meaningless because entitlement is categorical. A 10 percent movement in NAV or a significant shift in top-ten concentration can require review, but the thresholds must be approved by the business and risk owners rather than copied from a generic template. The platform should support absolute, relative, and qualitative rules.
Caching without cross-partner leakage
CloudFront caching can reduce latency, but personalized financial responses create a serious cache-key risk. The safest initial design disables caching for authenticated API responses. Static assets remain highly cacheable. If private API caching is later introduced, the cache key must include every attribute that changes response content, including partner identity, entitlement class, fund, query parameters, and API version. Authorization headers and cookies require careful treatment, and sensitive responses should use
Cache-Control: private, no-store unless a reviewed design proves isolation.The application should also prevent shared in-process caches from crossing partner boundaries. Module-level caches are shared by concurrent requests in the same Web Function environment. Every cache key must include authorization scope. Cached objects should be immutable or defensively copied. The cache must have an explicit time-to-live and maximum size to protect the fixed memory envelope. A process-local cache is an optimization, never the source of truth.
Load testing and concurrency calibration
Load testing should reproduce the expected partner mix rather than generate only uniform requests. The test should include dashboard bursts at market open, repeated polling, large authorized responses, denied requests, upstream slowness, database failover, and simultaneous revision deployment. It should measure p50, p95, and p99 latency, error rate, initialization latency, active environments, concurrent requests per environment, event-loop lag, heap use, socket use, DynamoDB consumed capacity, and downstream throttles.
Concurrency should be increased in measured steps. An I/O-heavy Fastify route may perform well at 64 concurrent requests, but a route that performs JSON transformation over large holdings can block the event loop. The test should begin at 8 or 16 concurrent requests per environment and progress toward 32, 64, and, only when justified, 128. The selected value should keep memory and event-loop lag within the service objective under the largest permitted response.
The endpoint rate limit should be lower than the least tolerant downstream dependency after accounting for cache hit rate and fan-out. If one API request can generate four database reads and the database safely supports 800 reads per second for this workload, an apparent 500-request-per-second endpoint ceiling is unsafe. The capacity model should incorporate the fan-out factor and reserve operational headroom.
Deployment engineering and software supply chain
The deployment pipeline should build on Linux Arm64, run unit, integration, property, contract, and security tests, generate a software bill of materials, scan dependencies, and produce a content-addressed ZIP artifact. The exact S3 object version and checksum should be recorded in the release manifest. Production deployment should use infrastructure as code through AWS CloudFormation, AWS CDK, or the enterprise’s approved Terraform workflow, even when the first learning deployment was created manually in the console.
The pipeline role should create a new immutable Web Function revision but should not independently approve production traffic. Separation of duties can require a release approver or automated policy gate before endpoint weights change. A canary should compare not only technical health but also financial output. The same authorized synthetic request should be sent to both revisions, with sensitive dynamic fields normalized, and the results should match unless an approved calculation change exists.
Dependency review should pay particular attention to transitive packages, native Arm64 binaries, token-validation libraries, decimal arithmetic, HTTP clients, and parsers for regulatory or manager data. Package-lock integrity should be enforced. Unused dependencies should be removed because every package increases cold-start work and supply-chain exposure. Secrets should never enter build logs, package metadata, source maps, or test fixtures.
Resilience and recovery
The business owners should define recovery time and recovery point objectives for the API, published views, entitlement data, raw evidence, and workflow state separately. The landing page can often recover quickly from S3 and CloudFront. Recreating approved calculation views may require restoring DynamoDB point-in-time recovery or Aurora backups. Raw evidence should be protected through S3 versioning, replication where approved, and tested restoration.
A Multi-Region Web Function endpoint can reduce latency for geographically distributed partners, but the data architecture remains the hard part. DynamoDB global tables provide multi-Region replication with their own conflict semantics. Aurora Global Database offers a different writer and failover model. S3 Cross-Region Replication is asynchronous. Secrets, KMS keys, CloudWatch alarms, identity dependencies, and partner allowlists must exist in each required Region. The design should prefer replicated read-only published views where possible and retain one authoritative publication workflow until multi-writer behavior is truly required.
Recovery exercises should include loss of the primary Region, KMS key denial, expired certificate, identity-provider outage, corrupt deployment artifact, stale DNS, unavailable external provider, poisoned queue message, database connection exhaustion, accidental entitlement deletion, and incorrect publication. The exercise must verify business operation, not only infrastructure creation. A restored API that serves an unreconciled or unauthorized dataset is not recovered.
Market conduct, confidentiality, and regulatory controls
The service must be evaluated against the institution’s actual regulated activities and jurisdictions. A Hong Kong implementation can require review under applicable expectations of the Hong Kong Monetary Authority or Securities and Futures Commission, the Personal Data Privacy Ordinance, outsourcing and technology-risk policies, record-retention duties, market-conduct rules, and contractual confidentiality. US-facing data can introduce SEC, FINRA, investment-adviser, broker-dealer, privacy, and books-and-records considerations. The architecture does not establish compliance by itself.
The desk must classify whether each field is public, licensed, confidential, client-confidential, restricted, or material nonpublic information. Top holdings and inferred trades can create particular risk. Form 13F information may be public after filing, but derived estimates, internal mappings, counterparty context, and live market-making intent may not be. The API should support delayed publication, aggregation, suppression, and field-level denial.
The response should carry a machine-readable usage classification and a human-readable disclosure approved by Legal and Compliance. Disclosures should explain that private-market values may be based on periodic valuations, that inferred trades are not confirmed transactions, that benchmark comparisons depend on methodology, and that the service is not a substitute for the partner’s independent assessment. These disclosures should not be used to excuse inaccurate calculations or weak controls.
A concrete production acceptance standard
The production release is acceptable only when the S3 origin is private, CloudFront OAC is active, direct bucket access fails, the Web Function endpoint rejects unsigned direct requests, partner federation works, entitlement denial is tested, expired access is rejected, field-level response filtering is verified, and no secret exists in the browser bundle. The release must demonstrate raw-source versioning, calculation-manifest reconstruction, publication approval, rollback to the previous revision, dead-letter replay, and restoration from backup.
Security testing should include dependency scanning, static analysis, dynamic API testing, broken-object-level authorization tests, token substitution, expired-token handling, malformed-JWT handling, path and query manipulation, injection attempts, oversized payloads, cache poisoning, CORS validation, rate-limit behavior, and log-redaction verification. Financial testing should include golden datasets, property tests, amendment replay, stale-source behavior, multiple currency cases, benchmark gaps, zero denominators, and IRR failure cases.
Operational acceptance should show that named owners receive actionable alarms, runbooks contain exact response actions, support contacts are current, and the partner communication path is tested. A release is not production-ready because the endpoint returns 200. It is production-ready when the institution can prove who may access it, what each number means, how each number was produced, how an error is contained, and how service is restored.
Sources
AWS CloudFront secure static website guidance: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/getting-started-secure-static-website-cloudformation-template.html
AWS CloudFront Origin Access Control for Amazon S3: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html
Google re:Work team effectiveness and Project Aristotle: https://rework.withgoogle.com/intl/en/guides/understand-team-effectiveness
Ray Dalio, radical truth and radical transparency: https://www.principles.com/principles/f6412dca-b3f9-4dd0-bb65-274869dd21ed
Ray Dalio, limits of radical transparency: https://www.principles.com/principles/b1552e2e-f77b-46c0-b7dd-ba1f5c2b3407/
AWS Executive Insights on Day 1 culture: https://aws.amazon.com/executive-insights/content/how-amazon-defines-and-operationalizes-a-day-1-culture/
Series: Financial Service (33 articles)
- …
- 25The Small Trusted Network: Building a Trading-Partner Fund Intelligence Service with AWS Lambda Web Functions - Part 2 This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article