dev.cocore.account.tokenPatronage

cocore.dev

Documentation

main record

No description available.

Record Key tid Timestamp-based ID

Properties

createdAt string datetime Required

An RFC 3339 formatted timestamp.

exchange string did Required

Exchange DID. MUST equal the repo this record is published in.

patronageScore integer Required

This recipient's patronage during the period — tokens spent as requester PLUS tokens earned as provider. Self-loop receipts count once (the doc's `selfLoop.feeWaived` already handles the fee carve-out).

minimum: 0
period ref #period Required

Rebate period [start, end). Receipts whose `completedAt` falls in this window contributed to the patronage tally.

policy ref com.atproto.repo.strongRef Required

Strong-ref to the exchangePolicy in effect at distribution time. Pins `patronageDistribution.fractionBps` + `treasuryDid` so the rebate math is reproducible offline.

recipient string did Required

DID receiving the patronage rebate.

tokensCredited integer Required

Tokens debited from the treasury and credited to the recipient.

minimum: 1
totalPatronage integer Required

Sum of all participating DIDs' patronage scores during the period. Lets a verifier reproduce the rebate share: `tokensCredited = floor(treasuryBefore * fractionBps / 10000 * patronageScore / totalPatronage)`.

minimum: 0
treasuryBefore integer Required

Treasury balance immediately before this distribution period fired. Pinned for audit so verifiers can sum the per-recipient `tokensCredited` and confirm it equals `floor(treasuryBefore * fractionBps / 10000)` modulo rounding.

minimum: 0
View raw schema
{
  "key": "tid",
  "type": "record",
  "record": {
    "type": "object",
    "required": [
      "exchange",
      "recipient",
      "period",
      "patronageScore",
      "totalPatronage",
      "tokensCredited",
      "treasuryBefore",
      "policy",
      "createdAt"
    ],
    "properties": {
      "period": {
        "ref": "#period",
        "type": "ref",
        "description": "Rebate period [start, end). Receipts whose `completedAt` falls in this window contributed to the patronage tally."
      },
      "policy": {
        "ref": "com.atproto.repo.strongRef",
        "type": "ref",
        "description": "Strong-ref to the exchangePolicy in effect at distribution time. Pins `patronageDistribution.fractionBps` + `treasuryDid` so the rebate math is reproducible offline."
      },
      "exchange": {
        "type": "string",
        "format": "did",
        "description": "Exchange DID. MUST equal the repo this record is published in."
      },
      "createdAt": {
        "type": "string",
        "format": "datetime"
      },
      "recipient": {
        "type": "string",
        "format": "did",
        "description": "DID receiving the patronage rebate."
      },
      "patronageScore": {
        "type": "integer",
        "minimum": 0,
        "description": "This recipient's patronage during the period — tokens spent as requester PLUS tokens earned as provider. Self-loop receipts count once (the doc's `selfLoop.feeWaived` already handles the fee carve-out)."
      },
      "tokensCredited": {
        "type": "integer",
        "minimum": 1,
        "description": "Tokens debited from the treasury and credited to the recipient."
      },
      "totalPatronage": {
        "type": "integer",
        "minimum": 0,
        "description": "Sum of all participating DIDs' patronage scores during the period. Lets a verifier reproduce the rebate share: `tokensCredited = floor(treasuryBefore * fractionBps / 10000 * patronageScore / totalPatronage)`."
      },
      "treasuryBefore": {
        "type": "integer",
        "minimum": 0,
        "description": "Treasury balance immediately before this distribution period fired. Pinned for audit so verifiers can sum the per-recipient `tokensCredited` and confirm it equals `floor(treasuryBefore * fractionBps / 10000)` modulo rounding."
      }
    }
  }
}
period object

Half-open interval [start, end). Closed-loop cocore.dev uses calendar months in UTC by default.

Properties

end string datetime Required

An RFC 3339 formatted timestamp.

start string datetime Required

An RFC 3339 formatted timestamp.

View raw schema
{
  "type": "object",
  "required": [
    "start",
    "end"
  ],
  "properties": {
    "end": {
      "type": "string",
      "format": "datetime"
    },
    "start": {
      "type": "string",
      "format": "datetime"
    }
  },
  "description": "Half-open interval [start, end). Closed-loop cocore.dev uses calendar months in UTC by default."
}

Lexicon Garden

@