Skip to main content

Overview

MarketContextMsg describes the DEX pool and protocol used for a token’s market. It appears in:
  • position_opened server events
  • exit_signal_with_tx server events
  • BuildSellTxRequest (optional, to skip server side resolution)
If omitted from a build request, the server resolves the context automatically.

MarketContextMsg Schema

Exactly one of the nested objects should be present, matching the market_type.
The market_type value uses underscores (e.g. pump_fun) while the nested object key does not (e.g. pumpfun). Match the exact casing shown in the tables below.

market_type Values

Nested Context Objects

PumpFunContextMsg

Empty object. Pump.fun bonding curve tokens do not require additional pool context.

PumpSwapContextMsg

MeteoraDbcContextMsg

MeteoraDammV2ContextMsg

RaydiumLaunchpadContextMsg

RaydiumCpmmContextMsg

Passing Market Context in Build Requests

You can include market_context in a BuildSellTxRequest to skip server side pool resolution. This is useful when you already have the context from a position_opened or exit_signal_with_tx event.

TypeScript Type Reference