惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
IT之家
IT之家
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - Franky
I
InfoQ
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
雷峰网
雷峰网
博客园 - 聂微东
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Forward Settlement: how a trading agent locks tomorrow's ...
Baris Sozen · 2026-05-23 · via DEV Community

A trading agent agrees a price at 9am. Delivery is tomorrow. For the 24 hours in between, somebody is exposed: either the price moves and one side wants out, or one side simply doesn't show up to settle.

This is the oldest problem in market structure, and traditional finance solved it a long time ago — with a clearinghouse. A forward contract works because a central counterparty stands between the two parties, holds margin, and guarantees that the trade completes even if one side fails.

That solution doesn't transfer cleanly to autonomous agents. If you're building agents that trade — on top of an MCP server, inside a framework like LangChain or CrewAI, wherever — you eventually hit a case where the agent needs to commit to a trade now and settle it later. And the moment you reach for a forward, you've reintroduced exactly the trusted intermediary the rest of your stack was designed to avoid.

There's a way to get the forward without the clearinghouse. It's worth walking through, because it's a small idea with a large consequence.

What a forward actually needs

Strip a forward down to its mechanics and it asks for three things:

  1. A price, fixed now. Both parties agree terms today.
  2. A delivery window, in the future. Settlement happens at T+24h, T+48h, or whatever the two sides picked.
  3. A guarantee that both legs complete — or neither does. If one side vanishes, the other must not be left holding a half-finished trade.

The clearinghouse exists almost entirely to provide #3. It is a very expensive, heavily regulated answer to one question: who makes the trade whole if a counterparty fails?

For two agents on two different chains with no shared venue, that question has no good custodial answer. A centralized desk means both agents now trust the desk — and the desk can freeze, fail, or front-run. A bridge means trusting an optimistic settlement model: most bridges assume the far side will be made whole and rely on challenge windows to catch it if not. "Probably settled by tomorrow" is not a forward.

Why the naive on-chain version fails

The first instinct on-chain is to write an escrow contract. Agent A deposits the asset, the contract holds it until the delivery time, then releases it to Agent B against payment.

Look closely at "the contract holds it." Who can upgrade that contract? Who holds the admin key? Who decides what happens if the delivery oracle disagrees with one party? Every one of those questions is a custodian wearing a smart-contract costume. You haven't removed the trusted party — you've renamed it.

The fix is not a better escrow contract. It's to remove the holding step entirely.

The HTLC as a forward

A hash time-locked contract (HTLC) binds both legs of a trade to the same cryptographic secret and a timelock. The standard description of an HTLC emphasizes the atomic property: either both sides settle against the secret, or both sides refund after the timeout. No party can take one leg without releasing the other.

The piece that turns an atomic swap into a forward is the timelock itself. The timelock is not just a safety hatch — it is a programmable delivery window. Set it to 24 hours and you have described a T+24h forward in one parameter. Both legs are funded now, at the agreed price. Settlement can occur any time inside the window. If the window closes with the trade incomplete, both sides independently refund. No counterparty can be left exposed, because no counterparty was ever holding the other's asset — the contract logic was.

That gives you all three things a forward needs:

  • Price fixed now — both legs are committed at agreed terms when the contract is created.
  • Future delivery window — the timelock is the window.
  • All-or-nothing guarantee — the atomic property, enforced by the chain, not by a clearinghouse.

The delivery deadline is the part worth dwelling on. In the clearinghouse model, the guarantee is institutional: you trust that the central counterparty has the capital and the legal standing to make you whole. In the HTLC model, the deadline is enforced by the base layer. On Ethereum mainnet, the timelock is just block timestamps and contract code. Nobody — including the protocol that wrote the contract — can extend it, skip it, or quietly settle around it.

Where this fits for agents

We call this Forward Settlement, and it's a direct extension of the primitive Hashlock Markets already runs in production: atomic settlement, live on Ethereum mainnet today. The base layer is a sealed-bid RFQ for price discovery fused with HTLC settlement, exposed to agents through a 6-tool MCP server. A forward is not a separate product bolted on — it's the same HTLC with the timelock used deliberately rather than defensively.

The reason this matters for the agent economy specifically: agents are good at committing to future actions and bad at trusting counterparties they can't inspect. A forward written as an HTLC plays to both. The agent commits today; the chain enforces the window; neither agent has to evaluate the other's solvency, because solvency was never load-bearing. The trade either completes atomically or unwinds atomically.

It also composes. Because each leg is independently refundable and bound to the same secret, a forward can be one leg of a multi-leg trade — sell BTC, buy ETH, buy SUI, all or nothing — without inheriting a clearinghouse for the whole bundle.

The honest limits

A few things this does not do, because overclaiming helps nobody:

  • It does not eliminate price risk. A forward fixes a price; if the market moves, one side is worse off. That's the trade, not a bug.
  • It does not give you margin or leverage. Both legs are fully funded up front. This is a delivery guarantee, not a credit facility.
  • Today the production settlement layer is Ethereum mainnet. Sui contracts are deployed and CLI-tested with gateway wiring in progress; the Bitcoin P2WSH HTLC is validated on signet with mainnet still pending. Forward-dated settlement is live where atomic settlement is live — which today means Ethereum.

The underlying argument is in our working paper on SSRN, for anyone who wants the formal version rather than the blog version.

If an agent can get a forward without a clearinghouse, it's worth asking how much else in market structure was only ever a workaround for missing settlement guarantees — and how much of that an atomic primitive quietly makes optional.


Protocol: https://hashlock.markets
MCP server (canonical): https://github.com/Hashlock-Tech/hashlock-mcp