Skip to content

Factories

A factory is the house side of Midgard.

It is a live position backed by:

  • staked GARD
  • a specific game
  • a score set by the factory owner

To create a factory, the owner supplies:

  • a PonziLand parcel they control
  • an amount of staked GARD
  • a daily burn rate
  • a supported game contract

Creation does not activate the factory yet. Midgard mints a game session during creation, and the score from that session becomes the factory’s initial defense score later.

The contract also snapshots the current yield config at creation and stores it on the factory for its full lifetime.

The factory becomes active when the score from the minted game session is submitted.

Activation rules:

  • if the game is finished, anyone can activate it
  • if the 24-hour activation expiry has passed, anyone can activate it
  • before that, only the factory owner can lock the current score

This is important because a factory can still start with a score of zero. Zero is treated as a real score, not “no score”.

Once active, the factory:

  • burns against stake over time
  • mints inflation based on burn plus yield bonus
  • accepts challenges
  • can optionally take leverage from the vault

A factory eventually stops in one of three ways:

  • it runs out of runway and closes naturally
  • it is invalidated because the land backing is no longer valid
  • it is liquidated by the vault if it has an unhealthy leverage loan

The key internal pieces are:

  • Stake: the GARD locked behind the factory
  • Daily burn: how fast the factory consumes its runway
  • Initial burn: an upfront obligation that also gives the factory initial inflation credit
  • Burn reductions: added when challengers lose
  • Inflation paid out: what has already gone to owners or winning challengers
  • Payouts reserved: what is locked for still-pending challenges

The protocol measures factory value as:

  • remaining stake after effective burn
  • plus available inflation after subtracting paid and reserved amounts

That claimable value is what matters for both closure and leverage health.

The protocol enforces two important constraints when a factory is created:

  • daily_burn must be positive
  • a minimum initial_burn is enforced so the factory can support one challenge payout immediately
  • the factory must start with at least 7 days of natural runway

That minimum initial_burn is not arbitrary:

  • ticket cost = 10% of daily burn
  • challenge reward = 190% of ticket cost
  • minimum initial_burn = 19% of daily burn

That prevents factories from being created in an instantly-dead, near-dead, or not-challengeable state.

In the current contract, a live factory owner can still:

  • add stake to extend lifetime
  • increase daily burn to make the factory more aggressive

Burn increases have guardrails:

  • they are blocked if the factory currently has an active leverage loan
  • they cannot shorten the natural remaining runway

This means factory owners can tune live positions, but not in ways that break the runway covenant.

If leverage later increases daily burn, the protocol also increases initial_burn when needed so the leveraged factory still covers one challenge payout immediately.

Every factory is built around one score:

  • the factory owner’s score is the defense score
  • challengers must beat it with a strictly higher score
  • equal scores do not win

That makes factories simple to reason about. The score itself is the line.

Factory owners balance four things:

  • a high enough score to defend
  • enough stake to survive
  • a burn rate that creates worthwhile income
  • optional leverage that boosts output without causing liquidation

The stronger the score and the better the risk management, the longer a factory can stay productive.