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

Start using solvers contract for being able to determine if user isSolver #49

Open
GabrielCamba opened this issue Jul 11, 2022 · 1 comment
Assignees
Labels
Protofire Subgraph Subgraph related task

Comments

@GabrielCamba
Copy link
Contributor

https://etherscan.io/address/0xC92E8bdf79f0507f65a392b0ab4667716BFE0110#code

take a look at how this contract manages solvers and use it to set isSolver property and improve information to indicate if a user was a solver, how many times isSolver flag changed.

@GabrielCamba GabrielCamba added Protofire Subgraph Subgraph related task labels Jul 11, 2022
@GabrielCamba GabrielCamba self-assigned this Jul 11, 2022
@GabrielCamba
Copy link
Contributor Author

I already worked on this, the progress code is on this branch
That's indexing SolverAdded(address) and SolverRemoved(address) events. Adding and removing the flag isSolver on every user.
Mainnet version is deployed here and gc is deployed here


Before removing the previous version of how isSolver is being set, I decided to check everytime a settlement is solved to check if isSolver was set with the newest version. here

I added a redFlag property in User entity to be set every time a settle is solved by a non solver user.

please try this query on gc subgraph that is already indexed:

{ 
  users(first: 5, where: {redFlag: true}) {
    id
    address
    firstTradeTimestamp
    isSolver
    redFlag
    ordersPlaced {
      id
    }
  }  
}

this is the current result:

{
  "data": {
    "users": [
      {
        "id": "0x230ff84887616f29f5c55ce68ff627a29f79d0cc",
        "address": "0x230ff84887616f29f5c55ce68ff627a29f79d0cc",
        "firstTradeTimestamp": 0,
        "isSolver": false,
        "redFlag": true,
        "ordersPlaced": []
      },
      {
        "id": "0x26029b63c7dbd0c4c04d7226c3e7de5eab3db3d8",
        "address": "0x26029b63c7dbd0c4c04d7226c3e7de5eab3db3d8",
        "firstTradeTimestamp": 0,
        "isSolver": false,
        "redFlag": true,
        "ordersPlaced": []
      },
      {
        "id": "0x449944c987d622cd8db9c150fd4ecdfe4435b836",
        "address": "0x449944c987d622cd8db9c150fd4ecdfe4435b836",
        "firstTradeTimestamp": 0,
        "isSolver": false,
        "redFlag": true,
        "ordersPlaced": []
      },
      {
        "id": "0x508bcc23c1a808a9c41d10e2fcb544ffb76ae3e5",
        "address": "0x508bcc23c1a808a9c41d10e2fcb544ffb76ae3e5",
        "firstTradeTimestamp": 0,
        "isSolver": false,
        "redFlag": true,
        "ordersPlaced": []
      },
      {
        "id": "0x52ac5b5e85de9aa72ef5925989fc419aa04eb15b",
        "address": "0x52ac5b5e85de9aa72ef5925989fc419aa04eb15b",
        "firstTradeTimestamp": 0,
        "isSolver": false,
        "redFlag": true,
        "ordersPlaced": []
      }
    ]
  }
}

@alfetopito I'm not sure if this is the expected result or if I miss some event or something. Plz, confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Protofire Subgraph Subgraph related task
Projects
None yet
Development

No branches or pull requests

1 participant