Integration Reference

OTC Orders and RFQ

Integrate EVM PT/YT rate orders, signed quote requests and MetaVault responses.

Spectra OTC settles individual PT/YT trades through Spectra's deployment of the 1inch Limit Order Protocol. The API validates and stores signed orders; it does not hold funds or execute fills. RFQ adds a non-binding request and response workflow around those same orders.

For the public order book, partial fills and AMM/book batch execution, use the EVM limit-order reference. Its canonical fee-order profile and API are separate from the OTC/RFQ flow below.

EVM OTC is available on Base (8453), Katana (747474) and Flare (14).

Resolve the deployment

See the deployed contracts for Base, Katana and Flare.

Resolve current addresses at runtime with GET https://api.spectra.finance/v1/{network}/otc/config, where network is a supported chain ID or network slug. A successful response is { success: true, data: { limitOrderProtocol, rateAmountGetter, authorizedTakersGuard, orderSigner } }.

These addresses come from the execution chain's global MetaVaultsRegistryV2 keys:

Response fieldRegistry key
limitOrderProtocolspectra.otc.settlement
rateAmountGetterspectra.otc.rate_getter
authorizedTakersGuardspectra.otc.takers_guard
orderSignerspectra.otc.order_signer

The endpoint is uncached. A 503 can mean that OTC is disabled or a complete deployment cannot be resolved. Treat that as unavailable; do not substitute test addresses. Keep each stored order's original settlement for history and cancellation when the current configuration changes.

Rate-order model

The maker signs an eight-field 1inch v4 order with Spectra's getter installed on both amount-getter legs. The extension encodes the PT address, derivative kind, quote kind and implied APY. The salt binds the extension to the order.

TermMeaning
derivativeKind0 = PT, 1 = YT.
quoteKind0 = underlying, 1 = IBT, from the same market.
makingAmountFixed total quantity sent by the maker, in that token's base units.
takingAmountCreation-time baseline; use the getter for the current payment.
impliedApyWadAnnual effective rate in units of 10⁻¹⁸. For 5%, use 50000000000000000. The maximum is 10 × 10^18 (1,000%). YT orders require a positive rate.
ExpiryUnix timestamp in seconds. To publish, choose a future expiry strictly before PT/YT maturity. The getter accepts up to ten 365-day years remaining to maturity.

The getter recalculates the counter-amount at execution. Do not price a fill from the stored baseline or floating-point display values. Use each token's decimals. The supported pairs are PT ↔ underlying, PT ↔ IBT, YT ↔ underlying and YT ↔ IBT. No AMM pool is required.

Set exactly one fill policy in makerTraits.

PolicyTraitsBehavior
Partial fills (the apps' default)ALLOW_MULTIPLE_FILLS set, NO_PARTIAL_FILLS clearAny number of fills, each at most what is left. The settlement tracks the remainder by order hash.
No partial fillsNO_PARTIAL_FILLS set, ALLOW_MULTIPLE_FILLS clearOne fill of the whole makingAmount, closed through the maker's nonce bit.

Both flags set, or neither, is rejected. A partial order still carries a nonce, which the API keeps unique per maker. Orders also require receiver = 0 and allowedSender = 0. Private orders use SpectraAuthorizedTakersGuard with up to 64 authorized addresses. It checks the immediate caller of the fill: for a MetaVault taker, authorize the Safe. The list is signed data, not confidential data.

Private OTC orders: use direct settlement.

Do not authorize the BatchFiller as a taker for private OTC orders or use it to fill them. Fill private OTC orders directly through LimitOrderProtocol.

ERC-4626 compliance required.

Spectra assumes its interest-bearing tokens (IBTs) conform to the ERC-4626 standard. Deviations from its exchange-rate, conversion and preview behavior can cause incorrect pricing, accounting discrepancies or failed protocol operations.

Publish and fill

  1. Read the execution chain’s OTC configuration and verify the PT, YT, IBT and underlying addresses for the market.
  2. Choose a maker asset, taker asset and positive making amount. Encode the rate, expiry, a unique maker nonce and the fill policy. Bind the extension to the salt as specified in the OTC encoding reference.
  3. Call rateAmountGetter.previewOrder(order, extension). Use its positive takingAmount as the creation-time baseline, in the taker asset’s base units.
  4. Sign the completed order in the EIP-712 domain 1inch Limit Order Protocol, version 4, with the execution chain ID and settlement as verifyingContract. Check that its digest equals limitOrderProtocol.hashOrder(order). Reusing a nonce within this domain can invalidate multiple orders.
  5. Approve the settlement to spend the maker asset. Publish the order envelope to POST /v1/{network}/otc/create.

Before filling, recompute the order hash, check the signed extension against the current configuration and verify the expiry and signature. Read the maker’s balance, allowance and invalidator from the chain and get a fresh price. A failed read leaves fillability unknown.

Read what an order has left by its policy:

  • Partial fills: rawRemainingInvalidatorForOrder(maker, orderHash) returns 0 while untouched (the whole makingAmount is left), otherwise ~remaining; ~0 (nothing left) once filled or cancelled. For a nonzero raw value, the remaining amount is 2^256 − 1 − raw.
  • No partial fills: pass the full nonce to bitInvalidatorForOrder(maker, nonce); the contract shifts it internally. Test bit nonce & 255 in the returned bitmap.

A closed order takes precedence over low balance or allowance when displaying it. Compare the maker's balance and allowance with what is left, not with the whole makingAmount.

In maker-amount mode, the fill’s amount is the quantity of the maker asset to receive. Use the full makingAmount for an all-or-nothing order. For a partial fill of q PT or YT base units, read the current remainder and preview the whole order at the latest block. Let M be the signed making amount and T the preview’s taking amount.

Maker’s sideMaking amount to take
Sells PT or YTmin(q, remaining)
Buys PT or YTmin(floor(q × M / T), remaining)

For a positive fill amount, the payment in taker asset base units is ceil(T × amount / M). Set an explicit maximum payment, approve the settlement for the payment token and simulate the fill with the signed extension. A competing fill can reduce the available quantity before execution. Select the entrypoint by the maker’s deployed code.

MakerEntrypoint
EOAfillOrderArgs, using the compact EIP-2098 signature.
Contract walletfillContractOrderArgs, passing the original ERC-1271 signature bytes.

A 65-byte signature does not prove that the maker is an EOA. Contract signature validity can change, so verify it again before execution. For non-ECDSA contract signatures, including a Safe's empty 0x, call isValidSignature(orderHash, signature) directly and require 0x1626ba7e; reject failed or reverting reads. A successful preview or simulation does not reserve the order.

Cancel with cancelOrder(makerTraits, orderHash) from the maker on the order's original settlement; on a partially filled order it withdraws what is left. Delisting, API shutdown and allowance revocation do not invalidate the signature. A set bit, or nothing left, only says filled or cancelled: every fill emits OrderFilled(orderHash, remainingAmount), a cancel does not. For a partial order, a matching fill event with zero remaining confirms a full fill. For an all-or-nothing order, a matching fill event in the block where its nonce closed confirms a full fill. To determine how much a cancellation withdrew, read what remained before the closing block and account for earlier fills in that block. If the required block history or logs are unavailable, leave the outcome unknown.

API reference

The OTC and RFQ HTTP API defines the signed envelopes, filters, response fields and errors. For maker history, query makerAddress with includeInactive=true and paginate. Recompute historical orders’ hashes using their original chain ID and settlement address so the maker can still identify and cancel outstanding signatures after a deployment changes.

RFQ lifecycle

RFQ signatures use the EIP-712 domain Spectra OTC RFQ, version 1, with the execution chain ID and no verifying contract. They authorize API operations. The quote request wire format gives the exact signed fields and types.

  1. The requester signs QuoteRequest: requester, derivative/quote kinds, requester-side BUY or SELL, underlying, IBT, PT, maturity, derivative amount, recipient Safe addresses, request expiry and salt.
  2. POST its QuoteRequestEnvelope. The API allows up to 16 recipient vaults and 20 open requests per requester per chain. The expiry cannot exceed maturity.
  3. Each vault either signs DeclineQuoteRequest with an authorized operator, or publishes a private order on the opposite side and links it with /rfq/respond. Linking requires no extra signature: the stored vault-signed order proves the offer's authorization.
  4. The requester view includes per-vault PENDING, DECLINED or RESPONDED states and response order envelopes. Validate and fill a response through the normal order flow.

The response must match the market and derivative/quote kinds and authorize the requester. Linking does not enforce that its live quantity equals the requested amount; display the actual offer terms before acceptance.

For a new market, set request pt to the zero address. The responding curator deploys a PT for the requested IBT. The API accepts maturity from the requested timestamp through 24 hours later to accommodate the factory's relative-duration deployment. Show the resulting maturity to the requester.

CancelQuoteRequest withdraws the request. Cancellation, expiry or filling another response does not invalidate any response order. A declined recipient cannot become responded; an existing response can only be relinked to the same order.

Safe makers

The Safe must be the order’s maker. Verify the signed fields and extension, then execute an authorized DELEGATECALL to signOrder(Order) on the configured orderSigner. Plan the token approval and signing as separate actions. Once signing has executed, call isValidSignature(orderHash, signature) on the Safe and require 0x1626ba7e before publishing.

The per-market signing permission restricts the maker, receiver, asset pairs, maker traits and signer target. The vault needs a grant for the chosen fill policy. Check the getter, rate payload and any authorized-taker list independently because the signer receives only the order tuple. Token allowances determine how much the settlement can spend.

The current curator interface fills EOA-made orders only. Safe-made offers can be taken through the retail app's contract-maker path. A Safe-made partial order checks its ERC-1271 signature on the first fill only: cancel it to stop further fills. Batch fills and tokenization during a fill are outside this OTC flow.

On this page