Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

34
spec/factories/trade.rb Normal file
View File

@@ -0,0 +1,34 @@
# encoding: UTF-8
# frozen_string_literal: true
FactoryBot.define do
factory :trade do
trait :btcusd do
price { '10.0'.to_d }
amount { '1.0'.to_d }
total { price.to_d * amount.to_d }
market { Market.find(:btcusd) }
maker_order { create(:order_ask, :btcusd) }
taker_order { create(:order_bid, :btcusd) }
maker { maker_order.member }
taker { taker_order.member }
end
trait :btceth do
price { '10.0'.to_d }
amount { '1.0'.to_d }
total { price.to_d * amount.to_d }
market { Market.find(:btceth) }
maker_order { create(:order_ask, :btceth) }
taker_order { create(:order_bid, :btceth) }
maker { maker_order.member }
taker { taker_order.member }
end
# Create liability history for orders by passing with_deposit_liability trait.
trait :with_deposit_liability do
maker_order { create(:order_ask, :with_deposit_liability) }
taker_order { create(:order_bid, :with_deposit_liability) }
end
end
end