Fees & Limits

All fee parameters and limits are configurable by the contract owner but are bounded by hard-coded maximums to prevent abuse.

Platform Fee

The platform charges a fee on every escrow creation, deducted when funds are released to the seller.

ParameterValueConfigurable
Current fee50 BPS (0.5%)
Maximum fee500 BPS (5%)❌ (hard-coded)
Minimum fee0 BPS (0%)

Fee Calculation

fee_amount = principal_amount × fee_bps ÷ 10,000
total_deposit = principal_amount + fee_amount

Example: Creating a 100 STX escrow at 50 BPS (0.5%):

fee = 100,000,000 × 50 ÷ 10,000 = 500,000 µSTX (0.5 STX)
total = 100,000,000 + 500,000 = 100,500,000 µSTX (100.5 STX)

Fee Distribution

  • On release: Seller gets principal_amount, fee recipient gets fee_amount
  • On refund: Buyer gets total_deposit (principal + fee). No fee charged.
  • On dispute → seller: Same as release
  • On dispute → buyer: Same as refund

Fee Recipient

The fee recipient is configurable and defaults to the contract owner. It can be changed:

clarity
(contract-call? .escrow-v6 set-fee-recipient 'ST_NEW_FEE_ADDRESS)

Amount Limits

STX

ParameterValueHuman Readable
Minimum1,000 µSTX0.001 STX
Maximum100,000,000,000,000 µSTX100M STX

sBTC

ParameterValueHuman Readable
Minimum10,000 sats0.0001 BTC
Maximum10,000,000,000 sats100 BTC

ℹ️ Info: Amount limits are validated in the contract's validate-amount function. Amounts outside these bounds will fail with ERR_INVALID_AMOUNT (error code 2005).

Duration Limits

ParameterValueHuman Readable
Minimum1 block~90 seconds
Maximum350,400 blocks~365 days

Duration is specified in Stacks blocks when creating an escrow. The escrow's expires-at is calculated as block-height + duration.

Block Time

Post-Nakamoto, Stacks blocks are produced approximately every 90 seconds. Common duration values:

DurationBlocks
1 hour~40
1 day~960
1 week~6,720
30 days~28,800
365 days~350,400

Dispute Timeout

ParameterValueHuman Readable
Default28,800 blocks~30 days
Configurable✅ (owner only)

The dispute timeout is the period after which a buyer can self-recover funds from a disputed escrow without admin intervention.

clarity
;; Check if dispute has timed out (> burn-block-height (+ disputed-at dispute-timeout))

Admin Fee Configuration

The contract owner can adjust the fee rate:

clarity
;; Set fee to 1% (100 BPS) (contract-call? .escrow-v6 set-fee-bps u100)

⚠️ Warning: The fee cannot exceed MAX_FEE_BPS (500 = 5%). Attempting to set a higher fee will fail with ERR_INVALID_FEE.

Summary Table

ParameterDefaultMinMaxUnit
Platform Fee500500BPS
STX Amount1,000100TµSTX
sBTC Amount10,00010Bsats
Duration1350,400blocks
Dispute Timeout28,800blocks