Stage: PMM Selection & Failure Handling
The SELECT_PMM stage follows after the MPC confirms the deposit. At this point, the Solver chooses the optimal PMM (Professional Market Maker) based on the user's RFQ constraints. If a valid PMM isn't matched before scriptTimeout, the trade is marked as FAILURE.
Key Responsibilities
PMM Selection: Choose a
PMMoffering a valid quote based onminAmountOut.Quote Verification: Confirm the quote is valid and linked to a pre-signed settlement.
Proof Submission: Submit signed data from both parties to validate the trade terms.
Fee Policy Compliance: Ensure fees align with the user's expectations.
Scenarios
Successful PMM Selection:
The protocol validates the PMM's data, locks fees, emits a
SelectedPMMevent, and advances toMAKE_PAYMENT.
No Match/Timeout:
If no PMM is selected within
scriptTimeout, the trade is stalled. It may be marked asFailure, eligible for refund, and no payment occurs.
Function Descriptions
selectPMM(tradeId, info):Executable only by the authorized
Solverthrough theRouter.Validates the stage, timeout, fees, and signatures.
report(tradeId, msgError, signature):Executable only by authorized
MPC Node.The trade transitions to
FAILURE, enabling refunds after timeout.
Refund and Query
Post
SELECT_PMM, query functions track trade status:For Success: Use
getCurrentStageto confirm advancement,getPMMSelectionfor selection data.For Failure: Use
getCurrentStageto confirm failure,getFailureInfofor error details.
Last updated
