How one blind request becomes one fill
The grid floor from above, an orange cable routed between two hatches
Plan of the floor

Contract reference

DarkDesk0x0785646d7323F274E20E287A883E60679097082A
Deployed in0xf941221f1a7245df…
DarkHooks0xb9662EA9819b6068d62d771dB3A473E5012B2888 (Uniswap v4 hook, see DarkHooks)
ChainRobinhood Chain, id 4663
SourceVerified on Sourcify, exact match, Solidity 0.8.28
USDG0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168
NVDA0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC
SPY0x117cc2133c37B721F49dE2A7a74833232B3B4C0C
TSLA0x322F0929c4625eD5bAd873c95208D54E1c003b2d
WETH0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73

Write functions

fill(Quote q, bytes sig, uint8 side, uint256 amount) returns (uint256)
cancelNonces(uint256 word, uint256 mask)
setEndpoint(string url)
bond(uint256 amount)
requestUnbond(uint256 amount)
withdrawUnbonded()
// owner
setHouse(address maker, bool isHouse)
setFee(address feeTo, uint16 feeBps)          // feeBps <= 10
setDeskToken(address token)                   // once
setBondParams(uint256 minBond, uint256 slashAmount, uint256 feeFreeBalance)
setPaused(bool)
transferOwnership(address) / acceptOwnership()

Read functions

hashQuote(Quote q) view returns (bytes32)
isNonceUsed(address maker, uint256 nonce) view returns (bool)
canQuote(address maker) view returns (bool)
feeFor(address taker, uint256 quoteAmount) view returns (uint256)
house(address) / bonded(address) / unbonding(address) / unbondAt(address) / endpoint(address)
DOMAIN_SEPARATOR() / QUOTE_TYPEHASH / feeBps / feeTo / deskToken / minBond / slashAmount / feeFreeBalance

Events

Filled(bytes32 indexed quoteHash, address indexed maker, address indexed taker, address base,
       address quote, uint8 side, uint256 baseAmount, uint256 quoteAmount, uint256 price, uint256 fee)
Defaulted(bytes32 indexed quoteHash, address indexed maker, address indexed taker, uint256 slashed)
NoncesCancelled(address indexed maker, uint256 word, uint256 mask)
EndpointSet(address indexed maker, string url)
Bonded / UnbondRequested / Unbonded / HouseSet / FeeSet / DeskTokenSet / BondParamsSet / PausedSet

Tests

24 unit tests cover both sides, rounding, single use across sides, expiry, size, tampering, wrong signer, nonce cancellation, eligibility, house shortfall, pause, EIP-1271 makers, token binding, bonding, default slashing, unbonding and the fee waiver, plus a fuzz test on the buy rounding. A fork test settles both sides against the real NVDA and USDG contracts, on a fork of the live chain.