KlimaDAO / klimadao

Monorepo for the official KlimaDAO site, dApp, components and design system.

Home Page:https://klimadao.finance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[api] Make the limit on spending power on the retire API configurable per team

biwano opened this issue · comments

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