Settling one Token Standard V2 settlement in several batches, when the allocations were made before the batches were known
- cohen.avrahamOP
Hi all,
A question about Token Standard V2 settlement design.
Since Scan’s source has a default limit on how large a settlement batch it accepts: SettlementConfig(maxLegs = 100, maxParties = 100, maxAllocations = 100) in TokenStandardConfig.scala. We don’t know what MainNet is configured with (see question 4), but some limit exists, so a payout to more holders than that has to be settled in several batches. When the allocations are made just before settling, this is easy: each batch gets its own SettlementInfo id.
The hard case: a cash tender offer. Each holder tenders before a deadline. To make sure it can’t sell the securities before the settle, it creates two allocations at that moment, both committed until the offer’s settlement deadline:
- a tender: no legs, nextIterationFunding = the tendered quantity;
- a cash receipt: no legs, empty funding.
Both are for the offer’s SettlementInfo (one id). After the offer closes, the executors prorate and name the transfers with extraTransferLegSides. Because the holders’ allocations already exist for that one id, every batch has to settle under the same SettlementInfo.
The approach we’re considering: the offeror makes its cash allocation for every batch up front, all committed, and the executors then settle batch 1, batch 2, and so on, each a SettlementFactory_SettleBatch under the same id. With the token standard’s test token this works. From reading settlementFactoryV2_settleBatchDefaultImpl and Amulet’s allocate (“settlement.id: no check”), we’d expect it to work with Canton Coin too.
Questions:
- Is several SettleBatch calls under one SettlementInfo intended? Each call uses different allocations. The allocation interface says executors “MUST ensure that the triple of (id, cid, meta) is unique across settlements”, and its header mentions “multiple settlement iterations”. We read several batches of one settlement as allowed. Is that the intended reading, and is Amulet expected to keep accepting it in future releases? If a registry started refusing a second batch under one id, a payout could end with batch 1 paid and the rest not.
- Is there a recommended pattern for allocations made before the batches are known? For example, could an authorizer pre-authorize the executors to move a committed allocation to a new settlement id, or to split it across several? Otherwise a holder whose batch failed has to come back and allocate again.
- Allocation lifetime. Amulet sets expiresAt to the earlier of the settlement deadline and tokenStandardMaxTTL (90 days by default). Is expiresAt the right field for an application to check that an allocation will last until the settlement deadline? And is a registry expected to honour it, rather than expire an allocation earlier?
- Batch size. What are the batch limits on MainNet today (legs, parties and allocations per batch), and are they the same on every SV’s Scan? Are they expected to stay, grow, or become per-registry configuration? And is there guidance for applications that need to settle more than that atomically?
- Recovery. When a later batch can’t settle (an allocation expired, the registry refused, or the deadline passed), how would you finish paying the remaining holders? The best we have is to release the remaining holders’ allocations and ask them to allocate again under a new settlement id with a new deadline. Is there something in the standard, or planned for it, that we’re missing?
Thanks!
- michaelwhite
Reading the interface text, the (id,cid,meta) uniqueness rule seems aimed at preventing double-spend of an allocation, not at forbidding several SettleBatch calls under one SettlementInfo. But those are different claims: the header’s “multiple settlement iterations” is suggestive, not a registry-level guarantee that a later batch will always be accepted. I would not rely on batch 1 completing while batch 2 is still optional unless that multi-batch behavior is explicitly documented for Amulet. For expiresAt, use it as the application check, but treat registry early expiry as a risk to clarify.
- cohen.avraham
Thanks, that matches our reading of the uniqueness rule. We agree it isn’t a guarantee. For now we treat a refused later batch as a recoverable case: the remaining holders are released and lock again under a fresh settlement id with a new deadline, and we check
expiresAtwhen an allocation is given. It would still help a lot to hear from the Amulet maintainers whether severalSettleBatchcalls under oneSettlementInfoare intended to keep working, and what MainNet’s batch limits are. - Colin