From f6b8cb9da6efefdb754335c19f79fb3f2c3dac81 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Tue, 28 Apr 2015 08:06:23 -0700 Subject: [PATCH] transfering MMP done right --- apps/trade/models.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/trade/models.py b/apps/trade/models.py index 62a0070..92beb78 100644 --- a/apps/trade/models.py +++ b/apps/trade/models.py @@ -1260,16 +1260,20 @@ def award_market_maker_points(session, trade_id, broker_id, broker_username, mar # from who is taking the order to who is making the market based on the broker fees. elif order.is_from_market_maker and counter_order.is_from_market_maker and broker_fee > 0: market_maker_points = int(total_value * broker_fee / 10000.) - award_market_maker_points(session, - trade_id, - order.account_id, - order.broker_username, - counter_order.account_id, - counter_order.account_username, - symbol, - market_maker_points, - timestamp) - + Ledger.transfer(session, + order.account_id, + order.account_username, + order.broker_id, + order.broker_username, + counter_order.account_id, + counter_order.account_username, + counter_order.broker_id, + counter_order.broker_username, + 'MMP.' + symbol, + market_maker_points, + trade_id, + 'P', + timestamp)