Skip to content

Commit

Permalink
skip exists orders when create okx spot orders
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-xiong committed Nov 15, 2023
1 parent bd27d99 commit d8c03c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/jobs/get_okx_spot_trades_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def perform(user_id: nil)
OriginTransaction.transaction do
result['data'].each do |d|
next if d['category'] != 'normal'
next if OriginTransaction.exists?(order_id: d['ordId'], user_id: user_id, source: 'okx')
original_symbol = d['instId']
qty = d['accFillSz'].to_f
price = d['avgPx'].to_f
Expand Down
1 change: 1 addition & 0 deletions app/jobs/get_users_spot_transactions_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def get_okx_orders(user_id=nil)
OriginTransaction.transaction do
result['data'].each do |d|
next if d['category'] != 'normal'
next if OriginTransaction.exists?(order_id: d['ordId'], user_id: user_id, source: 'okx')
original_symbol = d['instId']
qty = d['accFillSz'].to_f
price = d['avgPx'].to_f
Expand Down

0 comments on commit d8c03c6

Please sign in to comment.