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

Transfer nearly impossible to distinguish from external fee amount #521

Open
Chralt98 opened this issue Feb 14, 2024 · 0 comments
Open

Transfer nearly impossible to distinguish from external fee amount #521

Chralt98 opened this issue Feb 14, 2024 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Chralt98
Copy link
Member

Chralt98 commented Feb 14, 2024

  historicalSwaps(limit: 10, where: {extrinsic: {hash_eq: "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9"}}) {
    assetAmountIn
    accountId
    assetAmountOut
    assetIn
    assetOut
    blockNumber
    event
    extrinsic {
      hash
      name
    }
    timestamp
    id
  }
  historicalAccountBalances(orderBy: timestamp_ASC, where: {
    accountId_eq: "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
    extrinsic: {hash_eq: "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9"}
  }
  ) {
    accountId
    dBalance
    event
    blockNumber
    timestamp
    extrinsic {
      hash
      name
    }
    assetId
    id
  }
    "historicalSwaps": [
      {
        "assetAmountIn": "16180000000",
        "accountId": "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
        "assetAmountOut": "16986873968",
        "assetIn": "Ztg",
        "assetOut": "{\"categoricalOutcome\":[329,0]}",
        "blockNumber": 4534229,
        "event": "BuyExecuted",
        "extrinsic": {
          "hash": "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9",
          "name": "NeoSwaps.buy"
        },
        "timestamp": "2023-12-23T14:15:30.364000Z",
        "id": "0004534229-c6dc7-000011"
      }
    ],
    "historicalAccountBalances": [
      {
        "accountId": "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
        "dBalance": "-242841481",
        "event": "Withdraw",
        "blockNumber": 4534229,
        "timestamp": "2023-12-23T14:15:30.364000Z",
        "extrinsic": {
          "hash": "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9",
          "name": "NeoSwaps.buy"
        },
        "assetId": "Ztg",
        "id": "0004534229-c6dc7-000003-8yFqd"
      },
      {
        "accountId": "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
        "dBalance": "-16180000000",
        "event": "Transfer",
        "blockNumber": 4534229,
        "timestamp": "2023-12-23T14:15:30.364000Z",
        "extrinsic": {
          "hash": "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9",
          "name": "NeoSwaps.buy"
        },
        "assetId": "Ztg",
        "id": "0004534229-c6dc7-000004-8yFqd"
      },
      {
        "accountId": "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
        "dBalance": "80900000",
        "event": "Transfer",
        "blockNumber": 4534229,
        "timestamp": "2023-12-23T14:15:30.364000Z",
        "extrinsic": {
          "hash": "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9",
          "name": "NeoSwaps.buy"
        },
        "assetId": "Ztg",
        "id": "0004534229-c6dc7-000005-8yFqd"
      },
      {
        "accountId": "dDyDKjNJnefrw3mq8YDiZ1udq8PyrE8LiBm3q2cVCcar8yFqd",
        "dBalance": "16986873968",
        "event": "Transfer",
        "blockNumber": 4534229,
        "timestamp": "2023-12-23T14:15:30.364000Z",
        "extrinsic": {
          "hash": "0x5d468b452f07238371595f2e087451a9c2347c06728934b9ae24d25e5578fcd9",
          "name": "NeoSwaps.buy"
        },
        "assetId": "{\"categoricalOutcome\":[329,0]}",
        "id": "0004534229-c6dc7-000010-8yFqd"
      }
    ]
  }

The same happens for the following other extrinsic hash 0x388cd620d2f1f55883fd5b40626b8ec54d58e3554fb378826627412ace8996c2.

The behaviour is the following: The trader is the market creator themselves and therefore gets a transfer of the external fee amount 4534229 from themselves to themselves. Can we attach a name to those Transfer events like extrinsic: name: "External Fees"? Mhh I think it's even hard for you to figure out which Transfer belongs to external fees paid, right? Mhhh... That's really hard on my side, because my current approach of the swap export is to look in historicalSwaps, use the extrinsic hash and then after it to look in historicalAccountBalances and assert for all expected transactions. The above transactions were unexpected and are regarded as a special case that I unfortunately need to handle too..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants