The prime broker

Mandate and its checks

Eleven checks, in the contract's order. The first failure stops the trade.

Local chain Built and tested on a local chain. Not deployed to a public network, not audited.

The checks

#CheckReason code
01The agent's key is inside its expiryKeyExpired
02The mandate is running (no loss-limit halt)Halted
03Both tokens are on the owner's listNotAllowed
04The amount is above zeroZeroAmount
05The mandate holds the amountBalance
06Chainlink returns a priceBadPrice
07The price is fresh enoughStale
08Trading in the token is not pausedPaused
09No unacknowledged split or corporate actionCorporateAction
10The trade fits the per-trade capTooBig
11The day's total stays under the daily capDayLimit

After the checks

The swap must deliver at least the Chainlink price minus the slippage limit. If it would deliver less, the whole transaction reverts and no bond is lost.

Who can withdraw

Only the mandate's owner, and only to itself. For an agent vault the owner is the vault.