Closing A Quote
Closing a quote is a critical step for Party A to exit an open position. The process involves sending a close request that specifies which portion of the position to close, at what price, and by when. Similar to sending a quote, you must encode your function call with the SYMM Diamond’s ABI and forward it via your MultiAccount contract.
Function Signature
Parameter Breakdown
quoteId
quoteId
The unique identifier of the quote that you want to close.
closePrice
closePrice
For LIMIT orders:
This is the exact price (in 18 decimals) at which you wish to open the position.
For MARKET orders:
The price a quote is opened at includes the spread that a solver charges. In order for your MARKET quote to be accepted, you should send an price slightly adjusted from the current market price depending on the position type. This is an adjusted price includes a slippage buffer (e.g., 5%).
For LIMIT orders: This is the price at which you wish to close the position, expressed in 18 decimals. Important: If you are using a MARKET order (where a slippage buffer is applied), you must adjust the closePrice accordingly.
For a LONG position, increase the current market price by your chosen slippage percentage. (e.g. 5%)
For a SHORT position, decrease the market price by that percentage. (e.g. 5%)
This adjusted price accounts for the hedger’s spread and ensures that your close request can be accepted.
quantityToClose
quantityToClose
The amount of the position (in 18‑decimal format) that you want to close.
orderType
orderType
An enum value indicating the type of closing order:
0
for LIMIT orders1
for MARKET orders
deadline
deadline
A Unix timestamp by which the close request must be executed. If no action is taken by this time, .
Parameter Encoding
All function calls must be encoded using the SYMM Diamond’s ABI. For closing a quote, you must encode the parameters for the requestToClosePosition()
function and pass the resulting calldata to your MultiAccount contract’s _call()
method. For example:
Last updated