Boundary map
Deployer and investigator concentration
The program assigns the same initial address toDEPLOYER and SWAP_INVESTIGATOR_KEY.
Initial deployment therefore concentrates:
- Administrative authority
- Investigator-record ownership
- Potential access to all compliance plaintext for that account
Admin boundary
The constructor writes the hardcoded deployer address into theadmin mapping for edition zero. The code comment says the program owner is enforced as that deployer, but the constructor body does not assert self.program_owner == DEPLOYER.
Routine admin functions capture self.caller and compare it with the mapping. Admin powers include:
- Fee-tier and tick-spacing registration
- Fee-to-spacing binding
- Write-once token-decimal registration
- Pool enable and disable
- Pool-creation gate
- Token eligibility
- Global, token, and pair pauses
- Position freeze and unfreeze
- Protocol-fee configuration and collection
- Two-step admin transfer
Investigator boundary
The investigator address is a source constant, not a mapping. No admin function rotates it. The investigator can decrypt records for:- Mint
- Single-hop swap
- Multi-hop swap
Signer and caller boundary
self.signer is the top-level account. self.caller is the immediate invoker and can be a program.
Compliance records retain both values. Integrations must preserve them as separate fields rather than collapsing them into a single actor.
The signer address is account-level evidence. External systems must establish customer identity, beneficial ownership, institutional authority, and policy status.
Record-owner boundary
Position and token records are controlled through Aleo record ownership.- Mint recipient owns the PositionNFT.
- Position operations consume and reissue that record.
- Token change records return to the token-record owner under the token program’s implementation.
- Collect token records go to the immutable private withdrawal address in the consumed
PositionNFT. - Claim token records go to
self.signer. - Compliance records go to
SWAP_INVESTIGATOR_KEY.
Blinding-secret boundary
The private blinding factor is required to reproduce the signer-bound public address for claim. The AMM does not store or recover it. The TypeScript client derives the factor from the account view key and a counter. This couples wallet record-view capability with swap-pseudonym derivation. Production wallets should decide whether that coupling is acceptable and document backup, concurrency, and compromise behavior. The public used-address mapping prevents a second successful swap with the same confidential address. It does not restore lost secrets or prevent two prepared transactions from racing.Token-program boundary
The AMM dynamically invokes token programs throughIARC20. The AMM trusts the selected program to implement compatible semantics for:
- Private-to-public transfer
- Public-to-private transfer
- Public transfer
- Record ownership
- Amount accounting
- Failure and freeze behavior
wrapped_usdcx targets a test stablecoin dependency. Its bridge calls the underlying program, while its internal ARC-20 transfers do not consult the underlying freezelist on every movement. Verify production USDCx behavior end to end before enabling a market.
Upgrade boundary
For program editions greater than zero, the constructor checks a completed signing operation intest_shield_swap_multisig_core.aleo.
The multisig constructor check applies only to upgrades. Routine pool, pause, fee, freeze, and admin-transfer calls are authorized by the deployed admin address.
The dependency name includes test_, and program.json points to a local multisig program. Production documentation needs the actual deployed governance dependency and its operating policy.
Mutable-state boundary
Public mappings expose current state, not a complete immutable control log.- Admin acceptance removes the pending entry.
- Claim removes the pending swap output.
- Burn removes the position.
- Unfreeze removes the freeze entry and stored height.
Failure scenarios
Admin-key compromise
An attacker can change operational settings, pause markets, freeze positions, redirect protocol-fee collection within permitted balances, and initiate admin transfer. The attacker does not automatically decrypt compliance records unless the same underlying key controls both roles.Investigator view-key compromise
An attacker can attempt to discover and decrypt records owned by the investigator account. There is no ordinary in-contract rotation for future records.Investigator private-key compromise
Private-key compromise includes record decryption and broader account-control risk.Blinding-state loss
A trader may be unable to reproduce the relation required to claim a pending swap output.Token-program failure
The AMM can fail to fund, settle, collect, or claim if the token implementation rejects calls or does not match the expected interface. Issuer and wrapper restrictions can change the practical exit path.Indexer failure
Historical freeze, claim, burn, and admin evidence may be missing even though live mappings appear correct.Production control requirements
Before launch, document and test:- Separate admin and investigator custody, or an explicit acceptance of concentration
- Investigator loss and compromise response
- Admin recovery and transfer
- Upgrade authorization
- Blinding-state backup and concurrency
- Record discovery and spent-state tracking
- Historical state indexing
- Token admission and wrapper review
- Identity binding
- Disclosure authorization and logging
- Pause and freeze runbooks