docs(routing): document optimistic provider queue (#1013) - #25
Open
chibie wants to merge 6 commits into
Open
Conversation
Documents the ranked provider queue resolved at order creation (paycrest/aggregator#1013). - GET /v2/rates: new `limit` query param (1-3, default 3); `providerIds` now returns up to 3 ranked ids per side instead of 0 or 1 - Order creation: `destination.providerIds` (v2 offramp) and `recipient.providerIds` (v1), marked writeOnly since neither is echoed back in responses or webhooks; full validation-error table - Onchain: `providerIds` in the encrypted recipient, plus a warning that the 500-byte message-hash budget is now ~49 bytes tighter on every order — payloads that previously passed can start failing - Notes throughout that queue exhaustion falls through to fallback assignment, not an immediate refund v1 rates left untouched: a scalar `data` cannot carry a ranked list. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolves a changelog conflict: both sides prepended a Q3 2026 entry. Kept both, newest first — optimistic provider routing (August) above senderFeeAddress (July). All other files auto-merged. Verified afterward that the network enums picked up starknet/tron from main with the new `limit` param intact, and that none of the three create-order examples carry a sender fee, so none need the new `senderFeeAddress`.
Removes every mention of OTC across the docs, and rewrites the provider queue prose to describe current behavior directly instead of contrasting it with how routing used to work. The changelog keeps its before/after framing, which is the point of that page. Notable: `orderType` enums in openapi-v2.yaml drop `otc`, leaving `enum: [regular]`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Stops steering readers to providerId as the workaround for restricted and fallback providers, and reframes it as the backward-compatible single-provider form throughout. A one-entry providerIds is now the documented way to route to a single provider. The eligibility constraint is still stated (it is a real 400), just without pointing at providerId as the alternative. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The docs describe the production API, so naming which environments run the recipient size check is noise for the reader and an internal detail besides. The constraint itself is unchanged.
Amends the queue docs for the follow-up that gave providerIds full pin parity (paycrest/aggregator#1020, merged). - Restricted providers are queueable by the senders their list names, rather than rejected outright - A fallback entry is accepted and ignored; the "cannot be queued explicitly" error is gone - A one-entry queue is exactly a pin, which is what lets integrators use providerIds everywhere and never reach for providerId - Onramp accepts destination.providerIds, capped at one entry - New behaviour change: pinning an onramp order to a provider restricted to other senders now 400s, and this applies to the singular providerId too Folded into the existing changelog entry rather than added as a second one -- neither PR has shipped to readers, so there is no before/after to describe, except the onramp authorization change, which existing providerId users will feel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the ranked provider queue resolved at order creation, from paycrest/aggregator#1013.
Important
Do not merge before aggregator#1013 merges. That PR is still open. Every literal "3" in these docs tracks
utils.DefaultProviderQueueSize, and the validation error strings arefmt.Sprintf'd from it — if the constant or any wording changes before merge, these tables drift silently. Worth a re-diff against the merged SHA.What changed
Specs
openapi-v2.yaml— newlimitquery param on the rates path (integer 1–3, default 3);V2RateQuoteSide.providerIdsrewritten for ranked semantics, andratenow states it belongs toproviderIds[0];providerIdsadded toV2FiatDestination; third request example showing a queue passed through from a quote. Also filled in the missingdescriptiononV2CryptoDestination.providerIdwhile in there.openapi-v1.yaml—providerIdsonPaymentOrderRecipient. v1 rates left untouched: a scalardatacannot carry a ranked list.Prose
api-reference/general/get-token-rate.mdx—limitrow and example, ranked response table + 3-element sample, new### The provider queuesection under Rate resolution.implementation-guides/sender-api-integration.mdx— new### Pin a provider queuewith the rules table and all seven verbatim 400 messages; prefetch note and JS/Python samples now pullproviderIds.implementation-guides/smart-contract-interaction.mdx— new### Routing fieldsplus a<Warning>on the tightened message-hash budget.resources/troubleshooting.mdx,api-reference/errors.mdx,resources/changelog.mdx.No
docs.jsonchange — no new pages, matching the precedent of #15 and #21.Notes for reviewers
The byte-budget change is the one integrators will actually feel. Everything else here is additive. But the recipient encryption preflight now reserves room for a full 3-provider queue on every order — including orders that never send
providerIds, because one may be resolved onto the order and rides in the message hash at gateway submit. That leaves ~49 fewer bytes (~41 when pinning aproviderId) inside the 500-byte cap foraccountIdentifier+accountName+memo+metadata. A payload that passed yesterday can start returning400 "Recipient data too large for encryption"with no client-side change. It gets a<Warning>, a troubleshooting entry, and a Behavior change: lead in the changelog — soften that framing here if it reads too loud.providerIdsis markedwriteOnlyin both specs. The field is accepted on create but no response builder ever populates it — orders and webhooks return only the singular assignedproviderId. WithoutwriteOnlythe generated playground would show it in create/GET/webhook response examples, which would be wrong. NoteV2FiatDestinationis$ref'd from three response schemas, and v1'sPaymentOrderRecipientis reachable from a v1 GET response, so this applies to both.Three places where the docs deliberately say something non-obvious:
providerIdsentry, same as pinned quotes.Onramp is excluded throughout:
V2CryptoDestinationaccepts only the singularproviderId, and an onrampproviderIdsis silently ignored by binding.Verification
redocly lintfindings are byte-identical tomain(19 errors / 65 warnings, all pre-existing) — nothing new introduced.mint broken-links→no broken links found, including the three new cross-page anchors.?limit=0/?limit=4return the documented 400 string verbatim, and that create/GET responses genuinely omitproviderIds.🤖 Generated with Claude Code