Skip to content

Implement network self-sufficiency metric #123

@orthecreedence

Description

@orthecreedence

The implementation of the discussion #122 in the core.

Given the long-term nature of the metric, it might make sense to collect and process stats into monthly buckets and calculate on a yearly basis.

Sufficiency stats

struct SufficiencyStats {
  period: DateTime<Utc>,
  consumer_credits_printed: Decimal,
  consumer_credits_withdrawn: Decimal,
  producer_order_credits: Decimal,
  producer_currency_credits: Decimal,
}

Equations are fairly straightforward once we have this info (see https://basisproject.net/paper#definition-of-self-sufficiency)

Consumer sufficiency

  • When credits are printed (ie, payroll is run), increment the total credits for the current monthly bucket
  • On withdraw increment the total withdrawl monthly bucket as a credit value based on the current credit -> currency conversion for that currency

Producer sufficiency

  • When an agreement is created, add the total credit value to the monthly sufficiency stats bucket
  • When an agreement involves currency, add the credit value of the currency to the monthly sufficiency stats bucket

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:interfaceRegarding interfacing with the outside world.project:coretag:cyberneticsFor issues relating to systemic automationtag:governanceHaving to do with governance in general (global,companies, resources, etc)type:featureWell-thought out features with implementation details

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions