File Coverage

blib/lib/App/cryp/Role/ArbitStrategy.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package App::cryp::Role::ArbitStrategy;
2              
3             our $DATE = '2018-11-29'; # DATE
4             our $VERSION = '0.008'; # VERSION
5              
6 1     1   547 use 5.010001;
  1         4  
7 1     1   7 use strict;
  1         1  
  1         23  
8 1     1   4 use warnings;
  1         2  
  1         25  
9              
10 1     1   6 use Role::Tiny;
  1         2  
  1         15  
11              
12             requires qw(
13             calculate_order_pairs
14             );
15              
16             1;
17             # ABSTRACT: Role for arbitration strategy module
18              
19             __END__
20              
21             =pod
22              
23             =encoding UTF-8
24              
25             =head1 NAME
26              
27             App::cryp::Role::ArbitStrategy - Role for arbitration strategy module
28              
29             =head1 VERSION
30              
31             This document describes version 0.008 of App::cryp::Role::ArbitStrategy (from Perl distribution App-cryp-arbit), released on 2018-11-29.
32              
33             =head1 DESCRIPTION
34              
35             An arbitration strategy module is picked by the main arbit module
36             (L<App::cryp::arbit>). It must supply a C<calculate_order_pairs> class method.
37             This class method is given some arguments (see L</"calculate_order_pairs"> for
38             more details), and then must return order pairs. The order pairs will be created
39             on the exchanges by the main arbit module.
40              
41             =head1 REQUIRED METHODS
42              
43             =head2 calculate_order_pairs
44              
45             Usage:
46              
47             __PACKAGE__->calculate_order_pairs(%args) => [$status, $reason, $payload, \%resmeta]
48              
49             Will be fed these arguments:
50              
51             =over
52              
53             =item * r
54              
55             Hash. The Perinci::CmdLine request hash/stash, which contains many information
56             inside it, for example:
57              
58             $r->{_cryp} # information from the configuration, e.g. exchanges, wallets, masternodes
59             $r->{_stash}
60             {dbh}
61             ...
62              
63             See L<App::cryp::arbit> for more details.
64              
65             =back
66              
67             =head1 INTERNAL NOTES
68              
69             =head1 BUGS
70              
71             Please report all bug reports or feature requests to L<mailto:stevenharyanto@gmail.com>.
72              
73             =head1 SEE ALSO
74              
75             L<App::cryp::arbit>
76              
77             C<App::cryp::arbit::Strategy::*> modules.
78              
79             =head1 AUTHOR
80              
81             perlancar <perlancar@cpan.org>
82              
83             =head1 COPYRIGHT AND LICENSE
84              
85             This software is copyright (c) 2018 by perlancar@cpan.org.
86              
87             This is free software; you can redistribute it and/or modify it under
88             the same terms as the Perl 5 programming language system itself.
89              
90             =cut