-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add maker fees stats to fees stats API
- Loading branch information
1 parent
4db27cd
commit 3bc3236
Showing
15 changed files
with
1,501 additions
and
1,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package entities | ||
|
||
import ( | ||
"time" | ||
|
||
eventspb "code.vegaprotocol.io/vega/protos/vega/events/v1" | ||
) | ||
|
||
func FeesStatsFromProto(proto *eventspb.FeesStats, vegaTime time.Time) *FeesStats { | ||
return &FeesStats{ | ||
MarketID: MarketID(proto.Market), | ||
AssetID: AssetID(proto.Asset), | ||
EpochSeq: proto.EpochSeq, | ||
TotalRewardsPaid: proto.TotalRewardsPaid, | ||
ReferrerRewardsGenerated: proto.ReferrerRewardsGenerated, | ||
RefereesDiscountApplied: proto.RefereesDiscountApplied, | ||
VolumeDiscountApplied: proto.VolumeDiscountApplied, | ||
TotalMakerFeesReceived: proto.TotalMakerFeesReceived, | ||
MakerFeesGenerated: proto.MakerFeesGenerated, | ||
VegaTime: vegaTime, | ||
} | ||
} | ||
|
||
func (stats *FeesStats) ToProto() *eventspb.FeesStats { | ||
return &eventspb.FeesStats{ | ||
Market: stats.MarketID.String(), | ||
Asset: stats.AssetID.String(), | ||
EpochSeq: stats.EpochSeq, | ||
TotalRewardsPaid: stats.TotalRewardsPaid, | ||
ReferrerRewardsGenerated: stats.ReferrerRewardsGenerated, | ||
RefereesDiscountApplied: stats.RefereesDiscountApplied, | ||
VolumeDiscountApplied: stats.VolumeDiscountApplied, | ||
TotalMakerFeesReceived: stats.TotalMakerFeesReceived, | ||
MakerFeesGenerated: stats.MakerFeesGenerated, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.