@@ -4,11 +4,12 @@ description: >-
44 Integrate Injective RFQ taker flows into browser apps and operational quote
55 monitors. Use this skill when building, reviewing, or debugging RFQ gateway
66 autosign settlement, Web3Gateway AuthZ setup, manual TakerStream quote
7- collection, RFQ open/close flows, gateway prefetch, optimistic position
8- updates, conditional TP/SL intents, quote uptime probes, market-readiness
9- checks, or mainnet RFQ frontend integrations. Covers mainnet parameters,
10- canonical decimals, quote windows, signer slots, market discovery,
11- quote-hit diagnostics, and production RFQ gotchas.
7+ collection, client-side gateway-style quote selection, RFQ open/close flows,
8+ gateway prefetch, optimistic position updates, conditional TP/SL intents,
9+ quote uptime probes, market-readiness checks, or mainnet RFQ frontend
10+ integrations. Covers mainnet parameters, canonical decimals, quote windows,
11+ signer slots, market discovery, quote-hit diagnostics, and production RFQ
12+ gotchas.
1213license : MIT
1314metadata :
1415 author : ck
@@ -18,9 +19,9 @@ metadata:
1819# Injective RFQ Integrations
1920
2021Use this skill when adding Injective RFQ to a frontend or when building an RFQ
21- quote monitoring tool. Keep the main flow simple: prefer the RFQ gateway for
22- trade settlement, and use manual TakerStream only when you need raw quote
23- diagnostics .
22+ quote monitoring tool. Keep the main flow simple: use the RFQ gateway when you
23+ want managed settlement, and use client-side gateway mode only when the app is
24+ ready to own quote collection, selection, broadcast timing, and reconciliation .
2425
2526## Mainnet Parameters
2627
@@ -42,7 +43,9 @@ EVM chain ID used in EIP-712 domains, Web3Gateway signatures, and
4243
4344## Choose The Path
4445
45- Use the gateway autosign path for production browser trading:
46+ Use the managed gateway autosign path for production browser trading when
47+ latency is acceptable and you want the backend gateway to own quote collection
48+ and settlement assembly:
4649
47501 . Connect an EVM wallet and derive the user's Injective address.
48512 . Create a local ephemeral autosign key for that wallet.
@@ -54,12 +57,44 @@ Use the gateway autosign path for production browser trading:
54577 . Insert both autosign and fee-payer signatures in decoded signer order.
55588 . Broadcast and poll the tx for final reconciliation.
5659
57- Use manual TakerStream only for diagnostics, special routing, quote uptime
58- checks, or latency-sensitive liquidation/arbitrage flows that need maker
59- allowlists/denylists. It exposes ACK/quote timing and raw maker identity; if
60- you accept manually, prefetch account sequence and timeout height before quote
61- collection so the signed accept tx can be broadcast immediately after selecting
62- a quote.
60+ Use client-side gateway mode when the browser needs lower click-time latency or
61+ special quote selection. In that mode, the app is moving gateway/indexer duties
62+ to the client: TakerStream request ownership, ACK mapping, quote collection,
63+ quote selection, accept transaction preparation, per-wallet serialization,
64+ optimistic state, and chain/indexer reconciliation. Read
65+ [ references/client-side-gateway.md] ( ./references/client-side-gateway.md )
66+ before implementing it.
67+
68+ Use manual TakerStream diagnostics when you only need raw quote behavior,
69+ maker identity, or quote uptime checks. Diagnostics should not silently turn
70+ into settlement; settlement requires all client-side gateway responsibilities.
71+
72+ ## Client-Side Gateway Mode
73+
74+ Client-side gateway mode is a latency optimization, not just a transport
75+ choice. The gateway behaves like a coordinator/indexer: it opens RFQs, tracks
76+ ACKs, collects maker quotes, chooses executable quotes, assembles settlement,
77+ and reconciles state. A browser implementation must replace those duties
78+ explicitly instead of only opening a WebSocket.
79+
80+ - Keep one active taker stream owner per wallet/session and reconnect
81+ deliberately on wallet changes.
82+ - Track ` clientId -> rfqId ` ACK replacement. Quotes can arrive before ACK, and
83+ ACK ids may differ from local client ids.
84+ - Use short, bounded collection windows. Start the window from ACK or the first
85+ matching quote, not from arbitrary UI time.
86+ - Sort executable quotes deterministically: lower price is better for long
87+ takers, higher price is better for short takers.
88+ - Validate quote freshness, signed payload fields, maker eligibility, market,
89+ direction, quantity, TTL, chain ids, contract, and worst-price guardrails.
90+ - Prefetch account sequence and timeout height before selection when quote TTLs
91+ are tight. Avoid post-selection RPCs in sub-second paths.
92+ - Serialize accepts per wallet. Parallel accepts can race account sequence even
93+ when they target different markets.
94+ - Treat optimistic position state as provisional until chain/indexer data
95+ confirms it. Roll back cleanly on post-match broadcast or chain failure.
96+ - Keep a managed gateway fallback or recovery path unless the product has
97+ operational monitoring for quote hit rate, maker failures, and stuck state.
6398
6499## Production Rules
65100
@@ -131,6 +166,21 @@ of user-facing states and serialize trade submission:
131166 of the grid. Filtering can resize the target card and make the trading form
132167 feel unstable.
133168
169+ ## Prequote Price Semantics
170+
171+ Separate display prices from RFQ guardrails:
172+
173+ - Button prices should show the best live maker quote when available.
174+ - Fallback display prices can use index price plus or minus the user's
175+ slippage setting, but label them as estimates.
176+ - Prequote RFQ ` worstPrice ` does not have to equal user slippage. A client-side
177+ gateway can use tighter RFQ prequote tiers for quote discovery, then escalate
178+ after misses.
179+ - User slippage still belongs in final submit guardrails and can affect sizing
180+ indirectly when quantity is derived from quote notional.
181+ - Worst price is a guardrail, not an expected execution price. Seeing better
182+ maker quotes than the guardrail is normal.
183+
134184## RFQ Input Rules
135185
136186For open requests, derive quantity from stake, leverage, and mark price:
@@ -258,6 +308,8 @@ editing or canceling a lane, re-query before signing fresh intents.
258308
259309## References
260310
311+ - [ references/client-side-gateway.md] ( ./references/client-side-gateway.md ) : moving
312+ gateway/indexer duties into a browser latency path.
261313- [ references/frontend-rfq-flow.md] ( ./references/frontend-rfq-flow.md ) : gateway vs manual
262314 TakerStream, quote filters, and signer rules.
263315- [ references/authz-and-autosign.md] ( ./references/authz-and-autosign.md ) : Web3Gateway
0 commit comments