Skip to Content

Hub

What each function of the hub does, who may call it, when, and what it checks.

Hub. The hub is the strategy’s account, on the chain its kind names, behind the member proxy and the kernel, whose code only its owner moves. It holds no market position and makes no market call: it holds the owner’s money between its legs, sends the legs their money (by a call on its chain, by Circle elsewhere), stores their reports, values the strategy at one instant, charges DLTX’s one fee, the performance fee, within its compiled cap and pays the owner, only the owner’s wallet. A strategy is reusable: it stores no open or closed state. Capital added to an empty hub starts a new run in the execution group the addition names, told to no leg (each leg records its owner’s signed run); a stop, by the owner, the escape hatch or a leg, is always revoke and unwind: anyone may then drive the unwind, which repays each leg’s debt from the hub’s cash, brings everything home and pays the owner, DLTX’s fee taken on the way, and clears itself once the strategy is settled. settled() is true only when nothing but dust is at the hub, every leg is settled and nothing is in flight between any two members; while it is false the owner’s Stop can still act. What reaches the hub after its run ended goes home to the owner by anyone’s payHome. Capital only as the hub sees it: what reaches the hub outside its counted moves is the owner’s capital, and every other dollar, wherever it lands (a stranger’s mint or transfer to a leg included), is the strategy’s cash, profit above the mark; no report moves the mark. Money enters a strategy only through the hub. The registry’s two reads an exit makes, whether the run’s group is stopped and the fee address, are capped and fail safe: a registry that reverts, burns its gas or answers malformed reads as stopped and as no fee address, so the hatch opens, the fee is deferred or forgiven, and the owner is paid. The owner’s settings (the hub’s fast fee cap, fee budget and profile, and an AAVE V3 family leg’s bounds beside it) are checked and in force in the owner’s own call; a raise of the performance fee is due at once and applies from the first charge on a value from after it that leaves no earlier profit uncharged. The payout setting (collect or compound) changes at once; every payout pays the performance fee on its part above the mark then and there, so the mark is never below 0. The owner acts by a call or by a signed message anyone relays (a withdrawal request, a setting), each named to this hub on its chain, within 7 days, a nonce above the last used. Its valuation and views run in the value module (HubValue), its fees and asset profile in the fee module (HubFee), its stop and unwind in the unwind module (HubUnwind), the owner’s calls and signed messages in the owner module (HubOwner, the module of every selector the others do not claim); its upgrades, the owner’s Stop and the transfer of its ownership are the kernel’s.

The other contracts, and every caller on one table, are on the overview.

The owner’s wallet, by signature

A message signed by the member’s owner, one wallet: an ECDSA signature on every chain or, on Ethereum only, ERC-1271 for a contract wallet. Anyone may submit the transaction; submitting it gives no power, the signature does.

requestWithdrawSigned

function requestWithdrawSigned(
    OwnerMessages.RequestWithdraw calldata m,
    bytes calldata sig
) external

As requestWithdraw, by the owner’s signed RequestWithdraw relayed by anyone.

Who may call: Anyone, relaying the owner’s signature.

When: At any time.

Parameters

NameTypeDescription
mOwnerMessages.RequestWithdrawThe owner’s signed RequestWithdraw, naming this member’s chain id and address.
sigbytesThe owner’s signature of m (EIP-712 domain “DLTX Owner”, version 1, no chain id).

What it checks

  • Named to this member on this chain (NotNamed) at its owner generation (StaleGeneration), the deadline not passed (Expired), the owner’s signature: ECDSA, or ERC-1271 when the owner is a contract on this chain (NotOwner).
  • Its nonce above the last one used here (StaleNonce); gaps are allowed, so using it voids every older one unused.

allowSigned

function allowSigned(
    OwnerMessages.Allow calldata m,
    bytes calldata sig
) external

As allow, by the owner’s signed Allow relayed by anyone.

Who may call: Anyone, relaying the owner’s signature.

When: After a stop.

Parameters

NameTypeDescription
mOwnerMessages.AllowThe owner’s signed Allow, naming this member’s chain id and address.
sigbytesThe owner’s signature of m (EIP-712 domain “DLTX Owner”, version 1, no chain id).

What it checks

  • Named to this member on this chain (NotNamed) at its owner generation (StaleGeneration), the deadline not passed (Expired), the owner’s signature: ECDSA, or ERC-1271 when the owner is a contract on this chain (NotOwner).
  • Its nonce above the last one used here (StaleNonce); gaps are allowed, so using it voids every older one unused.
  • runEpoch the hub’s run (WrongRun).
  • The hub’s count of stops is the message’s stopCount (StaleStop).

setSettingSigned

function setSettingSigned(
    OwnerMessages.SetSetting calldata m,
    bytes calldata sig
) external

As setSetting, by the owner’s signed SetSetting relayed by anyone.

Who may call: Anyone, relaying the owner’s signature.

When: Outside an unwind.

Parameters

NameTypeDescription
mOwnerMessages.SetSettingThe owner’s signed SetSetting, naming this member’s chain id and address.
sigbytesThe owner’s signature of m (EIP-712 domain “DLTX Owner”, version 1, no chain id).

What it checks

  • Named to this member on this chain (NotNamed) at its owner generation (StaleGeneration), the deadline not passed (Expired), the owner’s signature: ECDSA, or ERC-1271 when the owner is a contract on this chain (NotOwner).
  • Its nonce above the last one used here (StaleNonce); gaps are allowed, so using it voids every older one unused.
  • The value within the creation’s bounds (BadParams; a profile, BadProfile).
  • A key of the hub (UnknownSetting), and a profile switch’s checks as setSetting’s.

The owner’s wallet

The member’s owner, one wallet (a Safe included), calling it directly, and nothing else.

addCapital

function addCapital(
    uint256 amount,
    uint64 group
) external

Takes in as capital what reached the hub before it (CapitalIn), then pulls exactly amount of the owner’s USDC, which the owner’s wallet allowed, into the strategy’s capital: the mark rises by it, no fee, CapitalAdded its one event. From empty (no run going, or the run going is settled) a new run starts in group, told to no leg: the owner’s signed Run, relayed once the start is final, tells each leg. While a run holds money, group must be its own.

Who may call: The owner’s wallet.

When: Outside an unwind and a revocation.

Parameters

NameTypeDescription
amountuint256The USDC to pull, 6 decimals.
groupuint64The execution group of the run: chosen when capital is added to an empty hub (DLTX’s app fills in the group its admission picked), the run’s own otherwise.

What it checks

  • The caller is the owner (NotOwner).
  • Not unwinding (Unwinding), not revoked (Revoked), a non-zero amount (ZeroAmount).
  • A run holding money keeps its group (WrongGroup); a new run only in a group the registry has not stopped (GroupStopped), read with bounded gas (LowGas).
  • USDC’s transfer from the owner succeeds (NotAllowed).

requestWithdraw

function requestWithdraw(uint256 amount) external

Records how much the owner asks back, type(uint256).max for everything; a new request replaces the last, and a new run starts with none. The call takes the next owner nonce, so a signed request not yet relayed never lands after it. The execution key then frees the money within the strategy’s bounds and the hub pays the owner’s wallet, as paying the owner is always allowed.

Who may call: The owner’s wallet.

When: At any time.

Parameters

NameTypeDescription
amountuint256The USDC asked back, 6 decimals; type(uint256).max for everything.

What it checks

  • The caller is the owner (NotOwner).

allow

function allow(
    uint64 runEpoch,
    uint64 stopCount
) external

Lifts the hub’s stop of its run runEpoch: the execution key may act again at the hub; an unwind under way is left to clear itself. Only while the hub’s count of stops is still stopCount, so any stop since the Allow was made voids it. The same rule as at every leg: each leg takes its own Allow. It takes the next owner nonce.

Who may call: The owner’s wallet.

When: After a stop.

Parameters

NameTypeDescription
runEpochuint64The hub’s run (control().runEpoch).
stopCountuint64The hub’s count of stops the owner decided at (control().stopCount).

What it checks

  • The caller is the owner (NotOwner).
  • runEpoch the hub’s run (WrongRun).
  • The hub’s count of stops is stopCount (StaleStop).

setPayout

function setPayout(bool collect) external

Sets the payout setting, in force at once: collect (the execution key pays the profit to the owner’s wallet by collect, the fees first; when and how much is the execution key’s choice, within the profit) or compound (the profit stays invested; crystallize charges the fee). Either way the money stays the owner’s.

Who may call: The owner’s wallet.

When: At any time.

Parameters

NameTypeDescription
collectboolTrue to collect, false to compound.

What it checks

  • The caller is the owner (NotOwner).

resetReports

function resetReports(uint8 k) external

Resets the report stream of link k: its next report observed at or after the reset is kept whatever its sequence number (an older one delivered late is not), and the stream goes on from it, so a report forged ahead of the leg’s own no longer holds them back. The report kept stays until then; Circle’s nonces still refuse a message delivered twice.

Who may call: The owner’s wallet.

When: At any time.

Parameters

NameTypeDescription
kuint8The link whose stream is reset (0 to 3, in member order).

What it checks

  • The caller is the owner (NotOwner).
  • k is one of the hub’s links (NotAllowed).

releaseDebtReserve

function releaseDebtReserve() external

Releases what the unwind keeps at the hub for the legs’ debts (a leg on this chain its latest debt reading, a leg on another chain its latest report’s debt), so the next settlement pays that cash to the owner. No leg is declared settled: a debt still real at a leg on another chain is left to that leg’s own unwind or to the owner. The next reading or report keeps cash again.

Who may call: The owner’s wallet.

When: At any time.

What it checks

  • The caller is the owner (NotOwner).

setSetting

function setSetting(
    uint8 key,
    bytes32 value
) external

Sets the hub’s key to value, checked against the bounds of the hub’s creation and its other settings as they stand, and in force from this call on: its profile (key 1: an open PROFILE entry holding what the strategy holds, the same underlying and each section’s holding and identity), its fast fee cap (2) and its fee budget (3). The profile switch also switches every AAVE V3 family leg on this chain (AAVE V3 on Arbitrum or Ethereum, Spark), each checking it as at its creation, only when each has the hub’s owner and owner generation: all switch or none. Each leg takes its other settings at the leg.

Who may call: The owner’s wallet.

When: Outside an unwind.

Parameters

NameTypeDescription
keyuint8The setting (Settings).
valuebytes32The new value: a bp or a profile’s registry entry id.

What it checks

  • The caller is the owner (NotOwner); not unwinding (Unwinding).
  • A key of the hub (UnknownSetting).
  • The value within the creation’s bounds (BadParams; a profile, BadProfile).
  • A profile switch: every AAVE V3 family leg on this chain with the hub’s owner and owner generation (OwnersDiffer), and each leg’s own checks.

DLTX’s execution key

The execution key of the strategy’s group, read from its chain’s registry; the owner may revoke it on each contract of the strategy. It acts within the contract’s limits and can pay only the strategy’s own contracts, or the owner’s wallet from the hub.

send

function send(
    uint8 k,
    uint256 amount,
    bool fast,
    uint256 maxFee
) external

Sends amount of USDC to leg k: on this chain by a counted transfer the leg pulls, otherwise by a Circle burn only that leg can complete. Never the fees set aside.

Who may call: The run’s execution key.

When: While the run is going, neither revoked nor unwinding.

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).
amountuint256The USDC to send, 6 decimals.
fastboolAcross chains: true for Circle’s fast transfer (confirmed, with a fee), false for a standard one (finalized, Circle’s minimum fee only). No effect on the same chain.
maxFeeuint256For a fast transfer, the most Circle may take, 6 decimals; raised to Circle’s minimum. Not used for a standard one.

What it checks

  • Not unwinding (Unwinding), not revoked (Revoked), a run going (NoRun), and the caller the registry’s key for the run’s group (NotExecution).
  • USDC that reached the hub outside its counted moves (CapitalIn) is first taken in as capital.
  • The amount is not zero (ZeroAmount) and at most the hub’s free USDC (NeedUsdc); leg k is ready (NotReady).
  • Across chains, Circle’s minimum fee is at most 10 bp of the amount; a fast transfer pays at most maxFee, at most the fast fee cap of the amount, never below Circle’s minimum (FeeAboveCap).
  • Circle’s fees of the last two UTC days, this one included, stay within the fee budget of the hub’s USDC before the send (OverFeeBudget).

crystallize

function crystallize(uint80[] calldata rounds) external

Charges the performance fee on the profit above the mark, at most once a day and capped. Money not yet counted is first taken in as capital. What it counts, net of its fee, becomes collectable; at a rate of 0 it counts its capped profit fee-free, so collect has profit to pay.

Who may call: The run’s execution key.

When: At most once a day each, after a snapshot.

Parameters

NameTypeDescription
roundsuint80[]The Chainlink round of each pinned feed in effect at the valuation’s instant, in the pins’ order (a composite pin takes two): the hub checks each.

What it checks

  • Not unwinding (Unwinding), not revoked (Revoked), a run going (NoRun), and the caller the registry’s key for the run’s group (NotExecution).
  • A fee is due (TooSoon).
  • The value can be formed (its reason: NoSnapshot, StaleReport, FutureReport, SnapshotIncomplete, MoveSettling, PositionMoved, UnknownAsset, a price’s or the sequencer’s).
  • The hub holds the performance fee in free USDC (NeedUsdc).

payout

function payout(uint256 amount) external

Pays amount of USDC, gross, to the owner’s wallet, and to no one else, from the hub’s free USDC: its part up to the mark fee-free, its part above the mark profit paying the performance fee at the rate in force then and there (to DLTX’s fee address, set aside if refused, forgiven to the owner with no fee address; PayoutFee). Hub facts only: no value, no report, no daily interval or cap. The mark falls by amount, never below 0.

Who may call: The run’s execution key, at the owner’s Withdraw part.

When: While the run is going, neither revoked nor unwinding.

Parameters

NameTypeDescription
amountuint256The gross payout, USDC.

What it checks

  • Not unwinding (Unwinding), not revoked (Revoked), a run going (NoRun), and the caller the registry’s key for the run’s group (NotExecution).
  • The amount is at most the hub’s free USDC (NeedUsdc).

collect

function collect(uint256 amount) external

In collect mode only: pays amount of profit to the owner’s wallet, and to no one else, fee-free, and only from the profit already charged and not yet collected (collectable: what crystallize counted, net of its fee). It reads no value: a valuation becomes profit only through the capped, daily charge, so no report makes capital taxable beyond that cap. That profit is as the charge recognised it: a forged report can make some of it fictitious, at most the cap, and its collect then returns that much of the owner’s own capital to the owner, never to anyone else, no fee added. Above collectable it is refused. Collected beside Payout.

Who may call: The run’s execution key, by the owner’s payout settings.

When: While the run is going, in collect mode, after a charge.

Parameters

NameTypeDescription
amountuint256The profit to pay the owner, USDC, 6 decimals.

What it checks

  • Not unwinding (Unwinding), not revoked (Revoked), a run going (NoRun), and the caller the registry’s key for the run’s group (NotExecution).
  • Collect mode (NotCollecting), never 0 (ZeroAmount).
  • At most what is collectable (AboveProfit).
  • At most the hub’s free USDC (NeedUsdc).

snapshot

function snapshot() external

Records, at this block, every leg on the hub’s chain (its holdings, its counters, its count of operations): the instant a valuation starts from.

Who may call: The run’s execution key.

When: Before crystallize or payout: the reports of the legs on other chains must then be observed 1 to 3 minutes after it.

What it checks

  • Not unwinding (Unwinding), not revoked (Revoked), a run going (NoRun), and the caller the registry’s key for the run’s group (NotExecution).
  • The sequencer is up where the hub’s chain has one, and every pinned price is fresh (its feed’s reason).
  • Each leg on this chain answers a reading the valuation can use (its reason, or PositionMoved).

DLTX’s admin key, on the registry

DLTX’s offline key, the admin of the registry. It may list entries (kinds, versions, asset profiles, a successor registry, builders), each open at once, retire a listed entry, set each group’s execution key, propose a new fee address and a new admin, each of which takes effect only when that address accepts; it never touches an owner’s money and never moves a strategy contract to another version.

setFeeRate

function setFeeRate(uint16 newBp) external

Sets the performance fee’s rate, 0 to 5,000 bp, whatever the owner signed (the signed rate is only the starting one). A cut, or the same rate, applies at once to every profit not yet charged and clears a raise waiting. A raise outside the unwind is due at once (replacing one waiting): it applies from the first charge on a valuation whose snapshot is in a later block than the raise that leaves no earlier profit uncharged, so it never reaches profit earned before it. A raise while unwinding is refused, and a stop drops one not yet applied.

Who may call: The admin key of the hub’s registry.

When: In any state; a raise outside the unwind only.

Parameters

NameTypeDescription
newBpuint16The new rate, bp of the profit above the mark.

What it checks

  • The caller is the registry’s admin (NotAllowed).
  • The rate is at most 5,000 bp, and no raise while unwinding (BadRate).

The kernel

The contract’s own kernel, running in the contract: it calls these hooks itself (at the creation, after an upgrade, for the owner’s Stop and a transfer of ownership) and refuses them from anyone else.

kernelInit

function kernelInit(bytes calldata data) external

Initialises the member once, from what the builder hands it (MemberInit): the kind must name this logic’s member type at this member’s place and on this chain, the member’s address must be the one the kind’s addresses give it, and the links are every other member in the kind’s order (a leg’s first its hub). Then the member type checks its own section of the profile on this chain and its parameters, and stores them. A leg on a chain other than its hub’s announces itself at once to every member on another chain. Any refusal reverts the whole creation.

Who may call: The member’s kernel, in the builder’s creating transaction.

When: Once, at the creation.

Parameters

NameTypeDescription
databytesThe builder’s MemberInit, abi-encoded.

What it checks

  • The member is initialised by its kernel (NotAllowed), which initialises it once.
  • The kind’s member at this place is this logic’s type, the hub at place 0 and a leg elsewhere (WrongMember), on this chain, the chain this code was built for (WrongChain).
  • Every address is the kind’s, 2 to 5 members, none zero, none twice (BadLinks).
  • The member type’s own section of the profile and its parameters (BadProfile, BadParams, and its own reasons).

kernelUpgraded

function kernelUpgraded(uint32) external

Runs once after the member’s kernel moved it to this logic: a leg has nothing to move.

Who may call: The member’s kernel, in the call that applies the upgrade.

When: After an upgrade.

Parameters

NameTypeDescription
—uint32Unnamed in the code: not used.

What it checks

  • The member is initialised (NotAllowed).

kernelStop

function kernelStop() external

Stops the member’s recorded run for the owner’s Stop: the hub as by any stop (revoked, its unwind begun, every leg told, the fee raise not yet applied dropped), a leg as the escape hatch does (revoked, its unwind begun unless it already was, its hub told, a failure kept pending for tellHub), a leg with no run recorded at run 0. Either raises the member’s count of stops, which the kernel requires. The run never moves.

Who may call: The member’s kernel, applying the owner’s Stop, signed or called.

When: While the member is not stopped.

What it checks

  • The member is initialised (NotAllowed).
  • The member is not revoked (AlreadyStopped), so no relayed Stop is a no-op.

kernelTransferred

function kernelTransferred() external

Runs once an ownership transfer applied, with the new owner in place: the previous owner’s request to withdraw is dropped (WithdrawRequested(0)), the request being the owner’s.

Who may call: The hub’s kernel, in the call that applies the transfer.

When: After a transfer.

What it checks

  • The hub is initialised (NotAllowed).

Another contract of the strategy

The strategy’s hub or one of its legs, on the same chain: the contracts that make one strategy, and nothing else.

receiveReport

function receiveReport(bytes calldata body) external

Stores the report of a leg on this chain, keeping the highest sequence number; no report moves the mark. While unwinding, the report may be the one that settles the strategy: the unwind is tried to its end.

Who may call: A leg of this strategy on this chain.

When: In every state.

Parameters

NameTypeDescription
bodybytesThe report message: its tag, the leg’s version and its LegReport.

What it checks

  • The caller is a link on this chain (BadMessage); the body is a report of this version’s layout, canonically encoded, with at most 16 holdings (BadMessage).

legStopped

function legStopped(uint64 runEpoch) external

A leg on this chain stopped its run (its escape hatch or the owner’s Stop): if that run is the hub’s current one or a later one (a leg may record its owner’s next run before the hub starts it), the hub stops as the owner’s stop does and tells every other leg. A stop of an earlier run changes nothing.

Who may call: A leg of this strategy on this chain.

When: In every state.

Parameters

NameTypeDescription
runEpochuint64The run the leg stopped.

What it checks

  • The caller is a link on this chain (BadMessage).

receiveLocal

function receiveLocal(uint256 amount) external

Pulls amount of USDC that another member on this chain allowed, and counts it as received from that member. The hub books it as a move between members, never as capital.

Who may call: Another member of the strategy on this chain, from inside its own send.

When: In every state.

Parameters

NameTypeDescription
amountuint256The USDC to pull, 6 decimals.

What it checks

  • The caller is one of this contract’s links, on this chain (BadMessage).

stopFromHub

function stopFromHub(uint8 by) external

Stops the run this leg records, whatever run the hub names (a leg and its hub may be one run apart: the leg learns its run from its owner): the execution key revoked, the unwind begun, its count of stops raised. At a leg already stopped it does nothing.

Who may call: This leg’s hub, when it lives on this chain.

When: When the hub stops, and at each step of its unwind for a leg neither unwinding nor stopped.

Parameters

NameTypeDescription
byuint8Who stopped the run: 1 the owner, 2 the escape hatch, 3 another member of the strategy.

What it checks

  • This is a leg whose hub is on this chain, and the caller is that hub (NotAllowed).

Circle’s message transmitter

Circle’s CCTP MessageTransmitterV2 on that chain, delivering a message Circle attested from another contract of the same strategy on another chain.

handleReceiveFinalizedMessage

function handleReceiveFinalizedMessage(
    uint32 sourceDomain,
    bytes32 sender,
    uint32 finality,
    bytes calldata body
) external returns (bool)

Receives a message from another member on another chain: READY marks it ready; STOP (at a leg) from its hub, of any run, stops the recorded run, never moving the leg’s run, and changes nothing at a leg already stopped; at the hub, a leg’s stop of the current run or a later one stops the strategy; REPORT (to the hub) stores the leg’s report. No message carries a run. Returns true.

Who may call: Circle’s message transmitter, delivering an attested message; anyone may relay it there.

When: In every state.

Parameters

NameTypeDescription
sourceDomainuint32The message’s chain, as its Circle domain: it must be the sending member’s own.
senderbytes32The sending member, as a word.
finalityuint32The finality Circle attested the message at: 2000 finalized, 1000 confirmed.
bodybytesThe message: its tag (READY, STOP or REPORT), the sender’s code version and its fields.

What it checks

  • The caller is Circle’s transmitter, and the sender is a link of this contract on another chain, on its own domain (BadMessage).
  • READY and REPORT need finalized; STOP is taken at any finality: a stop is only ever safer (BadMessage).
  • STOP to a leg only from its hub; REPORT only to the hub, a report of this version’s layout with at most 16 holdings (BadMessage).
  • Any other message reverts (BadMessage).

handleReceiveUnfinalizedMessage

function handleReceiveUnfinalizedMessage(
    uint32 sourceDomain,
    bytes32 sender,
    uint32,
    bytes calldata body
) external returns (bool)

The same as handleReceiveFinalizedMessage for a message Circle attested before finality: only a STOP is accepted then.

Who may call: Circle’s message transmitter.

When: In every state.

Parameters

NameTypeDescription
sourceDomainuint32The message’s chain, as its Circle domain: it must be the sending member’s own.
senderbytes32The sending member, as a word.
—uint32Unnamed in the code: not used.
bodybytesThe message: its tag (READY, STOP or REPORT), the sender’s code version and its fields.

What it checks

  • As handleReceiveFinalizedMessage, every kind but STOP refused (BadMessage).

Anyone

Any address. These functions take no recipient and act only as the code allows: they move nothing anywhere the owner did not choose.

endRun

function endRun() external

Closes a run that settled and is not unwinding; otherwise nothing changes. Adding capital again then starts a new run.

Who may call: Anyone.

When: Once the run settled.

stopStopped

function stopStopped() external

The escape hatch: once the registry stopped the run’s group (DLTX’s check-ins stopped for 7 days), or the registry fails to answer, anyone stops the strategy as the owner’s stop does. A hub already stopped with no run going is left as it is: the hatch never restarts an unwind that ended.

Who may call: Anyone.

When: Once stopped(group) is true on the registry, or the registry’s read fails or answers neither 0 nor 1, with a run recorded.

What it checks

  • A run is recorded (NoRun) and the registry says its group is stopped (GroupNotStopped).

fallback

fallback() external

Runs a function this contract does not declare itself: the member type’s own modules’ (each listed on this page), by DELEGATECALL in this contract’s storage. Any other call reverts (Unsupported).

Who may call: Anyone: each function it reaches checks its own caller.

When: Always.

announceReady

function announceReady(uint8 k) external

Resends this leg’s READY to member k on another chain, at finalized. Until it arrives that member sends this leg no money.

Who may call: Anyone.

When: In any state. The hub never announces itself (a leg’s hub can always receive), and refuses (NotAllowed).

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).

What it checks

  • This is a leg, and link k exists and lives on another chain (NotAllowed).
  • Circle accepts the message (it reverts as Circle does).

tellHub

function tellHub() external

Tells the hub of a stop it was not yet told of (a stop by the escape hatch or by the owner’s Stop whose telling failed): on the hub’s chain by a call, else by a fast Circle message.

Who may call: Anyone.

When: While a telling is pending.

What it checks

  • This is a leg with a telling pending (NotAllowed).
  • It reverts as the hub or Circle does.

claimFee

function claimFee() external

Pays the fees set aside to the fee address the registry names now; nothing when there is none or the transfer is refused.

Who may call: Anyone: it takes no recipient.

When: In any state.

receiveMint

function receiveMint(
    bytes calldata message,
    bytes calldata attestation
) external

Completes a Circle mint bound to the hub and counts it: a burn by one of its legs as received from that leg, any other uncounted, the owner’s capital at the next sync (ReceivedFromOutside).

Who may call: Anyone relaying Circle’s attested message.

When: In every state.

Parameters

NameTypeDescription
messagebytesCircle’s message.
attestationbytesCircle’s attestation of it.

What it checks

  • The message is a burn addressed to this chain’s Circle token messenger, with this hub as the caller and the recipient, to this chain (BadMessage).
  • Circle accepts it (its attestation and nonce) and exactly the amount less Circle’s fee arrives (BadMessage).

tellStop

function tellStop(uint8 k) external

Tells link k on another chain of the stop it was not yet told of, by a fast Circle message.

Who may call: Anyone.

When: While the stop holds (revoked or unwinding) and that telling is pending.

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).

What it checks

  • The stop holds, link k exists and its telling is pending (NotAllowed); it reverts as Circle does.

unwindStep

function unwindStep() external

One step of the unwind: each leg on this chain stopped unless it is unwinding or its own unwind ended at this run (a refusal logged); then the hub’s free USDC to each leg that owes (unwindRoute), then the rest beyond what the legs still owe to the owner, DLTX’s fee taken on the way (unwindSettle), each run alone and its failure logged; then the end, once settled.

Who may call: Anyone: the rules fix every amount and destination.

When: While unwinding, as often as needed.

What it checks

  • Unwinding (NotAllowed).
  • Each route and the settlement is admitted only with the gas it needs (GasTooLow).

finishIfSettled

function finishIfSettled() external

Once the strategy is settled, ends the unwind and the run. Otherwise nothing changes. The end writes the mark as the capital the unwind did not recover (never below 0), with or without cash settled.

Who may call: Anyone, or the hub itself after a report.

When: While unwinding.

payHome

function payHome() external

Sends what reached the hub after its run ended home to the owner, as a payout: fee-free up to the mark, its part above the mark profit paying the performance fee then; the mark falls by it, never below 0.

Who may call: Anyone: it pays only the owner.

When: With no run going and no unwind.

What it checks

  • No run going and no unwind (NotAllowed).

The contract itself

Called only by the contract on itself, from inside one of its own functions, so that one part can fail without undoing the rest; refused from anyone else.

localToHub

function localToHub(uint256 amount) external

The same-chain half of a leg’s counted move to its hub, run as a call on itself so that its failure stays inside the move that tried it.

Who may call: This contract itself.

When: From inside a move home.

Parameters

NameTypeDescription
amountuint256The USDC to move, 6 decimals.

What it checks

  • The caller is this contract (NotAllowed).

remoteToHub

function remoteToHub(
    uint256 amount,
    uint256 fee
) external

The cross-chain half of a leg’s counted move to its hub: the USDC approval and Circle’s burn, run as a call on itself so that a token refusing either (paused, an address blocked) fails only the move, leaves no allowance and undoes nothing else its caller did, such as an unwind’s close.

Who may call: This contract itself.

When: From inside a move home.

Parameters

NameTypeDescription
amountuint256The USDC to burn, 6 decimals.
feeuint256Circle’s minimum fee on it, 6 decimals.

What it checks

  • The caller is this contract (NotAllowed).

unwindRoute

function unwindRoute(uint8 k) external

One route of unwindStep: to leg k what it states it owes, up to the hub’s free USDC. On this chain its owed() now, kept as its debt reading (a failed read keeps the last), by a counted transfer that may fail without reverting (the debt’s cash then stays at the hub); on another chain the debt of its latest report less what is on its way to it (nothing while the owner released it), at most 1,000,000 USDC, by a standard burn paying Circle’s minimum fee.

Who may call: The hub itself, from unwindStep.

When: While unwinding.

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).

What it checks

  • The caller is the hub (NotAllowed).
  • Circle’s minimum fee is at most 10 bp (FeeAboveCap).

unwindSettle

function unwindSettle() external

The settlement of unwindStep: everything the hub holds free to the owner beyond what the legs still need for their debts (a leg on this chain by its latest debt reading the unwind took, kept across a reading that fails, less what it was then sent; a leg on another chain by its latest report’s debt less what is on its way to it; unless the owner released it, releaseDebtReserve), as one payout: fee-free up to the mark, its part above the mark paying the performance fee at the rate in force, forgiven with no fee address.

Who may call: The hub itself, from unwindStep.

When: While unwinding.

What it checks

  • The caller is the hub (NotAllowed).

Read-only

Views and constants: they change nothing, and anyone may read them.

fundingToken

function fundingToken() external view returns (address)

The money this hub logic is built for, its chain’s USDC (a constructor argument): a creation reads it at the hub’s named logic and funds the new hub in it.

free

function free() external view returns (uint256)

What the hub may spend now, USDC units: its USDC less the fees set aside. Every payout, send, fee and unwind settlement is held to it.

settled

function settled() external view returns (bool)

Whether the strategy is settled: no unwind under way, nothing but dust (0.01 USDC) at the hub beyond the fees set aside, every leg settled, and nothing in flight between any two members (each pair’s counts of what one sent and the other received agree). A leg on this chain is read now, each read capped at 150,000 gas (a failed read reads unsettled); a leg on another chain by its latest report. Residue quarantined as unsellable does not hold it. While it is false, the owner’s Stop can still act.

members

function members() external view returns (address[] memory all)

Every member of the strategy: the hub first, then its legs in member order. Never lists zero.

reportOf

function reportOf(uint8 k) external view returns (HubReportStore.StoredReport memory)

Leg k’s latest stored report: its sequence number, its observation time (the leg’s clock), its arrival time (the hub’s) and its body.

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).

runState

function runState() external view returns (uint64 runEpoch, uint64 group, bool runActive)

The run: its number, its execution group and whether it is going.

Returns

NameTypeDescription
runEpochuint64The latest run’s number.
groupuint64Its execution group.
runActiveboolWhether it is going.

books

function books() external view returns (int256 mark, uint256 booked, uint256 feeOwed)

The hub’s books.

Returns

NameTypeDescription
markint256The high-water mark, USDC units: the value above which profit is new.
bookeduint256The part of the hub’s USDC its own counted moves explain; its balance above it is the owner’s capital.
feeOweduint256Fees whose transfer failed, set aside in the hub, outside the value, paid by claimFee.

MEMBER_TYPE

function MEMBER_TYPE() external view returns (uint8)

This implementation’s member type: 1, the hub.

kernelStopState

function kernelStopState() external view returns (uint64 runEpoch, uint64 stopCount)

The member’s recorded run and its count of stops, read by its kernel before and after the owner’s Stop.

Returns

NameTypeDescription
runEpochuint64The run the member records.
stopCountuint64The member’s count of stops.

kernelGroup

function kernelGroup() external view returns (uint64)

The group of the member’s recorded run, read by its kernel before a migration applies: a member migrates only from a run recorded in a group the successor registry keys.

Who may call: The member’s kernel only; refused from outside (Reserved).

ready

function ready(uint8 k) external view returns (bool)

Whether link k can receive money from this contract: a leg’s hub at once, a member on this chain once its code is there, a member on another chain once its finalized READY arrived.

Parameters

NameTypeDescription
kuint8A link of this contract, by its index among its links (a leg’s link 0 is its hub; the hub’s links are its legs, 0 the first).

memberInfo

function memberInfo(
) external view returns (address owner, address registry, uint32 number, uint8 memberType, address[] memory links, uint32[] memory linkDomains)

What this contract is, fixed at its creation.

Returns

NameTypeDescription
owneraddressThe owner’s wallet, as the member’s kernel holds it.
registryaddressThis chain’s registry, as the member’s kernel holds it.
numberuint32The release number the member runs.
memberTypeuint8Its member type.
linksaddress[]Every other member, in the kind’s order (a leg’s first is its hub).
linkDomainsuint32[]Each link’s chain, as its Circle domain.

control

function control(
) external view returns (uint64 runEpoch, uint64 group, bool runActive, bool revoked, bool unwinding, uint64 unwindStartedAt, uint64 stopCount)

Who may operate this contract and the run it follows.

Returns

NameTypeDescription
runEpochuint64The latest run recorded: the hub’s runs in order; at a leg, the latest run of its owner’s.
groupuint64That run’s execution group.
runActiveboolAt the hub: the run is going.
revokedboolThe execution key may not act; lifted only by the owner (its Allow).
unwindingboolAnyone may drive the unwind; it clears itself once settled.
unwindStartedAtuint64When the current or last unwind began.
stopCountuint64The count of stops: every stop raises it. An owner’s Allow names the count it was made at.

counters

function counters(
) external view returns (uint256[MAX_MEMBERS - 1] memory sentTo, uint256[MAX_MEMBERS - 1] memory receivedFrom, uint256[MAX_MEMBERS - 1] memory feesFrom)

The USDC this contract sent to, received from, and paid Circle on what came from, each link, ever. Each pair of members counts the same money twice, once at each end: while they disagree, money is in flight.

Returns

NameTypeDescription
sentTouint256[MAX_MEMBERS - 1]Gross USDC sent to each link.
receivedFromuint256[MAX_MEMBERS - 1]Gross USDC received from each link.
feesFromuint256[MAX_MEMBERS - 1]Circle’s fee on what each link sent here.

unwindState

function unwindState(
) external view returns (uint256 exitPaid, uint256 exitFeePaid, uint256 exitFeeForgiven, uint64 unwindStartedAt, uint8 stopBy, uint8 stopTellPending)

The unwind’s fee counters, when it began, who began it, and the links not yet told of the stop.

Returns

NameTypeDescription
exitPaiduint256Paid to the owner, a fee forgiven included.
exitFeePaiduint256Paid to DLTX’s fee address, transferred or set aside.
exitFeeForgivenuint256Forgiven for want of a fee address.
unwindStartedAtuint64When it began.
stopByuint8Who began it: 1 the owner, 2 the escape hatch, 3 a leg.
stopTellPendinguint8Bit k: link k not yet told of the stop.

lastOwnerNonce

function lastOwnerNonce() external view returns (uint64)

The highest owner nonce used at this hub; 0 none yet.

function kernelLinks(
) external view returns (IKernelLogic.Link[] memory links, bool oneChain)

The strategy, read by the hub’s kernel before an ownership transfer applies: its legs in the kind’s order, and whether every leg lives on this chain (the new owner may then sign by ERC-1271).

Returns

NameTypeDescription
linksIKernelLogic.Link[]Its legs, in the kind’s order, each as its chain id and address.
oneChainboolWhether every member lives on this chain.

payoutSettings

function payoutSettings() external view returns (bool collect)

The payout setting in force: collect (true) or compound.

limits

function limits() external view returns (uint16 fastFeeCapBp, uint16 feeBudgetBp)

The hub’s own bounds in force.

Returns

NameTypeDescription
fastFeeCapBpuint16The most a fast Circle transfer from the hub may pay, bp of its amount.
feeBudgetBpuint16The hub’s budget for Circle’s fees, bp.

pricePins

function pricePins() external view returns (bytes32 profile, PriceSourcePin[] memory pins)

The profile and the price pins the hub values with.

Returns

NameTypeDescription
profilebytes32The profile’s registry entry id.
pinsPriceSourcePin[]The price pins, in the profile’s order.

valuation

function valuation(
    uint80[] calldata rounds
) external view returns (bool ok, int256 v, bytes4 why, uint64[MAX_MEMBERS - 1] memory seqs)

The strategy’s value in USDC units, from the latest usable snapshot and the prices in effect at the instant of the legs’ reports, or why it can’t be formed. Every leg on another chain counts by its latest report, observed 1 to 3 minutes after the snapshot, at most 40 minutes old (a finalized message from Arbitrum takes about 13 to 19 minutes), and at least 3 blocks after its latest move to or from its venue; every leg on this chain must be unchanged since the snapshot (the same count of operations, every holding within 1 bp). The money between members counts once, by the pair terms. With the sequence number of each report it used: what the fee module’s charges ask of their own hub.

Parameters

NameTypeDescription
roundsuint80[]The round hints, as crystallize takes them.

Returns

NameTypeDescription
okboolWhether the value could be formed.
vint256The value, USDC units.
whybytes4Otherwise the reason’s selector.
seqsuint64[MAX_MEMBERS - 1]The sequence number of each link’s report it used, by link; 0 for a leg on the hub’s chain.

preview

function preview(
    uint80[] calldata rounds
) external view returns (bool ok, bytes32 why, int256 v, int256 markSynced, uint256 profit, uint256 cappedProfit, uint256 fee, uint256 chargeableAt)

What crystallize would charge now, with the reason when it can’t. The mark is shown as a charge would leave it after taking in what is not yet counted, so money sent to the hub never shows as profit.

Parameters

NameTypeDescription
roundsuint80[]The round hints, as crystallize takes them.

Returns

NameTypeDescription
okboolWhether the value could be formed.
whybytes32The performance fee’s reason it would not charge.
vint256The value.
markSyncedint256The mark after taking in what is not yet counted.
profituint256The profit above it.
cappedProfituint256The profit the daily cap counts.
feeuint256The performance fee.
chargeableAtuint256When the next performance charge may run.

payoutPreview

function payoutPreview(
    uint256 amount
) external view returns (uint256 toOwner, uint256 fee, int256 markAfter)

What a payout of amount would pay now: the owner’s part, the performance fee on the part above the mark as a sync would leave it (0 with no fee address), and the mark after.

Parameters

NameTypeDescription
amountuint256The gross payout, USDC.

Returns

NameTypeDescription
toOwneruint256What the owner would receive.
feeuint256The performance fee it would pay.
markAfterint256The mark after it.

collectable

function collectable() external view returns (uint256)

The profit crystallize recognised from a valuation, capped, net of its fee, and not yet collected: collect pays it to the owner, fee-free. A forged report can make it fictitious within the daily cap, and its collect then returns that much of the owner’s own capital to the owner. Never above the mark; a stop zeroes it.

Constants

Values compiled in, or set once when the contract is deployed (immutable).

address public immutable FEE;
address public immutable UNWIND;
address public immutable OWNER_MODULE;
address public immutable VALUE;
uint256 public immutable CHAIN_ID;
NameDescription
FEEThe fee module (fees, payouts, sends to the legs, asset profile), its code hash checked at deployment.
UNWINDThe unwind module (stop, unwind, bound residue), its code hash checked at deployment.
OWNER_MODULEThe owner module (the owner’s calls: capital, withdrawals, execution, the settings, the payout settings), its code hash checked at deployment.
VALUEThe value module (snapshot, valuation, the hub’s views), its code hash checked at deployment.
CHAIN_IDThe chain this code was built for: a member runs it only there, and its initialisation refuses any other (WrongChain).

Events

SettingApplied event

event SettingApplied(uint8 key, bytes32 value);

A setting of the hub is in force.

Emitted by: setSetting, setSettingSigned

Fields

NameTypeDescription
keyuint8The setting.
valuebytes32The value.

PayoutSettings event

event PayoutSettings(bool collect);

The owner set the payout setting.

Emitted by: setPayout

Fields

NameTypeDescription
collectboolCollect (true) or compound.

HubStopped event

event HubStopped(uint64 indexed runEpoch, uint8 by);

The strategy stopped.

Emitted by: —

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.
byuint8Who stopped the run: 1 the owner, 2 the escape hatch, 3 another member of the strategy.

StopTold event

event StopTold(uint8 indexed link);

Link link was told of the stop.

Emitted by: tellStop

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.

StopTellPending event

event StopTellPending(uint8 indexed link);

Circle refused telling link link of the stop: tellStop retries it.

Emitted by: —

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.

UnwindRouteFailed event

event UnwindRouteFailed(uint8 indexed link, bytes reason);

An unwind route to link link failed; the next step retries it.

Emitted by: unwindStep, unwindRoute

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.
reasonbytesIts revert data.

UnwindStopFailed event

event UnwindStopFailed(uint8 indexed link, bytes reason);

Link link on this chain refused the unwind’s stop.

Emitted by: unwindStep

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.
reasonbytesIts revert data.

UnwindSettleFailed event

event UnwindSettleFailed(bytes reason);

An unwind’s settlement failed; the next step retries it.

Emitted by: unwindStep

Fields

NameTypeDescription
reasonbytesIts revert data.

PaidHome event

event PaidHome(uint256 amount);

A late arrival went home to the owner.

Emitted by: payHome

Fields

NameTypeDescription
amountuint256The USDC.

ReadySent event

event ReadySent(uint8 indexed link);

This leg’s READY went to link link.

Emitted by: kernelInit, announceReady

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.

ReadyPending event

event ReadyPending(uint8 indexed link);

Circle refused this leg’s READY to link link: announceReady resends it.

Emitted by: kernelInit, announceReady

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.

LinkReady event

event LinkReady(uint8 indexed link);

Link link’s finalized READY arrived: it may now receive money from this contract.

Emitted by: handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.

Sent event

event Sent(uint8 indexed link, uint256 amount, uint256 maxFee, uint32 finality);

USDC went to link link: on this chain by a counted transfer (maxFee and finality 0), else by a Circle burn only that link can complete.

Emitted by: send, localToHub, remoteToHub, unwindRoute

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.
amountuint256The USDC sent, gross.
maxFeeuint256The most Circle may take.
finalityuint32Circle’s finality: 1000 fast (confirmed), 2000 standard (finalized), 0 on this chain.
event ReceivedFromLink(uint8 indexed link, uint256 amount, uint256 fee);

USDC from link link arrived and was counted.

Emitted by: receiveLocal, receiveMint

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.
amountuint256The USDC, gross.
feeuint256Circle’s fee taken on it (0 on this chain).

ReceivedFromOutside event

event ReceivedFromOutside(address indexed from, uint32 sourceDomain, uint256 amount);

A Circle mint from a burn of no member arrived, net of Circle’s fee. Nothing is booked for it: at a leg it is the leg’s cash like any USDC it holds (the strategy’s, profit above the mark), at the hub it is the owner’s capital at the next sync (CapitalIn).

Emitted by: receiveMint

Fields

NameTypeDescription
fromaddress · indexedWho burned it, on its chain.
sourceDomainuint32Its chain, as its Circle domain.
amountuint256The USDC that arrived, net of Circle’s fee.

ReportSent event

event ReportSent(uint64 seq);

This leg sent its report to its hub.

Emitted by: —

Fields

NameTypeDescription
sequint64The report’s sequence number.

RunRecorded event

event RunRecorded(uint64 indexed runEpoch, uint64 group);

This leg recorded its owner’s run.

Emitted by: —

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.
groupuint64The run’s execution group.

Stopped event

event Stopped(uint64 indexed runEpoch, uint8 by);

The run stopped here: the execution key revoked, the unwind begun.

Emitted by: stopFromHub, handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.
byuint8Who stopped the run: 1 the owner, 2 the escape hatch, 3 another member of the strategy.

ExecutionAllowed event

event ExecutionAllowed(uint64 indexed runEpoch);

The owner’s Allow at this member, the hub or a leg alike: the execution key may act here again.

Emitted by: allow, allowSigned

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.

Unwound event

event Unwound(uint64 indexed runEpoch);

The unwind ended here: this contract is settled. The stop stays until the owner allows execution.

Emitted by: unwindStep, finishIfSettled

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.

HubToldPending event

event HubToldPending();

Telling the hub of a stop failed: tellHub retries it.

Emitted by: tellHub

HubTold event

event HubTold();

The hub was told of this leg’s stop.

Emitted by: tellHub

LocalExitPaid event

event LocalExitPaid(address token, uint256 amount);

A leg’s local exit paid a token to the owner on the leg’s chain: no bridge, no fee, nothing counted toward the hub.

Emitted by: —

Fields

NameTypeDescription
tokenaddressThe token; 0 for the chain’s native coin (HYPE on HyperEVM).
amountuint256What it paid, the token’s units.

CapitalAdded event

event CapitalAdded(uint256 amount, uint64 group, uint64 runEpoch);

The owner added capital to the strategy.

Emitted by: kernelInit, addCapital

Fields

NameTypeDescription
amountuint256The USDC.
groupuint64The run’s execution group.
runEpochuint64A run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.

RunStarted event

event RunStarted(uint64 indexed runEpoch, uint64 group);

A new run started.

Emitted by: kernelInit, addCapital

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.
groupuint64Its execution group.

RunEnded event

event RunEnded(uint64 indexed runEpoch);

A run ended.

Emitted by: endRun, kernelInit, unwindStep, finishIfSettled, addCapital

Fields

NameTypeDescription
runEpochuint64 · indexedA run’s number. A leg records a run only from its owner’s Run (signed, or the owner’s call), only above the one it records; a stop never moves it.

WithdrawRequested event

event WithdrawRequested(uint256 amount);

The owner asked for money back.

Emitted by: kernelInit, addCapital, requestWithdraw, requestWithdrawSigned, kernelTransferred

Fields

NameTypeDescription
amountuint256The USDC asked back; type(uint256).max for everything.

ReportReceived event

event ReportReceived(uint8 indexed link, uint64 seq, uint64 observedAt);

A leg’s report was stored.

Emitted by: —

Fields

NameTypeDescription
linkuint8 · indexedThe link concerned, by its index.
sequint64Its sequence number.
observedAtuint64Its observation time.

ReportDropped event

event ReportDropped(uint8 indexed link, uint64 seq, bytes4 why);

A leg’s report was dropped unstored: its sequence number more than 65,536 above the last kept (TooFarAhead), or a counter beyond the figures’ range (ValueOutOfRange). Its delivery completes and nothing changes.

Emitted by: —

Fields

NameTypeDescription
linkuint8 · indexedThe leg’s link.
sequint64The report’s sequence number.
whybytes4The reason, an error’s selector.

ReportsReset event

event ReportsReset(uint8 indexed link);

The owner reset a leg’s report stream: its next report is kept whatever its sequence number.

Emitted by: resetReports

Fields

NameTypeDescription
linkuint8 · indexedThe leg’s link.

DebtReserveReleased event

event DebtReserveReleased(uint256 amount);

The owner released what the unwind kept at the hub for the legs’ debts.

Emitted by: releaseDebtReserve

Fields

NameTypeDescription
amountuint256The USDC released.

Payout event

event Payout(address indexed to, uint256 amount);

USDC went to the owner.

Emitted by: payout, collect, unwindSettle, payHome

Fields

NameTypeDescription
toaddress · indexedThe owner’s wallet.
amountuint256The USDC.

PayoutFee event

event PayoutFee(uint256 profit, uint256 fee, uint256 forgiven, uint16 rateBp);

A payout’s part above the mark paid the performance fee at once.

Emitted by: payout, collect, unwindSettle, payHome

Fields

NameTypeDescription
profituint256The payout’s part above the mark.
feeuint256To DLTX’s fee address, transferred or set aside.
forgivenuint256Kept by the owner for want of a fee address.
rateBpuint16The rate in force, bp.

CapitalIn event

event CapitalIn(uint256 amount);

USDC that reached the hub outside its counted moves was taken in as the owner’s capital: the mark rose by it, no fee.

Emitted by: send, crystallize, payout, collect, unwindStep, payHome, addCapital

Fields

NameTypeDescription
amountuint256The USDC.

Snapshot event

event Snapshot(uint64 takenAt);

A valuation’s snapshot was taken.

Emitted by: snapshot

Fields

NameTypeDescription
takenAtuint64When it was taken.

FeeCharged event

event FeeCharged(
    int256 value,
    int256 markBefore,
    uint256 profit,
    uint256 fee,
    int256 mark,
    uint16 rateBp,
    uint64 snapshotAt,
    uint64[MAX_MEMBERS - 1] reportSeqs
);

A performance fee was charged (or, while a rate raise waits, a charge of 0 moved the mark).

Emitted by: crystallize

Fields

NameTypeDescription
valueint256The value it was charged on.
markBeforeint256The mark before.
profituint256The profit counted, capped.
feeuint256The fee.
markint256The mark after.
rateBpuint16The rate it was charged at.
snapshotAtuint64The valuation’s snapshot.
reportSeqsuint64[MAX_MEMBERS - 1]The sequence number of each leg’s report used (0 for a leg on this chain).

FeeDeferred event

event FeeDeferred(bytes4 why);

A performance fee was not charged.

Emitted by: crystallize

Fields

NameTypeDescription
whybytes4The reason’s selector.

FeeSetAside event

event FeeSetAside(uint256 amount);

A fee transfer was refused: the fee is set aside in the hub, for claimFee.

Emitted by: crystallize, payout, collect, unwindSettle, payHome

Fields

NameTypeDescription
amountuint256The fee.

FeeClaimed event

event FeeClaimed(address indexed to, uint256 amount);

Fees set aside were paid.

Emitted by: claimFee

Fields

NameTypeDescription
toaddress · indexedThe fee address.
amountuint256The USDC.

FeeRateSet event

event FeeRateSet(uint16 previous, uint16 next, address indexed by);

The performance fee’s rate changed.

Emitted by: crystallize, setFeeRate

Fields

NameTypeDescription
previousuint16The rate before, bp.
nextuint16The rate now, bp.
byaddress · indexedRecovery, or the hub itself when a raise waiting takes effect.

FeeRatePending event

event FeeRatePending(uint16 current, uint16 pending, address indexed by);

A performance rate raise is waiting for its first clean charge on a value snapshotted in a later block than this event.

Emitted by: setFeeRate

Fields

NameTypeDescription
currentuint16The rate now, bp.
pendinguint16The rate waiting, bp.
byaddress · indexedThe admin key.

ExitSettled event

event ExitSettled(uint256 exitFeePaid, uint256 exitFeeForgiven, uint256 exitPaid);

An unwind step paid the owner and charged its fee.

Emitted by: unwindSettle

Fields

NameTypeDescription
exitFeePaiduint256Its fee paid so far.
exitFeeForgivenuint256Its fee forgiven so far.
exitPaiduint256Paid to the owner so far.

Collected event

event Collected(uint256 amount);

A collect paid profit to the owner (its Payout beside it).

Emitted by: collect

Fields

NameTypeDescription
amountuint256The USDC.

Errors

A call that fails reverts with one of these, so a block explorer or a simulation shows which rule refused it.

ErrorWhenRaised by
BadMessage()A message, a mint or a report refused: its sender, chain, finality, kind, layout or amount.receiveReport, legStopped, receiveLocal, handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage, receiveMint
LowGas()The caller left too little gas for a registry read (30,000 gas and its margin): the whole call reverts, so a starved read never opens the hatch or forgives a fee.—
NoKey()The registry has no execution key for the group: no run starts in it and no member moves into it, since nobody could protect it.—
GroupStopped()The registry has stopped the run’s group, or failed to say it did not.—
BadProfile()The asset profile is refused for this contract.setSetting, setSettingSigned
StalePrice()A price source's answer is older than its pin allows, or its rate lies too far under par.—
BadRound()A price source answered a round that is not usable: no answer, zero or negative, or unfinished.—
SequencerDown()The chain's sequencer feed reports it down, or back up too recently for prices to be trusted.—
ValueOutOfRange()A figure the fee arithmetic was handed lies outside the range it accepts.—
NotNamed()The signed message does not name this member on this chain.—
StaleNonce()The signed message's nonce is not above the last one this member used.—
Expired()The signed message's deadline has passed.—
NotOwner()The caller is not the owner’s wallet.addCapital, requestWithdraw, allow, setPayout, resetReports, releaseDebtReserve, setSetting
StaleGeneration()The signed message names an owner generation other than the current one: the owner changed since.—
UnknownSetting()No such setting for that member’s type: every other parameter is fixed for the member’s life.setSetting, setSettingSigned
BadLinks()The links at creation: none, more than 4, a zero, a repeat, this contract, or the hub’s chain misstated.kernelInit
WrongMember()The kind does not name this logic’s member type at this member’s place.kernelInit
WrongChain()The kind places this member on another chain, or this code was built for another chain.kernelInit
NotExecution()The caller is not the execution key of the run’s group.send, crystallize, payout, collect, snapshot
NotAllowed()The caller is not the one this function admits, or the state does not allow it.send, free, settled, members, reportOf, runState, books, kernelInit, kernelUpgraded, kernelStop, kernelStopState, kernelGroup, announceReady, receiveLocal, stopFromHub, tellHub, localToHub, remoteToHub, claimFee, crystallize, payout, setFeeRate, collect, receiveMint, tellStop, unwindStep, unwindRoute, unwindSettle, finishIfSettled, payHome, unwindState, lastOwnerNonce, addCapital, requestWithdraw, requestWithdrawSigned, allow, allowSigned, kernelLinks, kernelTransferred, setPayout, resetReports, releaseDebtReserve, payoutSettings, setSetting, setSettingSigned, limits, pricePins, snapshot, valuation, preview, payoutPreview, collectable
NotReady()The link cannot receive yet: its code is not there, or its finalized READY has not arrived.send, setSetting, setSettingSigned
Unwinding()Refused while unwinding: the execution key may not act.send, crystallize, payout, collect, addCapital, setSetting, setSettingSigned, snapshot
Revoked()Refused while the execution key is revoked.send, crystallize, payout, collect, addCapital, snapshot
NoRun()No run is recorded (or, at the hub, none is going).send, crystallize, payout, collect, snapshot
WrongRun()The owner’s Allow names another run than the one the member records.allow, allowSigned
StaleStop()The owner’s Allow names another count of stops than the member’s: a stop since it was made voids it.allow, allowSigned
OwnersDiffer()A member the profile switch reaches has another owner or owner generation than the member sending it: members change owners one by one.setSetting, setSettingSigned
AlreadyStopped()The member is already stopped: the owner’s Stop is refused there.kernelStop
GroupNotStopped()The escape hatch is shut: the registry answered that this group is not stopped (a read that fails, or answers malformed, reads as stopped).—
FeeAboveCap()Circle’s minimum fee is above 10 bp of the amount, or a fast transfer’s fee above its cap.send, unwindRoute
OverFeeBudget()Circle’s fees of the last two UTC days, this one included, would exceed the daily fee budget.send
Reentrancy()A call into this contract from inside one of its own.endRun, send, receiveReport, legStopped, kernelStop, receiveLocal, stopFromHub, handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage, claimFee, crystallize, payout, setFeeRate, collect, receiveMint, tellStop, unwindStep, payHome, addCapital, allow, allowSigned, setSetting, setSettingSigned, snapshot
Unsupported()No function of this contract or its modules answers that call.fallback
ZeroAmount()An amount of zero.send, kernelInit, collect, addCapital
GasTooLow()Less gas left than a tried message, a part or an action needs: the call reverts rather than skipping it.kernelInit, announceReady, tellHub, tellStop, unwindStep, unwindRoute
RunNotAdmitted()The owner’s run is refused at this leg: a position is open here.—
WrongGroup()An addition of capital names another group than the run holding money.addCapital
BadParams()The hub’s parameters are refused: their length, a bound, or a profile not open.kernelInit, setSetting, setSettingSigned
TooFarAhead()A reason only, never raised: a report’s sequence number more than 65,536 above the last kept (ReportDropped).—
NoSnapshot()No snapshot, or one older than 40 minutes.—
SnapshotIncomplete()A leg’s report was not observed 1 to 3 minutes after the snapshot.—
StaleReport()A leg on another chain never reported, or its report is older than 40 minutes.—
FutureReport()A report observed more than a minute ahead of this chain’s clock.—
MoveSettling()A report observed less than 3 blocks after its leg’s latest move to or from its venue.—
UnknownAsset()A holding of an asset no price pin values.—
PositionMoved()A leg on this chain changed since the snapshot, or answered a reading the valuation cannot use.snapshot
TooSoon()No fee is due yet: less than a day since the last.crystallize
NeedUsdc()The hub’s free USDC does not cover the amount (and the fee it charges).send, kernelInit, crystallize, payout, collect
NoFeeAddress()The registry names no fee address: the fee waits.—
BadRate()A rate above its cap, or a raise while unwinding.setFeeRate
NotCollecting()The owner’s payout settings say compound.collect
AboveProfit()Above the profit this call’s charge counted, net of every fee charged and owed.collect
BadModule()At deployment: a module whose code hash or deployment is not the pinned one.the deployment (constructor)

Types

PriceSourcePin struct

One price pin of the profile, on the hub’s chain: the hub’s Circle domain, the asset id it prices, its kind (1 a USD feed, 2 a rate times a base’s USD feed), the feed, the base feed (zero for kind 1) and the oldest round it accepts, seconds.

struct PriceSourcePin {
    bytes32 asset;
    uint8 kind;
    address feed;
    address baseFeed;
    uint32 maxAge;
}

On this page

The owner’s wallet, by signaturerequestWithdrawSignedallowSignedsetSettingSignedThe owner’s walletaddCapitalrequestWithdrawallowsetPayoutresetReportsreleaseDebtReservesetSettingDLTX’s execution keysendcrystallizepayoutcollectsnapshotDLTX’s admin key, on the registrysetFeeRateThe kernelkernelInitkernelUpgradedkernelStopkernelTransferredAnother contract of the strategyreceiveReportlegStoppedreceiveLocalstopFromHubCircle’s message transmitterhandleReceiveFinalizedMessagehandleReceiveUnfinalizedMessageAnyoneendRunstopStoppedfallbackannounceReadytellHubclaimFeereceiveMinttellStopunwindStepfinishIfSettledpayHomeThe contract itselflocalToHubremoteToHubunwindRouteunwindSettleRead-onlyfundingTokenfreesettledmembersreportOfrunStatebooksMEMBER_TYPEkernelStopStatekernelGroupreadymemberInfocontrolcountersunwindStatelastOwnerNoncekernelLinkspayoutSettingslimitspricePinsvaluationpreviewpayoutPreviewcollectableConstantsEventsSettingApplied eventPayoutSettings eventHubStopped eventStopTold eventStopTellPending eventUnwindRouteFailed eventUnwindStopFailed eventUnwindSettleFailed eventPaidHome eventReadySent eventReadyPending eventLinkReady eventSent eventReceivedFromLink eventReceivedFromOutside eventReportSent eventRunRecorded eventStopped eventExecutionAllowed eventUnwound eventHubToldPending eventHubTold eventLocalExitPaid eventCapitalAdded eventRunStarted eventRunEnded eventWithdrawRequested eventReportReceived eventReportDropped eventReportsReset eventDebtReserveReleased eventPayout eventPayoutFee eventCapitalIn eventSnapshot eventFeeCharged eventFeeDeferred eventFeeSetAside eventFeeClaimed eventFeeRateSet eventFeeRatePending eventExitSettled eventCollected eventErrorsTypesPriceSourcePin struct