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
) externalAs requestWithdraw, by the owner’s signed RequestWithdraw relayed by anyone.
Who may call: Anyone, relaying the owner’s signature.
When: At any time.
Parameters
| Name | Type | Description |
|---|---|---|
m | OwnerMessages.RequestWithdraw | The owner’s signed RequestWithdraw, naming this member’s chain id and address. |
sig | bytes | The 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
) externalAs allow, by the owner’s signed Allow relayed by anyone.
Who may call: Anyone, relaying the owner’s signature.
When: After a stop.
Parameters
| Name | Type | Description |
|---|---|---|
m | OwnerMessages.Allow | The owner’s signed Allow, naming this member’s chain id and address. |
sig | bytes | The 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. runEpochthe 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
) externalAs setSetting, by the owner’s signed SetSetting relayed by anyone.
Who may call: Anyone, relaying the owner’s signature.
When: Outside an unwind.
Parameters
| Name | Type | Description |
|---|---|---|
m | OwnerMessages.SetSetting | The owner’s signed SetSetting, naming this member’s chain id and address. |
sig | bytes | The 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 assetSetting’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
) externalTakes 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC to pull, 6 decimals. |
group | uint64 | The 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) externalRecords 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The 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
) externalLifts 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 | The hub’s run (control().runEpoch). |
stopCount | uint64 | The hub’s count of stops the owner decided at (control().stopCount). |
What it checks
- The caller is the owner (
NotOwner). runEpochthe hub’s run (WrongRun).- The hub’s count of stops is
stopCount(StaleStop).
setPayout
function setPayout(bool collect) externalSets 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
| Name | Type | Description |
|---|---|---|
collect | bool | True to collect, false to compound. |
What it checks
- The caller is the owner (
NotOwner).
resetReports
function resetReports(uint8 k) externalResets 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
| Name | Type | Description |
|---|---|---|
k | uint8 | The link whose stream is reset (0 to 3, in member order). |
What it checks
- The caller is the owner (
NotOwner). kis one of the hub’s links (NotAllowed).
releaseDebtReserve
function releaseDebtReserve() externalReleases 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
) externalSets 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
| Name | Type | Description |
|---|---|---|
key | uint8 | The setting (Settings). |
value | bytes32 | The 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
) externalSends 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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). |
amount | uint256 | The USDC to send, 6 decimals. |
fast | bool | Across 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. |
maxFee | uint256 | For 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); legkis 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) externalCharges 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
| Name | Type | Description |
|---|---|---|
rounds | uint80[] | 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) externalPays 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The 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) externalIn 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The 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() externalRecords, 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) externalSets 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
| Name | Type | Description |
|---|---|---|
newBp | uint16 | The 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) externalInitialises 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
| Name | Type | Description |
|---|---|---|
data | bytes | The 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) externalRuns 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
| Name | Type | Description |
|---|---|---|
| — | uint32 | Unnamed in the code: not used. |
What it checks
- The member is initialised (
NotAllowed).
kernelStop
function kernelStop() externalStops 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() externalRuns 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) externalStores 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
| Name | Type | Description |
|---|---|---|
body | bytes | The 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) externalA 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 | The run the leg stopped. |
What it checks
- The caller is a link on this chain (
BadMessage).
receiveLocal
function receiveLocal(uint256 amount) externalPulls 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The 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) externalStops 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
| Name | Type | Description |
|---|---|---|
by | uint8 | Who 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
| Name | Type | Description |
|---|---|---|
sourceDomain | uint32 | The message’s chain, as its Circle domain: it must be the sending member’s own. |
sender | bytes32 | The sending member, as a word. |
finality | uint32 | The finality Circle attested the message at: 2000 finalized, 1000 confirmed. |
body | bytes | The 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). READYandREPORTneed finalized;STOPis taken at any finality: a stop is only ever safer (BadMessage).STOPto a leg only from its hub;REPORTonly 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
| Name | Type | Description |
|---|---|---|
sourceDomain | uint32 | The message’s chain, as its Circle domain: it must be the sending member’s own. |
sender | bytes32 | The sending member, as a word. |
| — | uint32 | Unnamed in the code: not used. |
body | bytes | The message: its tag (READY, STOP or REPORT), the sender’s code version and its fields. |
What it checks
- As
handleReceiveFinalizedMessage, every kind butSTOPrefused (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() externalCloses 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() externalThe 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() externalRuns 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) externalResends 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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
kexists and lives on another chain (NotAllowed). - Circle accepts the message (it reverts as Circle does).
tellHub
function tellHub() externalTells 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() externalPays 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
) externalCompletes 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
| Name | Type | Description |
|---|---|---|
message | bytes | Circle’s message. |
attestation | bytes | Circle’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) externalTells 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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
kexists and its telling is pending (NotAllowed); it reverts as Circle does.
unwindStep
function unwindStep() externalOne 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() externalOnce 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() externalSends 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) externalThe 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC to move, 6 decimals. |
What it checks
- The caller is this contract (
NotAllowed).
remoteToHub
function remoteToHub(
uint256 amount,
uint256 fee
) externalThe 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC to burn, 6 decimals. |
fee | uint256 | Circle’s minimum fee on it, 6 decimals. |
What it checks
- The caller is this contract (
NotAllowed).
unwindRoute
function unwindRoute(uint8 k) externalOne 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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() externalThe 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 | The latest run’s number. |
group | uint64 | Its execution group. |
runActive | bool | Whether it is going. |
books
function books() external view returns (int256 mark, uint256 booked, uint256 feeOwed)The hub’s books.
Returns
| Name | Type | Description |
|---|---|---|
mark | int256 | The high-water mark, USDC units: the value above which profit is new. |
booked | uint256 | The part of the hub’s USDC its own counted moves explain; its balance above it is the owner’s capital. |
feeOwed | uint256 | Fees 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 | The run the member records. |
stopCount | uint64 | The 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
| Name | Type | Description |
|---|---|---|
k | uint8 | A 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
| Name | Type | Description |
|---|---|---|
owner | address | The owner’s wallet, as the member’s kernel holds it. |
registry | address | This chain’s registry, as the member’s kernel holds it. |
number | uint32 | The release number the member runs. |
memberType | uint8 | Its member type. |
links | address[] | Every other member, in the kind’s order (a leg’s first is its hub). |
linkDomains | uint32[] | 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 | The latest run recorded: the hub’s runs in order; at a leg, the latest run of its owner’s. |
group | uint64 | That run’s execution group. |
runActive | bool | At the hub: the run is going. |
revoked | bool | The execution key may not act; lifted only by the owner (its Allow). |
unwinding | bool | Anyone may drive the unwind; it clears itself once settled. |
unwindStartedAt | uint64 | When the current or last unwind began. |
stopCount | uint64 | The 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
| Name | Type | Description |
|---|---|---|
sentTo | uint256[MAX_MEMBERS - 1] | Gross USDC sent to each link. |
receivedFrom | uint256[MAX_MEMBERS - 1] | Gross USDC received from each link. |
feesFrom | uint256[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
| Name | Type | Description |
|---|---|---|
exitPaid | uint256 | Paid to the owner, a fee forgiven included. |
exitFeePaid | uint256 | Paid to DLTX’s fee address, transferred or set aside. |
exitFeeForgiven | uint256 | Forgiven for want of a fee address. |
unwindStartedAt | uint64 | When it began. |
stopBy | uint8 | Who began it: 1 the owner, 2 the escape hatch, 3 a leg. |
stopTellPending | uint8 | Bit 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.
kernelLinks
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
| Name | Type | Description |
|---|---|---|
links | IKernelLogic.Link[] | Its legs, in the kind’s order, each as its chain id and address. |
oneChain | bool | Whether 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
| Name | Type | Description |
|---|---|---|
fastFeeCapBp | uint16 | The most a fast Circle transfer from the hub may pay, bp of its amount. |
feeBudgetBp | uint16 | The 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
| Name | Type | Description |
|---|---|---|
profile | bytes32 | The profile’s registry entry id. |
pins | PriceSourcePin[] | 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
| Name | Type | Description |
|---|---|---|
rounds | uint80[] | The round hints, as crystallize takes them. |
Returns
| Name | Type | Description |
|---|---|---|
ok | bool | Whether the value could be formed. |
v | int256 | The value, USDC units. |
why | bytes4 | Otherwise the reason’s selector. |
seqs | uint64[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
| Name | Type | Description |
|---|---|---|
rounds | uint80[] | The round hints, as crystallize takes them. |
Returns
| Name | Type | Description |
|---|---|---|
ok | bool | Whether the value could be formed. |
why | bytes32 | The performance fee’s reason it would not charge. |
v | int256 | The value. |
markSynced | int256 | The mark after taking in what is not yet counted. |
profit | uint256 | The profit above it. |
cappedProfit | uint256 | The profit the daily cap counts. |
fee | uint256 | The performance fee. |
chargeableAt | uint256 | When 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The gross payout, USDC. |
Returns
| Name | Type | Description |
|---|---|---|
toOwner | uint256 | What the owner would receive. |
fee | uint256 | The performance fee it would pay. |
markAfter | int256 | The 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;| Name | Description |
|---|---|
FEE | The fee module (fees, payouts, sends to the legs, asset profile), its code hash checked at deployment. |
UNWIND | The unwind module (stop, unwind, bound residue), its code hash checked at deployment. |
OWNER_MODULE | The owner module (the owner’s calls: capital, withdrawals, execution, the settings, the payout settings), its code hash checked at deployment. |
VALUE | The value module (snapshot, valuation, the hub’s views), its code hash checked at deployment. |
CHAIN_ID | The 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
| Name | Type | Description |
|---|---|---|
key | uint8 | The setting. |
value | bytes32 | The value. |
PayoutSettings event
event PayoutSettings(bool collect);The owner set the payout setting.
Emitted by: setPayout
Fields
| Name | Type | Description |
|---|---|---|
collect | bool | Collect (true) or compound. |
HubStopped event
event HubStopped(uint64 indexed runEpoch, uint8 by);The strategy stopped.
Emitted by: —
Fields
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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. |
by | uint8 | Who 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The link concerned, by its index. |
reason | bytes | Its 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The link concerned, by its index. |
reason | bytes | Its revert data. |
UnwindSettleFailed event
event UnwindSettleFailed(bytes reason);An unwind’s settlement failed; the next step retries it.
Emitted by: unwindStep
Fields
| Name | Type | Description |
|---|---|---|
reason | bytes | Its revert data. |
PaidHome event
event PaidHome(uint256 amount);A late arrival went home to the owner.
Emitted by: payHome
Fields
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC. |
ReadySent event
event ReadySent(uint8 indexed link);This leg’s READY went to link link.
Emitted by: kernelInit, announceReady
Fields
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The link concerned, by its index. |
amount | uint256 | The USDC sent, gross. |
maxFee | uint256 | The most Circle may take. |
finality | uint32 | Circle’s finality: 1000 fast (confirmed), 2000 standard (finalized), 0 on this chain. |
ReceivedFromLink event
event ReceivedFromLink(uint8 indexed link, uint256 amount, uint256 fee);USDC from link link arrived and was counted.
Emitted by: receiveLocal, receiveMint
Fields
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The link concerned, by its index. |
amount | uint256 | The USDC, gross. |
fee | uint256 | Circle’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
| Name | Type | Description |
|---|---|---|
from | address · indexed | Who burned it, on its chain. |
sourceDomain | uint32 | Its chain, as its Circle domain. |
amount | uint256 | The 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
| Name | Type | Description |
|---|---|---|
seq | uint64 | The report’s sequence number. |
RunRecorded event
event RunRecorded(uint64 indexed runEpoch, uint64 group);This leg recorded its owner’s run.
Emitted by: —
Fields
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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. |
group | uint64 | The 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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. |
by | uint8 | Who 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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
| Name | Type | Description |
|---|---|---|
token | address | The token; 0 for the chain’s native coin (HYPE on HyperEVM). |
amount | uint256 | What 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC. |
group | uint64 | The run’s execution group. |
runEpoch | uint64 | A 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
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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. |
group | uint64 | Its execution group. |
RunEnded event
event RunEnded(uint64 indexed runEpoch);A run ended.
Emitted by: endRun, kernelInit, unwindStep, finishIfSettled, addCapital
Fields
| Name | Type | Description |
|---|---|---|
runEpoch | uint64 · indexed | A 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The link concerned, by its index. |
seq | uint64 | Its sequence number. |
observedAt | uint64 | Its 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The leg’s link. |
seq | uint64 | The report’s sequence number. |
why | bytes4 | The 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
| Name | Type | Description |
|---|---|---|
link | uint8 · indexed | The 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC released. |
Payout event
event Payout(address indexed to, uint256 amount);USDC went to the owner.
Emitted by: payout, collect, unwindSettle, payHome
Fields
| Name | Type | Description |
|---|---|---|
to | address · indexed | The owner’s wallet. |
amount | uint256 | The 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
| Name | Type | Description |
|---|---|---|
profit | uint256 | The payout’s part above the mark. |
fee | uint256 | To DLTX’s fee address, transferred or set aside. |
forgiven | uint256 | Kept by the owner for want of a fee address. |
rateBp | uint16 | The 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC. |
Snapshot event
event Snapshot(uint64 takenAt);A valuation’s snapshot was taken.
Emitted by: snapshot
Fields
| Name | Type | Description |
|---|---|---|
takenAt | uint64 | When 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
| Name | Type | Description |
|---|---|---|
value | int256 | The value it was charged on. |
markBefore | int256 | The mark before. |
profit | uint256 | The profit counted, capped. |
fee | uint256 | The fee. |
mark | int256 | The mark after. |
rateBp | uint16 | The rate it was charged at. |
snapshotAt | uint64 | The valuation’s snapshot. |
reportSeqs | uint64[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
| Name | Type | Description |
|---|---|---|
why | bytes4 | The 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The fee. |
FeeClaimed event
event FeeClaimed(address indexed to, uint256 amount);Fees set aside were paid.
Emitted by: claimFee
Fields
| Name | Type | Description |
|---|---|---|
to | address · indexed | The fee address. |
amount | uint256 | The USDC. |
FeeRateSet event
event FeeRateSet(uint16 previous, uint16 next, address indexed by);The performance fee’s rate changed.
Emitted by: crystallize, setFeeRate
Fields
| Name | Type | Description |
|---|---|---|
previous | uint16 | The rate before, bp. |
next | uint16 | The rate now, bp. |
by | address · indexed | Recovery, 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
| Name | Type | Description |
|---|---|---|
current | uint16 | The rate now, bp. |
pending | uint16 | The rate waiting, bp. |
by | address · indexed | The 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
| Name | Type | Description |
|---|---|---|
exitFeePaid | uint256 | Its fee paid so far. |
exitFeeForgiven | uint256 | Its fee forgiven so far. |
exitPaid | uint256 | Paid 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | The USDC. |
Errors
A call that fails reverts with one of these, so a block explorer or a simulation shows which rule refused it.
| Error | When | Raised 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;
}