Open baktun14 opened 1 month ago
Need #398
Started compiling a design chart
Need #398
just for transparency, after a discussion we agreed there is a way to implement it without dependency on auth
Right now there's a limitation of DepositDeploymentAuthorization
that it only allows for one denom meaning we cant have same granter/grantee for both uakt and usdc grants. So there's an update to requirements:
Implement 2 new master wallets specifically for Auto Top Up. 1 wallet should serve for uakt top ups, and another for usdc grants.
Objective
Implement a worker CLI handler that automatically adds funds (top-ups) to Akash Network deployments when they are low on balance. This ensures deployments continue to run without requiring users to manually monitor and replenish funds, improving the user experience.
Scope
Details
General Workflow
Target Owners Detection
Draining Deployments Detection (per every owner)
Top-up Action (per every deployment)
Acceptance Criteria
Calculations
The above can be used to calculate the time when a deployment is expected to close. To achieve that average block time is needed which can be found in
apps/api
constants.ts
orblocksService.ts
.Important to include job run interval into calculations to ensure not missing the time of closure.
To calculate amount to top up we need to get a number of blocks per time unit which is duration / average block time and multiply that by blockRate.
Design Chart For Reference
Link
Initial task version below