frontend-monorepo
frontend-monorepo copied to clipboard
Changes to fees & referral page to support new fee model
The Chore
The Suzuka Castle release will introduce a new fee mechanism in Core.
Fee page
- [ ] One card shoudl just show the network fees, including the new treasury and buyback components, all these come from the network params and are easy
- [ ] Maker rebate info
- [ ] Current tier shoudl come from
partyDiscountStats
- [ ] #7013
- [ ] Volume to next tier find the fraction needed for teh next
minimumPartyMakerVolumeFraction
oncurrentVolumeRebateProgram
and show the gap in % to get there
- [ ] Current tier shoudl come from
- [ ] Taker volume discount
- [ ] Current tier shoudl come from
partyDiscountStats
- [ ] Current volume shuld come from
runningVolume
onvolumeDiscountStats
for the current epoch - [ ] Volume to next tier find the volume needed fro the next
minimumRunningNotionalTakerVolume
up oncurrentVolumeDiscountProgram
and show the gap to get there
- [ ] Current tier shoudl come from
- [ ] Referral discount
- [ ] Current tier shoudl come from
partyDiscountStats
- [ ] Current running volume shoudl come from
referralSetRunningNotionalTakerVolume
onreferralSetStats
- [ ] You may be able to do this simply by adding a partyId
- [ ] Or maybe you need to first query
referralSetReferees
forreferee
=partyId
to find thereferralSetId
.. then use that - [ ] We will need to set up some tests to check this because I think the referrer doesnt get the discount but the referee does, so we need to make sure we're showing the right info
- [ ] Volume to next tier find the volume needed for the next tier up on
currentReferralProgram
and show the gap to get there
- [ ] Current tier shoudl come from
- [ ] Next section should be the fees by market which now focuses on the below and SHOULD all be available on the new
partyDiscountStats
API- [ ] Show
discountedTakerFee
as "Taker fee" - [ ] Show
undiscountedTakerFee - discountedTakerFee / undiscountedTakerFee
in brackets - [ ] Show
baseMakerFee + userMakerRebate
as "Maker rebate" - [ ] Show
userMakerRebate
in brackets
- [ ] Show
- [ ] Show the full grids of the programs for use as reference, likely these will need to move to just stacked on top of each other since they are too large now, also probably remove the colours as these are now not the focus
- [ ] We're basically just goiing to be showing the full content of the APIs for
- [ ] Taker volume discount (currentVolumeDiscountProgram)
- [ ] Referral program (currentReferralProgram)
- [ ] Maker rebate boost (currentVolumeRebateProgram)
Example of voume
{
"data": {
"currentVolumeDiscountProgram": {
"id": "ee5481ca6eec3b3dc2ff1c60e09589856998e54ff0f6de38ade1f530995374fd",
"windowLength": 1,
"version": 1,
"endOfProgramTimestamp": "2024-10-01T17:31:32Z",
"endedAt": null,
"benefitTiers": [
{
"minimumRunningNotionalTakerVolume": "10",
"tierNumber": 1,
"volumeDiscountFactors": {
"infrastructureFactor": "0.01",
"makerFactor": "0.01",
"liquidityFactor": "0.01"
}
},
{
"minimumRunningNotionalTakerVolume": "100",
"tierNumber": 2,
"volumeDiscountFactors": {
"infrastructureFactor": "0.015",
"makerFactor": "0.015",
"liquidityFactor": "0.015"
}
},
{
"minimumRunningNotionalTakerVolume": "1000",
"tierNumber": 3,
"volumeDiscountFactors": {
"infrastructureFactor": "0.021",
"makerFactor": "0.021",
"liquidityFactor": "0.021"
}
},
{
"minimumRunningNotionalTakerVolume": "10000",
"tierNumber": 4,
"volumeDiscountFactors": {
"infrastructureFactor": "0.031",
"makerFactor": "0.031",
"liquidityFactor": "0.031"
}
}
]
}
}
}
Referral page
- [ ] Make the same changes to the referral tiers table as were done above
Additional details / background info
Spec PR
https://github.com/vegaprotocol/specs/pull/2293
Core ticket for the maker rebate boost tier
https://github.com/vegaprotocol/vega/issues/11530
Core ticket to update existing referral / volume discount program APIs
https://github.com/vegaprotocol/vega/issues/11531
Party Discount Stats output
query feesByMarket {
partyDiscountStats(partyId:"89fd87b86727fa4d9ab06b9f4e64b51c9b07055e8a0c8f0bc40f0a249e321525"){
volumeDiscountTier
volumeRebateTier
referralDiscountTier
partyMarketFees{
marketId
undiscountedTakerFee
discountedTakerFee
baseMakerFee
userMakerRebate
}
}
}