MCPcopy Create free account
hub / github.com/ccxt/ccxt / create_order

Method create_order

python/ccxt/hyperliquid.py:1938–1963  ·  view source on GitHub ↗

create a trade order https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order :param str symbol: unified symbol of the market to create an order in :param str type: 'market' or 'limit' :param str side: 'buy' or 'se

(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})

Source from the content-addressed store, hash-verified

1936 return response
1937
1938 def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1939 """
1940 create a trade order
1941
1942 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1943
1944 :param str symbol: unified symbol of the market to create an order in
1945 :param str type: 'market' or 'limit'
1946 :param str side: 'buy' or 'sell'
1947 :param float amount: how much of currency you want to trade in units of base currency
1948 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1949 :param dict [params]: extra parameters specific to the exchange API endpoint
1950 :param str [params.timeInForce]: 'Gtc', 'Ioc', 'Alo'
1951 :param bool [params.postOnly]: True or False whether the order is post-only
1952 :param bool [params.reduceOnly]: True or False whether the order is reduce-only
1953 :param float [params.triggerPrice]: The price at which a trigger order is triggered at
1954 :param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
1955 :param str [params.slippage]: the slippage for market order
1956 :param str [params.vaultAddress]: the vault address for order
1957 :param str [params.subAccountAddress]: sub account user address
1958 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
1959 """
1960 self.load_markets()
1961 order, globalParams = self.parse_create_edit_order_args(None, symbol, type, side, amount, price, params)
1962 orders = self.create_orders([order], globalParams)
1963 return orders[0]
1964
1965 def create_twap_order(self, symbol: str, side: OrderSide, amount: float, duration: float, params={}) -> Order:
1966 """

Callers

nothing calls this directly

Calls 3

create_ordersMethod · 0.95
load_marketsMethod · 0.45

Tested by

no test coverage detected