Skip to content

Commit

Permalink
transfering MMP done right
Browse files Browse the repository at this point in the history
  • Loading branch information
pinhopro committed Apr 28, 2015
1 parent 62150a3 commit f6b8cb9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions apps/trade/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down

0 comments on commit f6b8cb9

Please sign in to comment.