CLIVEBREMNER
local
RECEIVED
TREASURY

collateral

TS/E
WHAT BACKS WHAT
TS/E/1

the rule

enforced by the program

No position opens without collateral, and no collateral is released while a position it backs is open. The ratio of collateral to position amount is set on the rate sheet and read by the program at the moment the open instrument is called.1 It is not read again until the overnight batch. If the ratio on the rate sheet changes in between, existing positions are judged by the new ratio at the next batch, which is why rate sheet changes are announced in a memo at least one full working day before they take effect.

TS/E/2

collateral account fields

field definitions, fixed by the program
FIELDTYPEMEANING
ownerPubkeyThe counterparty who locked it.
mintPubkeyThe token mint of the locked value.
amountu64Locked base units.
positionsu32Number of open positions this account backs.
locked_ati64Timestamp of the lock instruction.
bumpu8PDA bump.
TS/E/3

the ratio, explained once

ARITHMETIC

The rate sheet stores the collateral ratio in basis points.1 A basis point is one hundredth of one percent. The program multiplies the position amount by the ratio and divides by ten thousand to find the minimum collateral, using integer arithmetic with no rounding up. If the collateral account's amount is less than that figure, open fails with the insufficient collateral error and nothing moves. The same check runs at batch for settle. It is the only arithmetic the program does apart from adding the fee.

TS/E/4

one collateral account, many positions

STRUCTURE

A counterparty has one collateral account per mint, and every position it opens against that mint is backed by the same account. The account's positions field counts how many. The ratio check at open compares the collateral amount to the new position alone, not to the sum of all positions. That is a deliberate choice and it is written here so that nobody mistakes it for an oversight. The batch, however, holds any position whose collateral is below ratio, and because they all share one account, a shortfall holds all of them.

TS/E/5

what release will not do

LIMITS

Release returns locked collateral to its owner. It refuses if the positions field is not zero. It does not refuse partially. It does not release "the unused part." The program does not compute an unused part because there is no such thing until every position is closed. If you want some of your collateral back, settle your positions.

TS/E/6

mints

SCOPE

The system was initialized with one mint for the float. Collateral accounts can be created for any mint, because lock takes the mint as an account and does not check it against a list. Whether a position can be opened against collateral in a different mint from the float is decided by the open instrument, which requires the collateral account's mint to equal the float's mint. So in practice there is one mint. The reason lock is not restricted is that restricting it would require a list, and a list would require someone to maintain it.

TS/E/7

collateral is not a deposit

CLARIFICATION

Locked collateral earns nothing, is owed nothing, and is held by a program-derived vault that no key controls. The desk cannot move it. The operator key cannot move it.2 Only release moves it, and only its owner can call release. If the bank ceased to exist tomorrow, the vault and its contents would remain exactly where they are.

  1. 1. The rate sheet is the set of rate parameters held in the config account and printed, unaltered, on the rate sheet page.
  2. 2. The operator key is the single key this desk signs with, and what it may do is fixed by the program, not by the desk.
END OF COLLATERAL