Finance-GDAX-API

 view release on metacpan or  search on metacpan

lib/Finance/GDAX/API/Order.pm  view on Meta::CPAN


[optional] Order ID selected by you to identify your order

The optional client_oid field must be a UUID generated by your trading
application. This field value will be broadcast in the public feed for
received messages. You can use this field to identify your orders in
the public feed.

The client_oid is different than the server-assigned order id. If you
are consuming the public feed and see a received message with your
client_oid, you should record the server-assigned order_id as it will
be used for future order status updates. The client_oid will NOT be
used after the received message is sent.

The server-assigned order id is also returned as the id field to this
HTTP POST request.

=head2 C<type>

[optional] limit, market, or stop (default is limit)

limit orders are both the default and basic order type. A limit order
requires specifying a price and size. The size is the number of
bitcoin to buy or sell, and the price is the price per bitcoin. The
limit order will be filled at the price specified or better. A sell
order can be filled at the specified price per bitcoin or a higher
price per bitcoin and a buy order can be filled at the specified price
or a lower price depending on market conditions. If market conditions
cannot fill the limit order immediately, then the limit order will
become part of the open order book until filled by another incoming
order or canceled by the user.

market orders differ from limit orders in that they provide no pricing
guarantees. They however do provide a way to buy or sell specific
amounts of bitcoin or fiat without having to specify the price. Market
orders execute immediately and no part of the market order will go on
the open order book. Market orders are always considered takers and
incur taker fees. When placing a market order you can specify funds
and/or size. Funds will limit how much of your quote currency account
balance is used and size will limit the bitcoin amount transacted.

stop orders become active and wait to trigger based on the movement of
the last trade price. There are two types of stop orders, sell stop
and buy stop.

=head2 C<side>

buy or sell

side: 'sell': Place a sell stop order, which triggers when the last
trade price changes to a value at or below the price.

side: 'buy': Place a buy stop order, which triggers when the last
trade price changes to a value at or above price.

=head2 C<product_id>

A valid product id

The product_id must match a valid product. The products list is
available via the /products endpoint.

=head2 C<stp>

[optional] Self-trade prevention flag

Self-trading is not allowed on GDAX. Two orders from the same user
will not be allowed to match with one another. To change the
self-trade behavior, specify the stp flag.

  Flag 	Name
  dc 	Decrease and Cancel (default)
  co 	Cancel oldest
  cn 	Cancel newest
  cb 	Cancel both

=head1 ATTRIBUTES (limit orders)

=head2 C<price>

Price per bitcoin

The price must be specified in quote_increment product units. The
quote increment is the smallest unit of price. For the BTC-USD
product, the quote increment is 0.01 or 1 penny. Prices less than 1
penny will not be accepted, and no fractional penny prices will be
accepted. Not required for market orders.

=head2 C<size>

Amount of BTC to buy or sell

The size must be greater than the base_min_size for the product and no
larger than the base_max_size. The size can be in any increment of the
base currency (BTC for the BTC-USD product), which includes satoshi
units. size indicates the amount of BTC (or base currency) to buy or
sell.

=head2 C<time_in_force>

[optional] GTC, GTT, IOC, or FOK (default is GTC)

=head2 C<cancel_after>

[optional] min, hour, day

Requires time_in_force to be GTT

Time in force policies provide guarantees about the lifetime of an
order. There are four policies: good till canceled GTC, good till time
GTT, immediate or cancel IOC, and fill or kill FOK.

GTC Good till canceled orders remain open on the book until
canceled. This is the default behavior if no policy is specified.

GTT Good till time orders remain open on the book until canceled or
the allotted cancel_after is depleted on the matching engine. GTT
orders are guaranteed to cancel before any other order is processed
after the cancel_after timestamp which is returned by the API. A day
is considered 24 hours.



( run in 0.812 second using v1.01-cache-2.11-cpan-39bf76dae61 )