Sending a Quote
Sending a quote is a core action on the SYMM platform. It lets PartyA signal an intent to trade by submitting a detailed quote request. For the quote to be accepted and opened by a hedger (PartyB), follow the steps below and provide accurate parameters. Debugging is harder when the call is forwarded through the AccountLayer's _call, since the transaction can fail for a number of reasons.
Function signature
function sendQuoteWithAffiliate(
address[] memory partyBsWhiteList,
uint256 symbolId,
PositionType positionType,
OrderType orderType,
uint256 price,
uint256 quantity,
uint256 cva,
uint256 lf,
uint256 partyAmm,
uint256 partyBmm,
uint256 maxFundingRate,
uint256 deadline,
address affiliate,
SingleUpnlAndPriceSig memory upnlSig
) external returns (uint256);Parameter breakdown
partyBsWhiteList[]
An array of PartyB addresses (hedgers/solvers) that PartyA is willing to trade with.
symbolId
The identifier for the trading symbol.
positionType
Enum for the position type:
Use 0 for LONG and 1 for SHORT.
orderType
Enum for the order type:
Use 0 for LIMIT and 1 for MARKET.
price
For a LIMIT order, this is the exact price (in 18 decimals) at which you want to open the position.
For a MARKET order, the executed price includes the spread the solver charges, so you send a price adjusted from the current market price by a slippage buffer (e.g. 5%) to get the quote accepted:
LONG order: increase the price you get from Muon by 5% (the position opens slightly higher to reflect the hedger's spread).
SHORT order: decrease the price you get from Muon by 5% (the position opens slightly lower to reflect the hedger's spread).
quantity
The total order quantity in 18-decimal format. For example, a 5 ETH order is 5e18.
cva, lf, partyAmm, partyBmm
The locked-value parameters: fractions (as percentages) of the notional value that define the risk and margin requirements.
cva: Credit Valuation Adjustment. EitherpartyA(the user) orpartyB(the hedger) can be liquidated, andcvais the penalty the liquidated side pays the other.lf(Liquidator Fee): fee reserved for liquidators.partyAmm(Party A Maintenance Margin): margin required for PartyA.partyBmm(Party B Maintenance Margin): margin required for PartyB.
The general formula for these values:
LockedParam (Wei) = (Notional Value * lockedParam) / (100 * leverage)
Example response:
maxFundingRate
The maximum funding rate PartyA allows, in 18 decimals (usually 200e18).
deadline
A Unix timestamp marking the quote's expiry. Set it far enough in the future for a solver to act.
affiliate
The affiliate address: your registered affiliate address for this frontend, which links the quote to you for fee tracking and routing.
upnlSig
A SingleUpnlAndPriceSig struct that confirms:
reqId: a unique request identifier.timestamp: when the signature was generated.upnl: the unrealized profit and loss for PartyA.price: the verified asset price (in 18 decimals).gatewaySignature: a signature from the trusted gateway.sigs: a Schnorr signature (withsignature,owner, andnoncefields).
Example query:
Script to fetch and format the upnlSig for sendQuoteWithAffiliate, using axios and web3:
Parameter encoding for sendQuoteWithAffiliate
When sending a quote, encode the function call with the Symmio Core ABI before forwarding it through the AccountLayer's _call. This formats the parameters correctly and lets the Diamond delegate the call to the right facet.
The transaction payload before encoding should look like this:
Steps to encode and send a quote:
Encode the function call. Use Web3's ABI encoding to turn the
sendQuoteWithAffiliatecall into a byte string:sendQuoteWithAffiliateFunctionAbi: the ABI definition for
sendQuoteWithAffiliate.sendQuoteParameters: an array of all parameters in the order defined by the function signature.
Prepare the call data. The AccountLayer's
_call()method expects the SubAccount address and an array containing your encoded call:Send the transaction. Forward the encoded call through the AccountLayer:
Finding the quote ID
Once you send a quote with sendQuoteWithAffiliate(), the system emits a SendQuote event. It confirms the quote was submitted and carries a unique identifier (the quoteId) plus key details. The event is defined as:
Use this ID to track and query the quote later with getQuote().
Last updated

