Users of the retirement API can decide on a limit on spending power per week in the limit of 5000 USDC per key.
We want to add a limit on the overall spending power of a team controlled by Carbonmark.
Describe the solution you'd like
Add a limit_cost_usdc_per_week in the team database with a default value of 5000
Add a trigger that prevent modifying this value by non admins.
Add a check in the retire endpoint that checks:
Total spent by all the keys during the last week + Cost of the new trasaction < team.limit_cost_usdc_per_week
Users of the retirement API can decide on a limit on spending power per week in the limit of 5000 USDC per key. We want to add a limit on the overall spending power of a team controlled by Carbonmark.
Describe the solution you'd like
Total spent by all the keys during the last week + Cost of the new trasaction < team.limit_cost_usdc_per_week