Integration Reference

OTC and RFQ HTTP API

List and publish EVM OTC orders, send signed quote requests and retrieve vault responses.

Use https://api.spectra.finance/v1/{network}/otc as the base URL. The network can be the chain ID or slug for Base, Flare or Katana. Send POST bodies as JSON. For signing, pricing and settlement, see OTC orders and RFQ.

Endpoints

Method and pathRequestSuccessful JSON response
GET /configNo body{ success: true, data: { limitOrderProtocol, rateAmountGetter, authorizedTakersGuard, orderSigner } }. Each field is a contract address on the requested chain.
GET /ordersOptional filters below{ success: true, data: [orderEnvelope, …] }
POST /create{ envelope: orderEnvelope }{ success: true, orderHash }
POST /rfq/create{ envelope: quoteRequestEnvelope }{ success: true, requestHash }
GET /rfq/requestsExactly one of requester or vault (address). For requester history, add includeClosed=true.{ success: true, data: { requests, responseOrders } }
POST /rfq/respond{ requestHash, vault, orderHash } for a published response order made by that vault{ success: true }
POST /rfq/decline{ requestHash, vault, signer, signature }. The signer must be a curator role member, configurator role member or Safe owner.{ success: true }
POST /rfq/cancel{ requestHash, signature } signed by the requester{ success: true }

Order filters

Filter by market (PT address), makerAddress or derivativeKind (0 for PT, 1 for YT). By default the book returns active orders on the current deployment. Pass includeInactive=true to include delisted, expired, closed, temporarily unfillable and superseded-deployment orders. limit defaults to 100 and is capped at 1,000. offset defaults to zero and accepts integers through 9,000.

Order envelope

FieldsJSON typeMeaning
schema, schemaVersion, orderTypestring, number, stringFixed values "spectra-otc", 1 and "RATE".
chainId, settlementAddressnumber, addressSigning chain and settlement contract.
orderHash32-byte hex stringEIP-712 digest of the order in its settlement domain.
orderobjectThe signed fields below.
extension, signaturehex stringsRate-order bytes bound by the salt and the maker’s signature. For publication, send a 65-byte ECDSA signature for an EOA. A contract maker may use ERC-1271 signature bytes up to 1,024 bytes, including 0x when its onchain check accepts it.
authorizedTakersoptional address arrayFor a private order, exactly the takers in its signed extension in the same order.
createdAt, createdAtBlockdecimal stringsCreation time in Unix seconds and creation block number.
metadataoptional objectDisplay information. Read signed terms from the order and extension.

The signed order fields follow the EIP-712 field order and types.

FieldJSON typeMeaning
saltdecimal stringUnsigned 256-bit salt binding the extension.
maker, receiveraddressesAsset owner and receiver override. OTC requires the zero address for the receiver, so payment goes to the maker.
makerAsset, takerAssetaddressesTokens delivered by the maker and taker, respectively.
makingAmount, takingAmountdecimal stringsPositive quantities in the respective assets’ base units. The first is fixed and the second is the creation-time baseline.
makerTraitsdecimal stringUnsigned 256-bit value encoding fill policy, expiry, nonce and extension flags.

A listed order’s metadata can include invalidated, allowsPartialFills, remainingMakingAmount (decimal base units) and outcome (FILLED, CANCELLED or null). Once cancelled, the remaining amount records what the cancellation withdrew. Temporary unfillableReason values are INSUFFICIENT_BALANCE, INSUFFICIENT_ALLOWANCE, SIGNATURE_INVALID and PRICING_UNAVAILABLE. Refresh the price and fillability onchain before submitting a fill.

Quote request envelope

Send schema: "spectra-otc-rfq", schemaVersion: 1, numeric chainId, the 32-byte requestHash, a request object and hex signature. Use a 65-byte signature for an EOA or an ERC-1271 signature of up to 1,024 bytes for a contract requester. Sign these types in the RFQ domain. The hash for a decline or cancellation identifies the original quote request.

QuoteRequest(address requester,uint8 derivativeKind,uint8 quoteKind,string side,address underlying,address ibt,address pt,uint256 maturity,uint256 amount,address[] recipients,uint256 expiry,uint256 salt)
DeclineQuoteRequest(bytes32 requestHash,address vault)
CancelQuoteRequest(bytes32 requestHash)
Request fieldsJSON typeMeaning
requesteraddressAccount asking for quotes.
derivativeKind, quoteKindnumbersDerivative is PT (0) or YT (1). Quote token is underlying (0) or IBT (1).
sidestringBUY or SELL from the requester’s perspective.
underlying, ibt, ptaddressesAssets identifying the market. Use a zero PT to request a new market.
maturity, expirydecimal stringsMarket maturity and request expiry in Unix seconds. Expiry must be in the future and at or before maturity.
amountdecimal stringPositive PT or YT quantity in derivative base units.
recipientsaddress arrayOne to 16 distinct recipient vault Safes.
saltdecimal stringUnsigned 256-bit value distinguishing requests with otherwise identical terms.

Request history and responses

The requester view returns each request as { chainId, requestHash, request, cancelled, createdAt, recipients }. The createdAt field uses Unix seconds as a decimal string. Each recipient is { vault, status, orderHash }, with status PENDING, DECLINED or RESPONDED and a nullable order hash. Match a responded row to its envelope in responseOrders by hash. Verify a signature against the original signed recipient ordering.

The vault view includes only that vault’s recipient row on each open request and returns an empty responseOrders array. Read the vault’s signed orders through GET /orders.

Errors

An error response has success: false and an error message. HTTP 400 indicates an unsupported network, malformed request or invalid filter. HTTP 422 indicates a write that failed a signature, market, authorization or lifecycle check. HTTP 503 indicates the service, required configuration or authority check is unavailable. Publishing an identical accepted order again returns its hash and preserves its current state.

On this page