API Flows
Strategy Created
Paradigm creates Strategies, comprised of one or more Instruments.
- Subscribed to
strategy_state.{venue}.{kind}WS Channel. - Receives WS messages with
state==ACTIVE.
Strategy Settled
Upon a Strategy Instrument’s expiration, the underlying venue settles the contract.
- Subscribed to
strategy_state.{venue}.{kind}WS Channel. - Receives WS messages with
state==SETTLED.
Strategy Expired
Paradigm may choose to expire a Strategy from being available to trade.
- Subscribed to
strategy_state.{venue}.{kind}WS Channel. - Receives WS messages with
state==EXPIRED.
End to End Trade
For a Trade to occur, two Orders must cross upon a Strategy’s Order Book.
From the WS Channel orders.{venue}.{kind}.{strategy_id}, the state key indicates if the Order has reached finality. If state == OPEN, then the Order still has available amount which can be actioned by the creator or another user. If state == CLOSED, the Order no longer has any actions available by the creator or another user. If state == CLOSED, the Order will be either canceled, pending clearing & settlement on the underlying venue or has already reached finality at clearing.
You should closely follow the values from the following keys amount, pending_fill_amount, filled_amount, canceled_amount.
User’s Order State
- Subscribed to
orders.{venue}.{kind}.{strategy_id}WS Channel. - Taker submits a crossing Order and receives WS message with
state==OPEN. - If the Order is consumed in entirety, the user(s) receives a message with
state==CLOSED.
User’s Trade State
- Subscribed to
trades.{venue}.{kind}.{strategy_id}WS Channel. - An executed Trade reaches finality after clearing & settlement on the underlying exchange. Receives a WS Message with
state==FILLEDfor successfully cleared trades,state==REJECTEDfor unsuccessful trade clearing.
