This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Resources

Contract references, deployment details, and protocol interfaces.

1 - Core Contracts

Overview of the DX Terminal Pro contracts

Protocol Control

  • Authority: Central ACL and registry contract. Manages roles, contract locations, vault registration, token registration, default vault configurations, and experiment finalization.
  • Purgatory: Holds reserved/pre-graduation token balances and supports controlled distribution, sweeping, and managed external calls.

Vault Layer

  • AgentVaultFactory: Deploys EIP-1167 AgentVault clones, registers vaults in Authority, and enforces creation rules (including sanctions checks when enabled).
  • AgentVault: Per-user vault bound to an Agent NFT. Handles owner deposits/withdrawals, strategy metadata, operator-mediated trading, presale participation, and vault closure flow.

Token Launch and Distribution

  • XDRC20Factory: Deploys new XDRC20 tokens and registers them with Authority.
  • XDRC20: Launch token with pre-graduation transfer gating via Authority, plus graduation and reap state transitions.
  • TokenLaunchpad: Launch orchestrator that deploys tokens, initializes Uniswap v4 pools, and mints initial LP positions.
  • TokenPresale: Vault-only WETH presale system with funding, migration to launchpad, batched distribution, and refund/failure handling.

Liquidity and Pool Management

  • PositionRegistry: Stores canonical per-token LP position metadata (pool id, position id/count, fee, hook, orientation).
  • LPManager: Manages protocol LP positions (exit, compound, consolidate, migrate-to-lower-fee, reserve accounting, and controlled sweeps).
  • XDHook: Uniswap v4 hook enforcing pre-graduation access rules and charging/claiming swap fees (WETH-preferred fee accounting).

Reap Lifecycle

  • Reaper: Coordinates reap initialization, holder snapshot/distribution batches, reserved-pot accounting, and post-distribution TWAP buy execution/finalization.

Upgradeability Model

  • Proxy-backed core contracts: Authority, Purgatory, PositionRegistry, LPManager, TokenLaunchpad, TokenPresale, Reaper.
  • Non-proxy runtime contracts: AgentVaultFactory, AgentVault (clone implementation), XDRC20Factory, XDRC20, hooks/XDHook.

2 - Deployments

Base mainnet contract addresses, implementations, and proxy admins.

Base Mainnet

ContractProxy / Main AddressImplementationProxy Admin
Authority0xe106e2f5C33244E71a12cb1B7230732069dAc07e0xC93a46B5a53fcdD363536F260Ef45E8c87efF4bf0x7803eE162B60757B640db483D448Be5B410d4D44
Hook0x66E51DEab56975Bb1c64413bd3AB01FA95B82accN/AN/A
LP Manager0xCA8C980810219086Cc4A6AB360265866abe0Dc760x87CA3273De528c47B1046FD7509026a4dE716c540x3782E5701224741C18ca290a05e55BbF395800D7
Position Registry0xFd36A544470963a514A3Cd2d30Fc9964Ab1a94360xE8Fc484e850Dc997BA920D500217BE7694537E560xc118302a4523b7f3a662321BAFf42826EeC4990f
Launchpad0xbF2145465133f6e8dC0fa30579c242A4922e00630x2d95f8C90A6a9192e76aFc49efcE692A87dA60b00x60B4f27eCd0EfD4110CA8aad3485754E602AAaA2
Reaper0xF9283Ae11B7315911fd8E762a7C8B496d5B2F3660xAE8c22a942C3Ddf962EA7F63660141B053eDEfD70x84b1Ab8C90747032A879376D4C09896eaBa80E89
Presale0xdBC0585a06ca24086CFfF55c15b50194145E6C430x5A3B37c05017ADC848Bac7aDD2C478D6F2e4dCb80x1cCe1fFFce8cF49262eb9B400A35abCA54b0BF54
XDRC20 Factory0x6215456029Eac5Ae037cBBbD8B732ab655280C8EN/AN/A
Vault Factory0xD3F5b76D79DDF256Dc1cE83BAD450a9aCaC49CbE0xDAa30db81746ECd8B0743706338eFE1a24b758daN/A

3 - Agent Vault Contract API

Overview of functions and security model of the AgentVault contract.

This page explains the on-chain functions a vault owner can call directly, plus the VaultOperator execution model used for agent-driven swaps.

VaultOperator Context

VaultOperator is an execution role in Authority used to submit swap transactions generated from agent decisions. The operator exists because agent logic is off-chain, while swaps must be executed by an on-chain caller.

In AgentVault, operator authority is intentionally narrow:

  • Can call swapV4(...) to execute Uniswap v4 swaps.
  • Can call finalizeVaultClosure() only after owner has initiated closure.
  • Cannot call owner fund-management functions.
  • Cannot withdraw ETH/WETH/tokens to itself.
  • Cannot call xcall(...).
  • Cannot change settings, strategies, or ownership.

Least-Privilege Security Model

Swaps are constrained on-chain by contract checks:

  • swapV4 is gated by onlyVaultOperator.
  • Vault owner can pause swaps at any time with pauseVault(true).
  • Protocol can globally disable operators via Authority.vaultOperatorsDisabled.
  • Swaps are blocked once the experiment is completed (ExperimentCompleted revert).
  • Pair must include WETH.
  • Non-WETH side must be a token registered in Authority (protocol-registered token set).
  • Minimum output (minAmountOut) is enforced.
  • Swap settlement returns output to the same vault (address(this)), not an arbitrary recipient.

Owner-Callable Functions

FunctionSignaturePurposeKey Requirements
Update settingsupdateSettings((uint256, uint256, uint8, uint8, uint8, uint8, uint8) settings_)Update agent risk/trading preferencesOwner only; validated bounds
Add strategyaddStrategy(string strategy, uint64 expiry, uint8 prio) returns (uint256)Add strategy metadataOwner only; non-empty; max length; valid expiry/priority
Disable strategydisableStrategy(uint256 id)Disable one strategyOwner only
Disable all strategiesdisableAllActiveStrategies()Disable all active strategiesOwner only
Deposit ETHdepositETH() payableWrap ETH into vault WETHOwner only; msg.value > 0
Withdraw ETHwithdrawETH(uint256 amount_)Unwrap WETH and withdraw ETHOwner only; sufficient WETH
Recover forced ETHrecoverEth(uint256 amount_)Withdraw raw ETH held by vaultOwner only; sufficient ETH balance
Enter presaleenterPresale(uint256 presaleId, uint256 amount)Contribute vault WETH to presaleOwner only; sufficient WETH
Swap staked NFTshmewieSwap(uint256 newAgentId_)Replace staked Agent NFTOwner only; new id must differ
Pause/unpause swapspauseVault(bool paused_) returns (bool)Enable/disable operator swap executionOwner only; vault not in closure
Initiate closurecloseVault()Start closure workflowOwner only; vault not in active presale
Close after experimentcloseVaultAfterExperiment()Owner-complete closure after graduationOwner only; experiment complete
Withdraw graduated tokenwithdrawGraduatedToken()Transfer graduated token balance to ownerOwner only; graduated token set
Arbitrary call (post-experiment)xcall(address target_, bytes data_) payable returns (bytes)Owner-directed integrations after experimentOwner only; experiment completed

Read Functions

  • vaultOwner()
  • agentId()
  • paused()
  • vaultClosureStep() (0=active, 1=closure initiated, 2=closure finalized)
  • agentSettings()
  • strategyCount()
  • isStrategyActive(uint256)
  • getStrategy(uint256)
  • getActiveStrategies()
  • getActiveStrategyIds()
  • AGENT(), AUTHORITY(), PRESALE(), WETH(), POOL_MANAGER()

Settings and Strategies

Agent Settings

updateSettings(AgentSettings settings_) validates all fields on-chain:

FieldTypeAllowed RangeNotes
maxTradeAmountuint256500 to 10_000BPS (5% to 100%)
slippageBpsuint25610 to 5_000BPS (0.10% to 50%)
tradingActivityuint81 to 5slider value
assetRiskPreferenceuint81 to 5slider value
tradeSizeuint81 to 5slider value
holdingStyleuint81 to 5slider value
diversificationuint81 to 5slider value

Strategy Constraints

addStrategy(string strategy, uint64 expiry, uint8 prio) rules:

  • Strategy text must be non-empty.
  • Max strategy length is 1024 bytes.
  • expiry must be 0 (no expiry) or a future unix timestamp.
  • Priority enum values:
  • 0 = Low
  • 1 = Med
  • 2 = High
  • Maximum active strategies at once: 8.

Active strategy definition:

  • enabled == true
  • and (expiry == 0 or expiry > block.timestamp)

When adding a strategy at the active limit, the vault attempts to prune expired active strategies first; if still full, the call reverts.

4 - Token & LP Contracts

Official token addresses, pool identifiers, and related metadata.

Official Token Contracts

Token AddressPool IDNameSymbolDecimalsTotal Supply
0xFcc897aaC0073A94ca3D91E567f0129822558C1d0xbabd14082886009aff59f97ce268c69ca2a05e0f23bb26b6f92d59ff71438840HoleHOLE181000000000000000000000000000
0x2Ad250B4A33Ba89e9372C6d4B8b0BF2D2e5E00120x3b435520ed46998633bfd74a246b39a2ed0134ee0e1100ef7a067e750b36daabAI GFAIGF181000000000000000000000000000
0x781BAe1c8E0DbB4950845A6d776d94C33b326D8a0x77ec461b4e226e36bdc08ed882c47c966e44a2af2d912d77f090b709a246339bHotdogzHOTDOGZ181000000000000000000000000000
0x2DD5F88Bd9814052Ae37614394762c1fFf6A1c440x4c6277185a99d8cfb1309d9fbe65ceae76ccfc1c281e7a8a48cd081830f1ae3fLooksmaxLOOKSMAX181000000000000000000000000000
0x5d065DAF8667A2Da5124bf10F9F3B72fE09fBC6F0xa64c52eea6bd4b9e92253a2d8ae06eeeefe79ed417d56d5df5099d268637572bLMAOLMAO181000000000000000000000000000
0xbDa4FC392f761787f7F16D3C554ED8b9a15e91B10x0db36ef317dd9587d4429216d804def241ae00ac8935cc59564be8a52e15afe8Poop CoinPOOPCOIN181000000000000000000000000000