Creating an order

JavaScript SDK

See Initializing CarbonSDK for details on instantiating the JavaScript SDK.

const msgValue = MsgCreateOrder.fromPartial({
  creator: connectedSDK.wallet.bech32Address,
  market: "swth_eth",
  orderType: OrderModule.OrderType.Limit,
  price: "0.0000171",
  quantity: "109360",
  side: OrderModule.OrderSide.Buy,
});

const txResponse = await connectedSDK.wallet.sendTxs([{
  typeUrl: CarbonTx.Types.MsgCreateOrder,
  value: msgValue,
}]);

Command-line Interface

Use carbond --help for a list of available commands

carbond tx order create-order [market] [side] [quantity] [order-type] [price] [stop-price] [time-in-force] [trigger-type] [post-only] [reduce-only] [flags]
#  note quantity needs to be in unitless form (0.01 SWTH = 1000000)

carbond tx order create-order \
  "swth_eth"\
  "buy"\
  "10000"\
  "limit"\
  "100000"\
  "0"\
  "gtc"\
  ""\
  "false"\
  "false"

Last updated