From afb81056946fec798b6d6c21aafe83c130a039c8 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 14 Mar 2021 10:44:16 +0800 Subject: [PATCH] add reward service todo --- pkg/service/reward.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/service/reward.go b/pkg/service/reward.go index 8d09c8a16..c90f73abb 100644 --- a/pkg/service/reward.go +++ b/pkg/service/reward.go @@ -15,6 +15,10 @@ import ( "github.com/c9s/bbgo/pkg/types" ) +// RewardService collects the reward records from the exchange, +// currently it's only available for MAX exchange. +// TODO: add summary query for calculating the reward amounts +// CREATE VIEW reward_summary_by_years AS SELECT YEAR(created_at) as year, reward_type, currency, SUM(quantity) FROM rewards WHERE reward_type != 'airdrop' GROUP BY YEAR(created_at), reward_type, currency ORDER BY year DESC; type RewardService struct { DB *sqlx.DB }