Skip to main content

Contracts

Reiy uses a hybrid architecture: quote collection, solve orchestration, scoring, and winner selection run off-chain in the Execution Coordinator (Fisherman); the Move contracts on Sui escrow user funds, verify the Coordinator’s signed solution, enforce each user’s protection, and split fees. Move 2024, DeepBook v3.

Core responsibilities

AreaResponsibility
Intent escrowLock user sell tokens until cancellation or valid settlement.
SBBO admissionReject intents whose min_amount_out falls below the DeepBook-mid admission floor.
Solver registryTrack solver registration and stake-based active status.
Certificate verificationVerify the Coordinator’s Ed25519 signature, solver identity, epoch, token types, and expiry.
SettlementEnforce protected minimum, exact payout, partial-fill rules, fee split, and per-intent atomicity.
Fee vaultsAccumulate the protocol’s fee share per token.

Modules

ModuleRole
configGlobalConfig (shared) + AdminCap (owned): parameters, ACL, allowlists, Coordinator key.
intent_bookIntent<Sell, Buy> shared object: SBBO-gated creation, escrow, partial-fill, cancel.
auctionSlim AuctionState (shared): epoch counter, per-epoch partial-fill set, fee totals.
settlementCertificate verification + per-intent settlement, fee split, user protection.
solver_registrySolverRegistry<Stake> (shared): solver stake + active status.
fee_vaultFeeVault<T> (shared): per-token protocol fee balance.
price_adapterDeepBook mid-price reader + SBBO helper math.
events, math, typesEvent structs, fixed-point helpers, PairKey.

On-chain objects

ObjectKindNotes
GlobalConfigsharedOne per deployment. All mutations require AdminCap.
AdminCapownedHeld by the deployer; transfer to a multisig for mainnet.
AuctionStatesharedProtocol state; pinned by SolutionMessage.protocol_state_id.
SolverRegistry<Stake>sharedSolver stake; Stake is the eligibility coin type.
FeeVault<T>sharedCanonical fee sink for token T, registered in config.
Intent<Sell, Buy>sharedHolds escrowed Sell; source of truth for one user order.

Settlement flow (one PTB)

The winning solver settles in a single programmable transaction block:
  1. verify_solution: checks the signature, sender, epoch, token types, and expiry, then returns a SolutionAuth hot-potato.
  2. take_authorized_intent_full | take_authorized_intent_partial: per intent, in certificate order, receive the escrowed sell coin.
  3. Source liquidity and produce the payout: Coin<Buy>.
  4. settle_intent: deliver the payout. The contract splits fees, pays the user net, and pays the solver fee share.
There is no on-chain settlement phase gate; auction::phase_code() is a compatibility getter that always returns 0. The contract enforces epoch safety only: the signed epoch must equal the live AuctionState epoch and each intent’s target_epoch must match.

Events

IntentCreatedEvent, IntentCancelledEvent, IntentUpdatedEvent, EpochAdvancedEvent, SolutionAuthorizedEvent, SettlementEvent, SettlementFeeChargedEvent, BatchFeeSummaryEvent, SolverFeePaidEvent, ProtocolFeeCollectedEvent, SolverRegisteredEvent, SolverDeregisteredEvent, FeeVaultRegisteredEvent, ExecutionCoordinatorUpdatedEvent, ConfigUpdatedEvent, RoleGrantedEvent, RoleRevokedEvent.

Deployment addresses

Deployment addresses and verified source references are published with each testnet or mainnet release. See Smart Contracts for the current canonical references.

Definitions

Look up contract-facing protocol terms.

Scoring and ranking

Review off-chain validation and winner selection.
Last modified on June 23, 2026