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 = '2021-05-26'; # DATE
4             our $VERSION = '0.010'; # VERSION
5              
6 1     1   602 use 5.010001;
  1         3  
7 1     1   4 use strict;
  1         2  
  1         19  
8 1     1   4 use warnings;
  1         2  
  1         28  
9              
10 1     1   14 use Role::Tiny;
  1         3  
  1         6  
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.010 of App::cryp::Role::ArbitStrategy (from Perl distribution App-cryp-arbit), released on 2021-05-26.
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 HOMEPAGE
70              
71             Please visit the project's homepage at L<https://metacpan.org/release/App-cryp-arbit>.
72              
73             =head1 SOURCE
74              
75             Source repository is at L<https://github.com/perlancar/perl-App-cryp-arbit>.
76              
77             =head1 BUGS
78              
79             Please report any bugs or feature requests on the bugtracker website L<https://github.com/perlancar/perl-App-cryp-arbit/issues>
80              
81             When submitting a bug or request, please include a test-file or a
82             patch to an existing test-file that illustrates the bug or desired
83             feature.
84              
85             =head1 SEE ALSO
86              
87             L<App::cryp::arbit>
88              
89             C<App::cryp::arbit::Strategy::*> modules.
90              
91             =head1 AUTHOR
92              
93             perlancar <perlancar@cpan.org>
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97             This software is copyright (c) 2021, 2018 by perlancar@cpan.org.
98              
99             This is free software; you can redistribute it and/or modify it under
100             the same terms as the Perl 5 programming language system itself.
101              
102             =cut