ccxt: ByBit Order output cost and amount are the wrong way around

MUST READ THIS BEFORE SUBMITTING ISSUES (read the links, then delete this message before submitting):

https://github.com/ccxt/ccxt/blob/master/FAQ https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue

Make sure your local version of CCXT is up to date. Check by comparing the output of ccxt.version to https://github.com/ccxt/ccxt/blob/master/package.json#L3

  • OS:
  • Programming Language version: Node ^13
  • CCXT version: ^1.26.45

image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Totally understand you can ignore that

appreciate it thanks, on other small thing could you have the average populated by the last_exec_price as its null and I have example of market orders and I have to go into the info object to get it. happy to provide an example

@kroitor I think this commit should reverted too, Its going to make it too difficult for users to calculate held contract amounts which is whats more important. appreciate you spending time on this however I feel it will be better to wait for you guys to unify it properly.

Sure, this is from our DB, assumed you had this stuff mocked already

{
	"id" : "6eb36683-31bf-53b5-8d46-44dabe1bb965",
	"info" : {
		"closed_size" : NumberInt(0),
		"cross_seq" : NumberInt(1485728806),
		"exec_fee" : "-0.00000029",
		"exec_id" : "6eb36683-31bf-53b5-8d46-44dabe1bb965",
		"exec_price" : "8375.5",
		"exec_qty" : NumberInt(10),
		"exec_time" : "1588176071.426471",
		"exec_type" : "Trade",
		"exec_value" : "0.00119395",
		"fee_rate" : "-0.00025",
		"last_liquidity_ind" : "AddedLiquidity",
		"leaves_qty" : NumberInt(0),
		"nth_fill" : NumberInt(7),
		"order_id" : "d48d7b62-b48f-4ea4-a862-5e5f7dc4a248",
		"order_link_id" : "",
		"order_price" : "8375.5",
		"order_qty" : NumberInt(10),
		"order_type" : "Limit",
		"side" : "Buy",
		"symbol" : "BTCUSD",
		"trade_time_ms" : 1588176071426,
		"user_id" : NumberInt(599946)
	},
	"timestamp" : 1588176071426,
	"datetime" : "2020-04-29T16:01:11.426Z",
	"symbol" : "BTC/USD",
	"order" : "d48d7b62-b48f-4ea4-a862-5e5f7dc4a248",
	"type" : "limit",
	"side" : "buy",
	"takerOrMaker" : "maker",
	"price" : 8375.5,
	"amount" : NumberInt(10),
	"cost" : 0.00119395,
	"fee" : {
		"cost" : -2.9e-7,
		"currency" : "BTC",
		"rate" : -0.00025
	}
}```