ExOkex.Swap.Private (ExOkex v0.6.0) View Source

Swap account client.

API docs

Link to this section Summary

Functions

Amend multiple open orders for a specific trading pair (up to 10 orders)

Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)

Get the swap account info of all token.

Retrieve the information on all your positions in the swap account.

Retrieve information on your positions of a single contract.

Link to this section Types

Specs

config() :: ExOkex.Config.t()

Specs

instrument_id() :: String.t()

Specs

params() :: map()

Specs

response() :: ExOkex.Api.response()

Link to this section Functions

Link to this function

amend_bulk_orders(instrument_id, params, config \\ nil)

View Source

Specs

amend_bulk_orders(instrument_id(), params(), config() | nil) :: response()

Amend multiple open orders for a specific trading pair (up to 10 orders)

https://www.okex.com/docs/en/#swap-swap---amend_batch

Examples

iex> ExOkex.Futures.Private.amend_bulk_orders("BTC-USD-180213", [ %{amend_data: [

%{order_id: "305512815291895607",new_size: "2"},
%{order_id: "305512815291895606",new_size: "1"}

]})

Link to this function

cancel_orders(instrument_id, order_ids \\ [], params \\ %{}, config \\ nil)

View Source

Cancelling an unfilled order.

https://www.okex.com/docs/en/#swap-swap---revocation

Example

iex> ExOkex.Swap.cancel_orders("BTC-USD-180309", [1600593327162368,1600593327162369])
Link to this function

create_batch_orders(params, config \\ nil)

View Source

See ExOkex.Swap.Private.CreateBulkOrders.create_bulk_orders/2.

Link to this function

create_bulk_orders(params, config \\ nil)

View Source

Specs

create_bulk_orders([params()], config() | nil) :: response()

Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)

https://www.okex.com/docs/en/#swap-swap---batch

Examples

iex> ExOkex.Swap.create_bulk_orders([ %{"instrument_id":"BTC-USD-180213",

"type":"1",
"price":"432.11",
"size":"2",
"match_price":"0",
"leverage":"10" },

])

Link to this function

create_order(params, config \\ nil)

View Source

Specs

create_order(params(), config() | nil) :: response()

Place a new order.

Examples

iex> ExOkex.Swap.create_order(%{ instrument_id: "BTC-USD-180213", leverage: "10", orders_data: [%{

type: "1",
price: "432.11",
size: "2",
match_price: "0"

}] }) {:ok, %{"order_info" => [%{"error_code" => 0, "error_message" => "", "order_id" => "2653481276189696"}], "result" => true}}

Link to this function

list_accounts(config \\ nil)

View Source

Get the swap account info of all token.

https://www.okex.com/docs/en/#swap-singleness

Examples

iex(3)> ExOkex.Swap.list_accounts()
Link to this function

list_positions(config \\ nil)

View Source

Retrieve the information on all your positions in the swap account.

https://www.okex.com/docs/en/#swap-swap---hold_information

Examples

iex(3)> ExOkex.Swap.list_positions()
Link to this function

position(instrument_id, config \\ nil)

View Source

Retrieve information on your positions of a single contract.

https://www.okex.com/docs/en/#swap-swap---only

Examples

iex(3)> ExOkex.Swap.position("BTC-USD-190329")