How Filtering Works
Filtering is completely optional. If you don't specify any filters when you connect, you'll see all your order events: for every symbol, every API session and the UI, every event type.
If you want to filter, it's simple. Filtering works by whitelisting. You can filter on any combination of the following criteria:
- one or more supported symbols
- one or more of your API session keys
- use
UI
as the session key for orders placed through the website
- use
- one or more order event types
- if you don't specify
initial
, you will not receive your active orders at the beginning of the subscription
- if you don't specify
You may create multiple connections, filtered any way you like.
Multiple arguments
To provide a list of arguments, repeat the parameter once for each argument you want to provide:
wss://api.gemini.com/v1/order/events?symbolFilter=btcusd&symbolFilter=ethbtc&eventTypeFilter=initial&eventTypeFilter=fill&eventTypeFilter=closedplain
For example, if you wanted to see all BTCUSD order event types for both API session key t14phVqvAAJlK4YiXmBM
and your web users, you would subscribe to order events using this WebSocket URL:
wss://api.gemini.com/v1/order/events?apiSessionFilter=t14phVqvAAJlK4YiXmBM&&apiSessionFilter=UI&symbolFilter=btcusdplain
You would neither see orders for a different currency nor orders placed by a different API session key than the ones you specified.
Event feed
If you wanted to create a dropcopy-like event feed, to see order fills for all orders associated with your account on all symbols, connect using:
wss://api.gemini.com/v1/order/events?eventTypeFilter=fillplain
Active
To see your active orders, fills, and cancels:
wss://api.gemini.com/v1/order/events?eventTypeFilter=initial&eventTypeFilter=fill&eventTypeFilter=cancelledplain
In general, if you create a custom event type filter, Gemini recommends always including initial
: otherwise, you won't see your active orders when you connect.
You cannot filter out heartbeat events or your subscription acknowledgement.