RFQ (Request for Quotation) Workflow
Table of Contents
Overview
Timeline
Reserve Price Explained
For BUY Positions (isLong: true)
For SELL Positions (isLong: false)
Reserve Price Calculation Example
Parameter
Value
When Reserve Price is Checked
Option Structures
How the SDK Detects Structure
Vanilla Options (Single Leg)
Spread Options (2 Legs)
Butterfly Options (3 Legs)
Condor Options (4 Legs)
RFQ Parameters Comparison
Parameter
Vanilla
Spread
Butterfly
Condor
Creating Each Structure
Risk/Reward Comparison
Timeline
User Flow Diagram
Sequence of Events
Fund Flow
Summary Table
Step
Actor
Action
Result
Phase 1: User Creates RFQ
What the User Provides
Parameter
Description
Example
Critical: collateralAmount is ALWAYS 0
For BUY Positions (isLong = true)
For SELL Positions (isLong = false)
Phase 2: Market Makers Respond
How MMs Process an RFQ
Offer Calculation
What's Stored On-Chain
Phase 3: Reveal Phase
Timeline
Reveal Process
Winner Selection
Settlement Paths: Early vs Normal
Early Settlement
Normal Settlement
Who Can Call Settlement?
Settlement Type
Who Can Call
When
Why is Normal Settlement Permissionless?
Who Typically Settles?
What if Nobody Settles?
Settlement Paths Comparison
Settlement Flow Diagram
SDK Settlement Methods
Action
Method
When
Who Can Call
Phase 4: Settlement
New Option Creation
Existing Option Transfer
Fee Structure
Collateral Handling
Key Principle: SELLER Always Provides Collateral
RFQ Type
Who is Seller
Who Provides Collateral
Where Collateral is Stored
Collateral Lifecycle
Stage
Action
Where Funds Are
Payout Distribution at Expiry
Scenario
Buyer Receives
Seller Receives
Example: BUY PUT Option Flow
Example: SELL PUT Option Flow
Collateral Amount by Option Type
Option Type
Collateral Formula
Example
Premium vs Collateral
Concept
Who Pays
When
Purpose
Collateral Cost (Opportunity Cost)
Collateral Type
Symbol
APR Rate
Sealed-Bid Auction Mechanism
Why Sealed Bids?
ECDH Encryption Flow
Key Management
Storage Providers
Environment
Default Provider
Persistence
Location
Key Persistence Example
Key Backup Warning
Custom Storage Provider
Encryption Technical Details
ECDH Key Exchange
Nonce Format
Source
Format
Example
Why X-Coordinate (Not Hash)?
Decryption Troubleshooting
Common Issues
1. "KeyNotFoundError: RFQ key not found"
2. "DecryptionError: Invalid ciphertext"
3. "DecryptionError: Authentication failed"
Debugging Decryption
Key Mismatch Prevention
SDK Usage Examples
Creating an RFQ (BUY Position)
Creating an RFQ (SELL Position)
Using buildRFQRequest (Complete Helper)
Creating a Spread RFQ (Complete Example)
Spread vs Vanilla: Key Differences
Aspect
Vanilla
Spread
Strike Ordering (Important!)
Multi-Leg Structures
Common Pitfalls
1. Setting collateralAmount != 0
2. Not Approving Tokens for SELL
3. Reserve Price in Wrong Decimals
4. Expiry Before Offer Deadline
Settlement & Cancellation
Early Settlement
Normal Settlement
Cancellation
Timing Constraints
Action
When
Physically Settled Options (Vanilla Only)
Physical Option Settlement Behavior
Option
Direction
Collateral
At ITM Expiry
Creating a Physical PUT RFQ
Closing Existing Positions
The Precision Problem
Solution: Use BigInt for Exact Precision
Input Type
Behavior
Use Case
Position Closing Example
Key Points for Position Closing
String Input (from API/JSON)
Summary
See Also
Last updated

