Request for Quote (RFQ)
Create RFQ
Ask liquidity providers for an executable price on a size
POST
/
orderbooks
/
stocks
/
api
/
rfq
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/rfq" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: rfq-2025-06-15-0001" \
-d '{
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"expiryMs": 30000
}'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/rfq',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID()
},
body: JSON.stringify({
requesterAddress: await wallet.getAddress(),
baseToken,
quoteToken,
custodyContract,
side: 'BUY',
baseAmount: '250000000'
})
}
);
const { data } = await res.json();
// poll GET /rfq/{id}/quotes until expiresAt
{
"success": true,
"data": {
"id": "clx_rfq_0091",
"instanceId": "inst_abc123",
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"status": "PENDING",
"expiresAt": "2025-06-15T12:00:30.000Z",
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
Opens a request for quote. Instead of resting on the book, you name a pair, a side and a size, and registered liquidity providers respond with executable prices. Use it for sizes the visible book cannot absorb without moving.
An RFQ is addressed by custody contract and token pair, not by order book ID. Providers subscribed to that pair are notified immediately over the venue’s real-time channel. If a book exists on your instance for the same triple, its price reference is used to validate quotes.
RFQs are short-lived by design: a quote is only executable while the provider’s funds are still committed to it.
Lifecycle
An RFQ startsPENDING. It becomes QUOTED when a provider responds, ACCEPTED when you take a quote, CANCELLED when you withdraw it, and EXPIRED when its deadline passes. A background sweeper runs every five seconds and expires stale requests and quotes, releasing the funds each had committed.
Providers quote from the Trusset issuer application rather than through this API surface, and quoting is gated on a provider being configured to respond to RFQs.
Idempotency
Accepts an optionalIdempotency-Key header. A repeat with the same key and body replays the original response rather than opening a second request.
Body Parameters
string
required
Wallet asking for the quote. Only this address may accept or cancel the resulting RFQ.
string
required
Token you want to buy or sell.
string
required
Settlement token (stablecoin).
string
required
Custody contract the trade would settle through. Together with the two token addresses this is what providers subscribe to.
string
required
BUY or SELL, from the requester’s point of view.string
required
Size in order book units, as a digit-only string. Must be greater than zero.
integer
default:"30000"
How long the request stays open, in milliseconds. Clamped to between 5000 and 60000.
Response Fields
Returns201.
object
Show child attributes
Show child attributes
string
RFQ ID. Use it on every other RFQ endpoint.
string
Your instance.
string
Requesting wallet, lower-cased.
string
Base token, lower-cased.
string
Quote token, lower-cased.
string
Custody contract, lower-cased.
string
BUY or SELL.string
Requested size in order book units.
string
PENDING.string
ISO 8601 deadline.
string
ISO 8601 timestamp.
string
ISO 8601 timestamp.
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/rfq" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: rfq-2025-06-15-0001" \
-d '{
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"expiryMs": 30000
}'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/rfq',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID()
},
body: JSON.stringify({
requesterAddress: await wallet.getAddress(),
baseToken,
quoteToken,
custodyContract,
side: 'BUY',
baseAmount: '250000000'
})
}
);
const { data } = await res.json();
// poll GET /rfq/{id}/quotes until expiresAt
{
"success": true,
"data": {
"id": "clx_rfq_0091",
"instanceId": "inst_abc123",
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"status": "PENDING",
"expiresAt": "2025-06-15T12:00:30.000Z",
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | A field failed schema validation |
INVALID_PARAM | 400 | A required address is missing, side is not BUY or SELL, or baseAmount is not positive |
INSTANCE_REQUIRED | 400 | The request carried no resolvable instance |
IDEMPOTENCY_MISMATCH | 409 | The key was used before with a different body |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/rfq" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: rfq-2025-06-15-0001" \
-d '{
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"expiryMs": 30000
}'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/rfq',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID()
},
body: JSON.stringify({
requesterAddress: await wallet.getAddress(),
baseToken,
quoteToken,
custodyContract,
side: 'BUY',
baseAmount: '250000000'
})
}
);
const { data } = await res.json();
// poll GET /rfq/{id}/quotes until expiresAt
{
"success": true,
"data": {
"id": "clx_rfq_0091",
"instanceId": "inst_abc123",
"requesterAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
"baseToken": "0x51f2b9d0e77c4a1b83ce6d4a9271e5f3a0c8b912",
"quoteToken": "0x98ad0ca091552e23c564b41c74282e5343d03e8a",
"custodyContract": "0x98c33b10823172e62a31d6048773df1054c4f821",
"side": "BUY",
"baseAmount": "250000000",
"status": "PENDING",
"expiresAt": "2025-06-15T12:00:30.000Z",
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
