Skip to content

feat: order-take rate limit to prevent spam #825

Description

@Matobi98

Summary

Add two environment variables: MAX_ORDERS_TAKE (max orders a user can take before being temporarily restricted) and ORDER_TAKE_COOLDOWN_HOURS (hours they must wait after hitting the limit). Each time a user takes an order the  counter increments; once it reaches the threshold the bot temporarily prevents them from taking new orders and starts the cooldown timer.

Behavior

If the user successfully completes any order (reaching SUCCESS status, as maker or taker) at any point, the counter resets to 0 and any active cooldown is cancelled immediately. If no order is completed, the user must wait out the cooldown before taking new orders again.

Implementation Notes

The counter and cooldown timestamp should be stored on the User model. The bot should notify the user when they are restricted and show how much time is left in the cooldown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions