Skip to content

Game details API is showing non-games #10958

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

Closed
JonRay15 opened this issue Mar 20, 2024 · 3 comments · Fixed by #10993
Closed

Game details API is showing non-games #10958

JonRay15 opened this issue Mar 20, 2024 · 3 comments · Fixed by #10993

Comments

@JonRay15
Copy link

Desc

On mainnet there is a transfer defined thus:

{
          "node": {
            "transfer": {
              "id": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
              "gameId": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
              "from": "978de934e67f7dfd318fdd2181442f3a944848af829cdf4c1b6d46fa1b0c87c2",
              "fromAccountType": "ACCOUNT_TYPE_GENERAL",
              "to": "network",
              "toAccountType": "ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES",
              "asset": {
                "id": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
                "symbol": "VEGA"
              },
              "amount": "3333000000000000000000",
              "reference": "reward",
              "status": "STATUS_PENDING",
              "timestamp": "2024-03-12T13:45:25.382446Z",
              "kind": {
                "startEpoch": 852,
                "endEpoch": null,
                "dispatchStrategy": {
                  "dispatchMetric": "DISPATCH_METRIC_LP_FEES_RECEIVED",
                  "dispatchMetricAssetId": "bf1e88d19db4b3ca0d1d5bdb73718a01686b18cf731ca26adedf3c8b83802bba",
                  "marketIdsInScope": [
                    "fc37a1eedb6e57b86823e2fc42480a0b9236aea556c1d7df49be697a93f8f2a0"
                  ],
                  "entityScope": "ENTITY_SCOPE_INDIVIDUALS",
                  "individualScope": "INDIVIDUAL_SCOPE_ALL",
                  "teamScope": null,
                  "nTopPerformers": "",
                  "stakingRequirement": "",
                  "notionalTimeWeightedAveragePositionRequirement": "",
                  "windowLength": 1,
                  "lockPeriod": 0,
                  "distributionStrategy": "DISTRIBUTION_STRATEGY_PRO_RATA",
                  "rankTable": null
                }
              },
              "reason": null
            },
            "fees": [
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 852
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 853
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 854
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 855
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 856
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 857
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 858
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 859
              },
              {
                "transferId": "ab39d208ffe20d2d132ccf6785aabcc563476acaa28f98447991e89ed1d46654",
                "amount": "1000000000000000000",
                "epoch": 860
              }
            ]
          }
        },

So you can see it is LP rewards and is not a game.... not really.

But if you query the game details API you see results for it ... many times ... which obviously is basically just showing the LPs getting rewards.

{
  "data": {
    "games": {
      "edges": [
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 860,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 860,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 859,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 859,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 858,
            "numberOfParticipants": 3,
            "entities": [
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 858,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 857,
            "numberOfParticipants": 1,
            "entities": [
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 857,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 856,
            "numberOfParticipants": 2,
            "entities": [
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 856,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 855,
            "numberOfParticipants": 2,
            "entities": [
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 855,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 854,
            "numberOfParticipants": 2,
            "entities": [
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 854,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 853,
            "numberOfParticipants": 2,
            "entities": [
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 853,
            "numberOfParticipants": 5,
            "entities": [
              {},
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "177116461e3a44a90219450fdb2563430b2dcf2729eb9d1d62574c0bec51508c",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 852,
            "numberOfParticipants": 1,
            "entities": [
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 852,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 851,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        },
        {
          "node": {
            "id": "3cae9181be95e61fdfcaf28610cad31cc7e84632665a087bca596bba51883245",
            "rewardAssetId": "d1984e3d365faa05bcafbe41f50f90e3663ee7c0da22bb1e24b164e9532691b2",
            "epoch": 850,
            "numberOfParticipants": 4,
            "entities": [
              {},
              {},
              {},
              {}
            ]
          }
        }
      ]
    }
  }
}

This seems odd ... not sure it will impact too much at the moment ... because we only navigate to the game results from the team or the game therefore you wont see it ... but it seems odd.

Maybe we currently define ALL rewards with a dispatch strategy as a "game"?

@JonRay15
Copy link
Author

Pretty convinced this is just the fact that all but 3 of our rewards on mainnet predate the games code going to mainnet.

Hence they dont have game IDs and everything falls apart.

If we see things work tonight for the Eigenpoints market I think we close this.

We may consider cancelilng and restarting the othe reward transfers so they get a game ID in case that breaks something unexpected

@EVODelavega
Copy link
Contributor

As mentioned on the slack threads, the game API docs are either wrong, or at best confusing. When specifying from/to epoch parameters, the range of data returned by the API is in fact capped to 30 epochs regarldess of the request parameters specified.

It'd be best to update the docs, perhaps including some examples for clarification:

Let's say the current epoch is 1000

  • Request specifying only FromEpoch:
    • 990: as expected, will only return data for the last 10 epochs
    • 950: will return game data from epochs 950-979
  • Request specifying only ToEpoch:
    • 999: will return data from epochs 970-999 (30 epochs, with 999 being the last one)
    • 900: returns 871-900
  • Request specifying both from and to epoch:
    • any request where from and to are within a 30 epoch range will return the requested data
    • if the range > 30 epochs, the FromEpoch parameter will be set to ToEpoch - 29

@gordsport gordsport added the team label Mar 22, 2024
@vega-issues vega-issues moved this from In Progress to Waiting Review in Core Kanban Mar 25, 2024
@vega-issues vega-issues moved this from Waiting Review to In Review in Core Kanban Mar 25, 2024
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Mar 26, 2024
@JonRay15
Copy link
Author

Happy we can close this

@JonRay15 JonRay15 added not-a-bug and removed bug labels Mar 26, 2024
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Mar 26, 2024
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Mar 26, 2024
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Mar 26, 2024
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Mar 26, 2024
@github-project-automation github-project-automation bot moved this from Approved to Merged in Core Kanban Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants