COMPOSITE MANDATES · CLEARING POOLS · TESTNET

A group buy, cleared on-chain

Three buyer agents each sign one rule: 3 units at 5 XLM, or 1 at 10 XLM. None reaches the vendor's 9-unit minimum alone. A shared clearing pool aggregates them; at the deadline the contract computes the single lowest workable price and settles every leg in one transaction. The allocation is a pure function of on-chain state, so the organizer holds no discretion to skim.

vendor minimum · 9 units + 40.5 XLMuniform clearing priceatomic capturedeadline auction
about two minutes end to end · a real deadline auction runs on testnet time

CLEARING POOL

Run the demo to register a pool. The vendor minimum and the close time go on-chain; the pool id is the hash of those exact terms, so they cannot be swapped under the members.

BUYER AGENTS

Buyer agent 1
3 × 5 XLMor1 × 10 XLM
  • sign mandate
  • approve allowance
  • commit to pool
Buyer agent 2
3 × 5 XLMor1 × 10 XLM
  • sign mandate
  • approve allowance
  • commit to pool
Buyer agent 3
3 × 5 XLMor1 × 10 XLM
  • sign mandate
  • approve allowance
  • commit to pool

THE ALLOCATION ANYONE CAN RECOMPUTE

Before capture, anyone can call the read-only simulate_clear and get the exact allocation the capture will execute. Same builder, same pure clearing function, same ledger state.

simulate_clear and clear_pool run the identical function over the identical on-chain state. Whoever organizes the pool picks nothing: not the price, not the quantities, not who is in. That is what makes strangers' agents willing to pool money.

WHAT THE CONTRACT REFUSES

·clear_pool before the close

Attempted live during the run, while the threshold is already met.

·a second clear_pool after capture

Attempted live after the capture lands.

Both rejections happen in the contract's money path, on-chain. The same enforcement that caps a solo mandate's budget governs the pool's timing and idempotency.

On-chain activity
stellar testnet · click any row to open the explorer
no activity yet · run the group buy