protocol/order: adds additional fields for trading requirements (#1552)

* Add in initial handling for quote/base currency deployment requirements

* include client order ID checking

* glorious: suggestions

* spell and fix

* linter/context/test

* rework tests and order side specific requirements

* linter

* mend panic at the disco

* mending more panics at the disco

* anudda fix brudda

* glorious: NITTTTTT BOOOOOMB

* leftover things and stuff

* whoops

* tie in gateio

* glorious: nit fixes life and everything.

* thrasher: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2024-07-03 16:07:23 +10:00
committed by GitHub
parent b7a2f617d9
commit 48349bc3bb
35 changed files with 210 additions and 77 deletions

View File

@@ -50,3 +50,22 @@ type Features struct {
// types instead of just being denoted as spot holdings.
HasAssetTypeAccountSegregation bool `json:"hasAssetTypeAccountSegregation,omitempty"`
}
// TradingRequirements defines the requirements for trading on the exchange.
type TradingRequirements struct {
// SpotMarketOrderAmountPurchaseQuotationOnly requires the amount to be in
// quote currency or what is to be sold for when you purchase base currency.
// For example, long BTC-USD, the quotation amount is USD.
// NOTE: Due to an exchange's matching engine process, the base amount
// acquired may vary from what is intended due to price fluctuations and
// liquidity on the books. Care must be taken when implementing a market
// neutral strategy.
SpotMarketOrderAmountPurchaseQuotationOnly bool
// SpotMarketOrderAmountSellBaseOnly requires the amount to be in the
// base currency or what is intended to be purchased. For example, short
// BTC-USD, the base amount is BTC.
SpotMarketOrderAmountSellBaseOnly bool
// ClientOrderID is a unique identifier for the order that is generated by
// the client and is required for order submission.
ClientOrderID bool
}