-
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
5cb185d
commit ffde128
Showing
19 changed files
with
1,527 additions
and
1,192 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
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,49 @@ | ||
package entities | ||
|
||
import ( | ||
"time" | ||
|
||
eventspb "code.vegaprotocol.io/vega/protos/vega/events/v1" | ||
) | ||
|
||
type FeesStats struct { | ||
MarketID MarketID | ||
AssetID AssetID | ||
EpochSeq uint64 | ||
TotalRewardsPaid []*eventspb.PartyAmount | ||
ReferrerRewardsGenerated []*eventspb.ReferrerRewardsGenerated | ||
RefereesDiscountApplied []*eventspb.PartyAmount | ||
VolumeDiscountApplied []*eventspb.PartyAmount | ||
TotalMakerFeesReceived []*eventspb.PartyAmount | ||
MakerFeesGenerated []*eventspb.MakerFeesGenerated | ||
VegaTime time.Time | ||
} | ||
|
||
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.