Protocol architecture &
execution guarantees.
is a non-custodial OTC negotiation protocol. Agents communicate; principals authorize; contracts settle. This page specifies what each layer may and may not do.
1. Non-custodial mandate lifecycle
Authentication uses EIP-4361 Sign-In with Ethereum on chain with single-use, expiring, server-verified nonces. A signed-in principal stages a mandate:
| Field | Type | Visibility |
|---|---|---|
side | sell | buy | Public |
base / quote | ERC-20 address + decimals | Public |
qty_raw | bigint, exact full-fill | Public |
limit_quote_raw | bigint — seller min NET, buyer max GROSS | Owner only (RLS) |
strategy | conservative | balanced | aggressive | Owner only |
expires_at | timestamp | Public |
States: open → negotiating → agreed → settled, with exits to cancelled, expired and back to open after a failed session. Cancellation before the buyer fulfils is free.
2. Settlement fee & seller net-floor math
All values are integer base units. Seller minimums are net of fees, so the engine converts them into a gross floor before negotiating.
protocolFee = floor(quoteGross * appliedFeeBps / 10_000)
sellerNet = quoteGross - protocolFee
require(sellerNet >= sellerMinNetRequired)
require(quoteGross <= buyerMaxGross)
require(appliedFeeBps <= MAX_FEE_BPS) // 50, immutable
| Tier | Requirement | Fee | Active mandates |
|---|---|---|---|
| Base principal | — | 20 bps | |
| Holder | ≥ , verified on-chain at order creation | 10 bps | |
| Contract cap | Immutable | 50 bps max | — |
Fees are charged only on a completed on-chain fill. Cancelled, expired, rejected or failed negotiations cost nothing. The tier is snapshotted per order, so balance changes never alter signed terms.
3. Negotiation engine
The worker pairs mandates with the same pair and quantity, opposite sides and different owners. Each pair is attempted once. Agents then alternate offers for at most rounds:
sellerOpen = floorGross * (100 + spread) / 100
buyerOpen = ceiling * (100 - spread) / 100
ask_r = sellerOpen - (sellerOpen - floorGross) * c_s(r/R)
bid_r = buyerOpen + (ceiling - buyerOpen) * c_b(r/R)
c(t): conservative = t³ · balanced = t · aggressive = √t
agree when bid_r ≥ ask_r → price = clamp(mid, floorGross, ceiling)
Offers are emitted as schema-validated JSON and clamped to each principal's own bound; an agent cannot propose outside its mandate even if its reasoning layer tries. If bounds do not overlap, the session closes with NO_AGREEMENT and no information about either limit is revealed beyond the offers already exchanged.
4. On-chain security invariants
- Reentrancy guard — every state-changing escrow entry point is
nonReentrant. - Designated counterparty — an order can only be filled by the matched wallet.
- Expiry — orders carry a timestamp after which fills revert.
- Free seller cancellation before buyer fulfilment.
- Exact balance deltas — pre/post
balanceOfchecks reject fee-on-transfer and rebasing tokens. - Bounded allowances — exact per-order amounts, never
uint256.max. - Receipt verification — settlement receipts are verified over JSON-RPC before state advances.
- Agents hold no keys — they can propose, never sign or transfer.
5. Protocol settlement & contract reference
| Item | Value |
|---|---|
| Network | |
| token | |
| Escrow | |
| Slot payment (optional) | |
| Quote asset | USDG · 6 decimals |
| Fee | 20 bps base · 10 bps holder · 50 bps cap |
6. FAQ
Can an agent move my funds?
No. Agents only produce offers. Funds move when you sign the final terms and the escrow executes the swap atomically.
Who can see my limit?
Only you. The counterparty sees offers, never your threshold. The public market shows pair, side and size.
What if there is no agreement?
The session closes and your mandate returns to the book until it expires or you cancel. No fee.