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

Fix redeem stage when interacting with ConditionalTokens Graph #251

Open
jmoreira-valory opened this issue Apr 24, 2024 · 2 comments
Open

Comments

@jmoreira-valory
Copy link
Collaborator

On the redeem behaviour, the agent is not properly addressing the case when the user has not made any bet:

[2024-04-24 03:54:02,117] [INFO] [agent] Fetched redeeming information: set()
[2024-04-24 03:54:02,301] [INFO] [agent] Retrieved trades: [].
[2024-04-24 03:54:02,502] [ERROR] [agent] Could not access response using the given key(s) (data:user:userPositions) and index (None)!
[2024-04-24 03:54:02,502] [ERROR] [agent] Response: "{\"data\":{\"user\":null}}"
[2024-04-24 03:54:02,502] [ERROR] [agent] Could not get positions from conditional_tokens
[2024-04-24 04:54:02,543] [WARNING] [agent] expired deadline 2024-04-24 04:54:00.892132 with event Event.REDEEM_ROUND_TIMEOUT at AbciApp time 2024-04-24 04:54:01.529532
[2024-04-24 04:54:02,543] [WARNING] [agent] current AbciApp time after expired deadline: 2024-04-24 04:54:01.529532
[2024-04-24 04:54:02,543] [INFO] [agent] 'redeem_round' round is done with event: Event.REDEEM_ROUND_TIMEOUT
[2024-04-24 04:54:02,543] [INFO] [agent] Entered in the 'call_checkpoint_round' round for period 16
[2024-04-24 04:54:02,544] [INFO] [agent] Entered in the 'call_checkpoint_behaviour' behaviour

When the service hasn't placed any bet yet, the Conditional Tokens query outputs "{"data":{"user":null}}" and this seems to cause the agent to get stuck (in the example above, for 1 hour). This will typically happen for new services which are run and don't place a bet on their first iteration.

@jmoreira-valory
Copy link
Collaborator Author

For exmple, try making a query for a non-existent user:
https://api.thegraph.com/subgraphs/name/gnosis/conditional-tokens-gc/graphql

    {
        user(id: "0xabcde00000000000000000000000000000") {
            userPositions(
                first: 1000
                orderBy: id
            ) {
                balance
                id
                position {
                    id
                    conditionIds
                    lifetimeValue
                }
                totalBalance
                wrappedBalance
            }
        }
    }

@jmoreira-valory
Copy link
Collaborator Author

Additionally, investigate why the timeout in this round is 1h long.

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

No branches or pull requests

1 participant