RFQ Quoting and Execution [Python]
Similar to orderbook trading, RFQs are "self-custodial", and they require signed messages to be settled. Those signed messages guarantee that all legs of an RFQ will execute at the specified prices and amounts, as well as that the fee charged by the orderbook does not exceed the signed max_fee
.
Unlike orderbook trading, makers and takers follow different rules and sign slightly different messages in order to complete an RFQ. The full flow is below:
- [Taker & Maker] Authentication
- [Taker] Send RFQ
- [Maker] Listen or poll for RFQs
- [Maker] In response to an RFQ, sign and send a quote
- [Taker] Poll for the Quotes (market makers' replies to RFQs) and pick the best one
- [Taker] Sign an execute message for the selected quote
The Derive Python Action Signing SDK can be used to help with signing the self-custodial actions as part of the above flow.
For Taker actions (steps 1, 2, 5, 6) refer to the RFQ execute example
For Maker actions (steps 1, 3, 4) refer to the RFQ quote example
Updated 4 days ago