When a bettor requests a Parlay Market, a message is sent via the parlay_markets:global channel. In order to offer orders on Parlay Markets, you will need to subscribe to this channel. The payload will contain the marketHash associated with the Parlay Market.
You can post orders to this market as you would for any other market using this marketHash. The payload also contains the token and size the bettor is requesting. The legs contain the underlying markets that make up the parlay — query each leg’s marketHash to get current orders for that individual market.
CHANNEL NAME
parlay_markets:global
ParlayMarket PAYLOAD FORMAT
| Name | Type | Description |
|---|
| channelName | string | Legacy field — always "markets:parlay". |
| marketHash | string | The parlay market associated with this request |
| baseToken | string | The token this request is denominated in |
| requestSize | number | The size in baseTokens that the bettor is requesting. See unit conversion. May be absent. |
| legs | ParlayMarketLeg[] | An array of legs that make up the parlay |
ParlayMarketLeg PAYLOAD FORMAT
| Name | Type | Description |
|---|
| marketHash | string | The market for an individual leg within the parlay |
| bettingOutcomeOne | boolean | The side the bettor is betting for this leg |
The requestSize only indicates what the user is requesting and does not limit how much you can offer. You are allowed to offer any size.
// To subscribe
const sub = client.newSubscription("parlay_markets:global");
sub.on("publication", (ctx) => {
const data = ctx.data;
// message handler logic
});
sub.subscribe();
The above returns JSON structured like this:
{
"channelName": "markets:parlay",
"marketHash": "0x3f8893a68554eca5aaee57896505ea345e757b8809e8301b8ad8873a98b1c73b",
"baseToken": "0x1BC6326EA6aF2aB8E4b6Bc83418044B1923b2956",
"legs": [
{
"marketHash": "0x22ed4cf508418f44e787f9c8e79f76eb31587efa20fe700b3582e09f01775944",
"bettingOutcomeOne": false
},
{
"marketHash": "0x186685cf65e1a22952ad42982e1ec75b6a457fa3bdec59fa6f891258a718ddfe",
"bettingOutcomeOne": true
}
]
}