mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-01 23:16:51 +00:00
orders/gateio: Add GetTradeAmount method to order.Submit type (#1584)
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -1013,19 +1013,14 @@ func (g *Gateio) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Submi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// When doing spot market orders when purchasing base currency, the
|
||||
// quote currency amount is used. When selling the base currency the
|
||||
// base currency amount is used.
|
||||
tradingAmount := s.Amount
|
||||
if tradingAmount == 0 && s.Type == order.Market {
|
||||
tradingAmount = s.QuoteAmount
|
||||
}
|
||||
|
||||
sOrder, err := g.PlaceSpotOrder(ctx, &CreateOrderRequestData{
|
||||
Side: s.Side.Lower(),
|
||||
Type: s.Type.Lower(),
|
||||
Account: g.assetTypeToString(s.AssetType),
|
||||
Amount: types.Number(tradingAmount),
|
||||
Side: s.Side.Lower(),
|
||||
Type: s.Type.Lower(),
|
||||
Account: g.assetTypeToString(s.AssetType),
|
||||
// When doing spot market orders when purchasing base currency, the
|
||||
// quote currency amount is used. When selling the base currency the
|
||||
// base currency amount is used.
|
||||
Amount: types.Number(s.GetTradeAmount(g.GetTradingRequirements())),
|
||||
Price: types.Number(s.Price),
|
||||
CurrencyPair: s.Pair,
|
||||
Text: s.ClientOrderID,
|
||||
|
||||
Reference in New Issue
Block a user