Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to fees & referral page to support new fee model #6684

Open
27 tasks
JonRay15 opened this issue Jul 12, 2024 · 2 comments
Open
27 tasks

Changes to fees & referral page to support new fee model #6684

JonRay15 opened this issue Jul 12, 2024 · 2 comments
Assignees

Comments

@JonRay15
Copy link
Contributor

JonRay15 commented Jul 12, 2024

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
  • Taker volume discount
    • Current tier shoudl come from partyDiscountStats
    • Current volume shuld come from runningVolume on volumeDiscountStats for the current epoch
    • Volume to next tier find the volume needed fro the next minimumRunningNotionalTakerVolume up on currentVolumeDiscountProgram and show the gap to get there
  • Referral discount
    • Current tier shoudl come from partyDiscountStats
    • Current running volume shoudl come from referralSetRunningNotionalTakerVolume on referralSetStats
      • You may be able to do this simply by adding a partyId
      • Or maybe you need to first query referralSetReferees for referee = partyId to find the referralSetId.. 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

image

  • 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

image

  • 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)

image

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

vegaprotocol/specs#2293

Core ticket for the maker rebate boost tier

vegaprotocol/vega#11530

Core ticket to update existing referral / volume discount program APIs

vegaprotocol/vega#11531

Party Discount Stats output

query feesByMarket {
  partyDiscountStats(partyId:"89fd87b86727fa4d9ab06b9f4e64b51c9b07055e8a0c8f0bc40f0a249e321525"){
    volumeDiscountTier
    volumeRebateTier
    referralDiscountTier
    partyMarketFees{
      marketId
      undiscountedTakerFee
      discountedTakerFee
      baseMakerFee
      userMakerRebate
    }
  }
}
@JonRay15 JonRay15 changed the title Support new fee model in all apps Support new fee model in Console Jul 12, 2024
@JonRay15 JonRay15 moved this from New to Backlog in Frontend Engineering Jul 23, 2024
@JonRay15 JonRay15 moved this from Backlog to Todo in Frontend Engineering Aug 5, 2024
@JonRay15 JonRay15 changed the title Support new fee model in Console Changes to fees & referral page to support new fee model Aug 6, 2024
@JonRay15 JonRay15 moved this from Todo to Backlog in Frontend Engineering Aug 6, 2024
@JonRay15 JonRay15 moved this from Backlog to Todo in Frontend Engineering Aug 27, 2024
@JonRay15
Copy link
Contributor Author

JonRay15 commented Sep 3, 2024

Currently blocked by

vegaprotocol/vega#11645

However you could probably still make a start ... its just you will get blocked 100%

@JonRay15
Copy link
Contributor Author

JonRay15 commented Sep 3, 2024

Actually you'll get blocked pretty fast ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants