Skip to main content

Capabilities Overview

DollarStore consists of two contracts:

ContractPurpose
DollarStoreMain protocol logic—deposits, withdrawals, swaps, queue
DLRSERC-20 receipt token (deployed by DollarStore)

Supported stablecoins

Currently supported:

TokenDecimals
USDC6
USDT6

The admin can add or remove supported stablecoins.

Integration paths

For aggregators

Use getSwapQuote to check if a swap is fillable, then swapExactInput to execute:

// Check quote (returns 0 if not fillable)
uint256 quote = dollarStore.getSwapQuote(USDC, USDT, amountIn);

if (quote > 0) {
// Execute swap (reverts if reserves depleted between quote and execution)
uint256 out = dollarStore.swapExactInput(
USDC, // fromStablecoin
USDT, // toStablecoin
amountIn, // amount in
amountIn, // min out (1:1, so same as in)
recipient, // where to send output
block.timestamp + 300 // 5 min deadline
);
}

For direct users

Use swap with the queue option for maximum flexibility:

// Swap with queue fallback
(uint256 received, uint256 positionId) = dollarStore.swap(
USDC, // from
USDT, // to
amount, // how much
true // queue if not fully fillable
);

// received = amount filled instantly
// positionId = queue position (0 if fully filled)

For DLRS holders

Convert DLRS to any stablecoin:

(uint256 received, uint256 positionId) = dollarStore.swapFromDLRS(
USDT, // which stablecoin you want
dlrsAmount, // how much DLRS to convert
true // queue if needed
);

Key invariants

  1. 1:1 ratio: All operations preserve 1:1 between DLRS and stablecoins
  2. No fees: Zero protocol fees on any operation
  3. FIFO ordering: Queue positions processed strictly first-in-first-out
  4. Atomic operations: Each transaction either fully completes or reverts (for aggregator functions)

Next steps

  • Functions — Complete function reference
  • Events — Events for monitoring
  • Errors — Error conditions and handling