The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Finance::GDAX::API::Quote - Get a quote from the GDAX

SYNOPSIS

use Finanace::GDAX::API::Quote;
my $quote = Finance::GDAX::API::Quote->new(product => 'BTC-USD')->get;
say $$quote{price};
say $$quote{bid};
say $$quote{ask};

DESCRIPTION

Gets a quote from the GDAX for the specified "product". These quotes do not require GDAX API keys, but they suggesting keeping traffic low.

More detailed information can be retrieve about products and history using API keys with other classes like Finance::GDAX::API::Product

Currently, the supported products are:

BTC-USD
BTC-GBP
BTC-EUR
ETH-BTC
ETH-USD
LTC-BTC
LTC-USD
ETH-EUR

These are not hard-coded, but the default is BTC-USD, so if any are added by GDAX in the future, it should work find if you can find the product code.

Quote is returned as a hashref with the (currently) following keys:

trade_id
price
size
bid
ask
volume
time

ATTRIBUTES

debug (default: 1)

Bool that sets debug mode (will use sandbox). Defaults to true (1). Debug mode does not seem to give real quotes.

product (default: "BTC-USD")

The product code for which to return the quote.

METHODS

get

Returns a quote for the desired product.

AUTHOR

Mark Rushing <mark@orbislumen.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Home Grown Systems, SPC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.