On this page

latest contributor to this doc

Last Edit:

@smk762↗

Swap Common Structures

structuresswaps_common_structures

There are a variety if swap events which may occur during a trade. See Maker Events and Taker Events for more info.

ParameterTypeRequiredDescription
typestring✓See Maker Events and Taker Events for more info.
datavaries✓The data field may contain contextual information (e.g. txids) releated to a swap event. In some cases, it will be null.

For each step of a trade, a SwapEvent will be created, alongside the timestamp of the event. See Maker Events and Taker Events for more info.

ParameterTypeRequiredDescription
timestampinteger✓Timestamp for the SwapEvent in UNIX format.
eventobject✓A standard SwapEvent object.

Each swap status will be nested under its associated UUID.

ParameterTypeRequiredDefaultDescription
typestring✓-Maker or Taker. Indicates if the user created the order (maker), or matched with an existing order (taker).
uuidstring✓-A unique identifier for the swap.
eventslist✓-A list of swap events. The structure of each event varies depending on its type, as detailed in the SwapEvents section.
maker_coinstring✓-The coin being sent by the maker and received by the taker.
taker_coinstring✓-The coin being sent by the taker and received by the maker.
maker_amountnumeric string✓-The amount of maker_coin being traded.
taker_amountnumeric string✓-The amount of taker_coin being traded.
guistring✗nullAn identifier for the GUI used to initiate the swap, as defined in your MM2.json file.
mm_versionstring✓-The release version and/or commit hash of the Komodo DeFi SDK used to initiate the swap.
success_eventslist✓-A list of possible swap event types for a successful swap, for makers and takers.
error_eventslist✓-A list of possible swap event types which may appear in a failed swap, for makers and takers.