Feed 'L' - Counterparty limits
Counterparty limits feed
Last updated
Counterparty limits feed
Last updated
Requests
{"event": "bind", "feed": "L"}
{"event": "unbind", "feed": "L"}
Feed handling
limit = [
0: counterpartyId (Efx::ClientId)
1: currencyName (string)
2: grossLimit (Efx::Size)
3: mutualLimitCurrencyName (string | null)
4: mutualGrossLimit (Efx::Size | null)
5: grossLimitUtilization (Efx::Size)
6: maintenanceMargin (unsigned int32)
7: restrictedTrading (unsigned int32)
8: initialMargin (unsigned int32)
9: equity (Efx::Size)
10: takerMarkup (int32)
11: tradingDisabledFlags (int32) // flags & 1 = disabled by client,
// flags & 2 = disabled by counterparty
]
For detailed counterparty limit description
// snapshot
['L', 0, 'S', array of limit]
// limit added
['L', 0, '+', limit]
// limit modified
['L', 0, 'M', limit]
// limit removed
['L', 0, '-', limit]
// failed to subscribe
['L', 0, 'Z', 2]
// unsubscribed
['L', 0, 'U', 0]
applyToSnapshot(prevSnapshot, feed, action, data) {
switch (feed) {
case 'L': {
switch (action) {
case 'S': {
return [...data]
}
case '+': {
prevSnapshot.push(data)
break
}
case 'M': {
for (var i in prevSnapshot) {
// Update limit for counterparty
if (prevSnapshot[i][6] == data[6]) {
prevSnapshot[i] = data
break
}
}
break
}
case '-': {
for (var i in prevSnapshot) {
// Delete limit for counterparty
if (prevSnapshot[i][6] == data[6]) {
prevSnapshot.splice(i, 1)
break
}
}
break
}
}
break
}
}
return prevSnapshot
}