Skip to content

Commit

Permalink
Only publish last 50 market trades
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgrosner committed Feb 6, 2015
1 parent aa8b600 commit 24e598d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/service/markettrades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Utils = require("./utils");
import momentjs = require('moment');
import Interfaces = require("./interfaces");
import Agent = require("./arbagent");
import _ = require("lodash");

export class MarketTradeBroker implements Interfaces.IMarketTradeBroker {
// TOOD: is this event needed?
Expand All @@ -30,7 +31,7 @@ export class MarketTradeBroker implements Interfaces.IMarketTradeBroker {
private _marketTradePublisher : Messaging.IPublish<Models.MarketTrade>,
private _mdBroker : Interfaces.IMarketDataBroker,
private _quoteGenerator : Agent.QuoteGenerator) {
_marketTradePublisher.registerSnapshot(() => this.marketTrades);
_marketTradePublisher.registerSnapshot(() => _.last(this.marketTrades, 50));
this._mdGateway.MarketTrade.on(this.handleNewMarketTrade);
}
}

0 comments on commit 24e598d

Please sign in to comment.