-
Notifications
You must be signed in to change notification settings - Fork 2
feat: RFQ Workflow #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7bfbedd to
41e632d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds RFQ (Request for Quote) support to the PHP client to enable institutional trading workflows (request/quote, accept, approve, cancel), along with supporting enums and an end-to-end example script.
Changes:
- Introduced a new
RfqCLOB resource with request/quote lifecycle methods. - Added RFQ-related enums for state and sorting (
RfqState,RfqSortBy,RfqSortDir). - Exposed the RFQ resource via
Clob::rfq()and added an RFQ workflow example script.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Resources/Clob/Rfq.php | New RFQ resource implementing request/quote operations via HTTP client. |
| src/Clob.php | Adds rfq() accessor to surface the new RFQ resource from the CLOB client. |
| src/Enums/RfqState.php | Adds RFQ state enum for filtering/state handling. |
| src/Enums/RfqSortBy.php | Adds RFQ sort-by enum for list endpoints. |
| src/Enums/RfqSortDir.php | Adds RFQ sort direction enum for list endpoints. |
| examples/rfq-workflow.php | Demonstrates a full RFQ flow (create, list, quote, accept, approve, cancel). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Create an RFQ request for buying/selling outcome tokens. | ||
| * | ||
| * @param array<string, mixed> $requestData RFQ request data (tokenId, side, size, price, etc.) | ||
| * |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docblocks describe request payload keys using camelCase (e.g., tokenId, requestId), but existing CLOB resources and the README use snake_case keys (e.g., token_id in src/Resources/Clob/Book.php:19). Please update these docblocks to reflect the actual expected parameter names so IDE hints don’t mislead users.
| $response = $this->httpClient->delete("/rfq/quotes/$quoteId"); | ||
|
|
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quote cancellation endpoint uses string interpolation without braces, which is inconsistent with the rest of the codebase’s path construction (e.g., src/Resources/Clob/Orders.php:97). Use "/rfq/quotes/{$quoteId}" for consistency/readability.
| public function rfq(): Rfq | ||
| { | ||
| return new Rfq($this->httpClient); | ||
| } |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new public CLOB resource (rfq()) is introduced, but there are no corresponding Feature tests (the repo has per-resource coverage under tests/Feature/Clob/*Test.php). Please add tests for the new RFQ methods/endpoints (at least happy paths for create/list/cancel request/quote, accept, approve) similar to existing resources’ tests.
| // 6. Approve Order (Market Maker's last look) | ||
| echo "6. Approving Order (Last Look)...\n"; | ||
| try { | ||
| $approval = $client->clob()->rfq()->approveOrder([ | ||
| 'order_id' => 'example-order-id', | ||
| ]); | ||
|
|
||
| echo "Order approved\n"; | ||
| echo "Trade will execute\n\n"; | ||
| } catch (Exception $e) { | ||
| echo "Error approving order: {$e->getMessage()}\n\n"; |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example claims to demonstrate the complete workflow, but the approval step uses a hard-coded order_id (example-order-id), so it will always error in real runs. Consider extracting the created order ID(s) from the acceptQuote() response (if present) and only calling approveOrder() when you have a real order_id, otherwise skip the step with a clear message.
| require_once __DIR__.'/../vendor/autoload.php'; | ||
|
|
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor consistency: other example scripts use spaced concatenation for __DIR__ (e.g., examples/bridge-deposit.php:5 uses __DIR__ . '/../vendor/autoload.php'). Consider matching that formatting here for consistency.
| $response = $this->httpClient->delete("/rfq/requests/$requestId"); | ||
|
|
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String interpolation for the request/quote IDs deviates from the convention used elsewhere in CLOB resources (e.g., src/Resources/Clob/Orders.php:36 uses "/orders/{$orderId}"). Prefer "/rfq/requests/{$requestId}" (and similarly for quotes) to avoid ambiguity and keep style consistent.
41e632d to
96046f4
Compare
This pull request adds full support for the RFQ (Request for Quote) workflow to the codebase, enabling institutional trading features such as negotiated pricing and large order handling. The changes introduce a new
Rfqresource with methods for creating, listing, quoting, accepting, approving, and canceling RFQ requests and quotes. Additionally, relevant enums are added to facilitate sorting and filtering, and an example script demonstrates the complete RFQ workflow.RFQ Workflow Support
Rfqresource class with methods for creating, listing, quoting, accepting, approving, and canceling RFQ requests and quotes (src/Resources/Clob/Rfq.php).rfq()accessor into theClobclass, allowing users to interact with the RFQ resource (src/Clob.php). [1] [2] [3]Enums for RFQ Operations
RfqSortBy,RfqSortDir, andRfqStateenums to support sorting, filtering, and state management in RFQ operations (src/Enums/RfqSortBy.php,src/Enums/RfqSortDir.php,src/Enums/RfqState.php). [1] [2] [3]Documentation and Examples
examples/rfq-workflow.php).