Skip to Content

Revenue Model & Fee Structure

This section explains the three main fee mechanisms in the Welsh Street Exchange contract their settings, and security protections.

Fee System Parameters

Fee Rate Configuration

The Welsh Street Exchange implements configurable fee rates with protective bounds to ensure fair pricing and protocol sustainability:

;; Fee and revenue rate bounds (basis points) (define-constant BASIS u10000) ;; 100% = 10,000 basis points (define-constant MAX_FEE u200) ;; Maximum 2.00% fee rate (define-constant MAX_REV u200) ;; Maximum 2.00% revenue rate (define-constant MAX_TAX u200) ;; Maximum 2.00% tax rate (define-constant MIN_FEE u50) ;; Minimum 0.50% fee rate (define-constant MIN_REV u50) ;; Minimum 0.50% revenue rate (define-constant MIN_TAX u50) ;; Minimum 0.50% tax rate ;; Current rate variables (default: 1.00% each) (define-data-var fee uint u100) ;; Fee rate (default: 1.00%) (define-data-var rev uint u100) ;; Revenue rate (default: 1.00%) (define-data-var tax uint u100) ;; Tax rate (default: 1.00%)

Fee Parameter Details

Fee Component (Liquidity Provider Rewards)

  • Purpose: Incentivizes liquidity provision by rewarding LP token holders
  • Distribution: Automatically distributed through the rewards contract’s zero-debt system
  • Range: 0.50% - 2.00% (50 - 200 basis points)
  • Default: 1.00% (100 basis points)
  • Token Flow: Input tokens → Rewards contract → Distributed proportionally to LP holders

Revenue Component (Protocol Treasury)

  • Purpose: Funds protocol development, marketing, and ecosystem growth
  • Distribution: Sent directly to the configurable treasury address
  • Range: 0.50% - 2.00% (50 - 200 basis points)
  • Default: 1.00% (100 basis points)
  • Token Flow: Input tokens → Treasury address → Protocol development funding

Total Fee Impact

Combined Fee Structure:

  • Total Swap Cost: fee + rev (default: 1.00%)
  • Maximum Total: 2.00% (1% fee + 1% rev)
  • Minimum Total: 1.00% (0.5% fee + 0.5% rev)
  • Basis Point Calculation: (amount * rate) / 10000

Example Calculations:

;; Default rates (1% fee + 1% rev = 2% total) Input: 1,000,000 Welsh tokens Fee (LP rewards): 1,000,000 * 100 / 10000 = 10,000 Welsh Revenue (treasury): 1,000,000 * 100 / 10000 = 10,000 Welsh Net for swap: 1,000,000 - 20,000 = 980,000 Welsh ;; Maximum rates (2% fee + 2% rev = 4% total) Input: 1,000,000 Welsh tokens Fee (LP rewards): 1,000,000 * 200 / 10000 = 20,000 Welsh Revenue (treasury): 1,000,000 * 200 / 10000 = 20,000 Welsh Net for swap: 1,000,000 - 40,000 = 960,000 Welsh

Revenue Types Overview

The exchange implements three distinct fee mechanisms: fee, revenue, and tax. Each serves a different purpose and has different fund destinations to ensure proper protocol economics and security.

1. Swap Fee Share

Purpose: Shared trading fees that reward liquidity providers through the rewards contract.

Destination: Transferred directly to the .rewards contract - inaccessible to deployer/treasury.

Implementation in Swaps:

(fee-a (/ (* amount-a (var-get fee)) BASIS)) (fee-total (/ (* amount-a (+ (var-get fee) (var-get rev))) BASIS)) ;; Fee distribution in swap-a-b (if (> fee-total u0) (begin (try! (transformer .welshcorgicoin fee-a .rewards)) ;; Fee goes to rewards (try! (contract-call? .rewards update-rewards-a fee-a)) ) true)

Security: These funds are permanently allocated to LP rewards and cannot be accessed by the treasury or contract owner.

2. Revenue - Treasury Growth Fund

Purpose: Protocol revenue for growth initiatives including buybacks, airdrops, and exchange listings.

Destination: Transferred to the treasury address (initially CONTRACT_OWNER).

Treasury State Variables:

;; treasury account (define-data-var treasury-address principal CONTRACT_OWNER) (define-data-var treasury-locked bool false)

The treasury system is initialized with the contract deployer as the treasury address and an unlocked state, allowing for future security upgrades such transferring the treasury to a community multi-sig or a DAO controlled contact.

Implementation in Swaps:

(rev-a (/ (* amount-a (var-get rev)) BASIS)) (treasury (var-get treasury-address)) ;; Revenue distribution in swap-a-b (if (> fee-total u0) (begin (try! (transformer .welshcorgicoin rev-a treasury)) ;; Revenue to treasury ) true)

Security Risk: Since revenue goes to an address, private key compromise could lead to fund theft. The establishment of a multi-sig is the best way to guard against the unfortunate case of a private key exploit.

The deployer contract and treasury address are controlled by two separate private keys to prevent this from happen. The treasury address is only assign to the CONTRACT_OWNER at contract deployment and changed to a different private key shortly after deployment.

(Transaction Record here.)[]

Mitigation: Treasury address can be updated to a multi-signature wallet:

(define-public (set-treasury-address (new-treasury principal)) (begin (asserts! (is-eq (var-get treasury-address) tx-sender) ERR_NOT_TREASURY) (if (var-get treasury-locked) ERR_LOCKED_TREASURY (begin (var-set treasury-address new-treasury) (ok new-treasury) ) ) ) )

Permanent Lock: Once migrated to multi-sig, the treasury can be permanently locked:

(define-public (set-treasury-locked) (begin (asserts! (is-eq (var-get treasury-address) tx-sender) ERR_NOT_TREASURY) (if (var-get treasury-locked) ERR_LOCKED_TREASURY (begin (var-set treasury-locked true) ;; Prevents future changes (ok true) ) ) ) )

3. Tax - Permanent Liquidity Lock

Purpose: Exit tax on liquidity removal that permanently increases protocol reserves. The exit tax is a thank you from the community for participating in the Welsh Street Exchange project. HTe small tax remains as permanently locked liquidity to benefit the project and community forever.

Nothing is as certain as death, taxes and Welsh going to the moon. -Benjamin Franklin

Destination: Locked within the exchange contract - cannot be withdrawn by anyone.

Implementation in Liquidity Removal:

(define-public (remove-liquidity (amount-lp uint)) (let ( (amount-a (/ (* amount-lp aval-a) total-supply-lp)) (amount-b (/ (* amount-lp aval-b) total-supply-lp)) (tax-a (/ (* amount-a (var-get tax)) BASIS)) ;; Calculate tax (tax-b (/ (* amount-b (var-get tax)) BASIS)) (user-amount-a (- amount-a tax-a)) ;; User gets amount minus tax (user-amount-b (- amount-b tax-b)) ) (begin ;; User receives net amount after tax (try! (transformer .welshcorgicoin user-amount-a tx-sender)) (try! (transformer .street user-amount-b tx-sender)) ;; Tax is permanently locked in reserves (var-set locked-a (+ lock-a tax-a)) (var-set locked-b (+ lock-b tax-b)) (ok { burned-lp: amount-lp, tax-a: tax-a, ;; Tax amounts recorded tax-b: tax-b, user-a: user-amount-a, user-b: user-amount-b }) ) ) )

Benefit: Permanently increases liquidity depth, benefiting all WELSH, STREET, and CREDIT LP holders through reduced slippage and improved price stability.

Maximum Fee Rates & Security

The protocol’s commission is capped at 2% of notional per transaction across fees, revenue and taxes. This ceiling is intentionally conservative relative to traditional finance benchmarks. In U.S. broker-dealer practice, FINRA’s long-standing “5% Policy” (Rule 2121) frames what is fair and reasonable for markups/markdowns and commissions; the 2% Welsh Street Cap sits well below that reference point.

Mutual-fund distribution charges permitted under FINRA Rule 2341 can be materially higher (commonly several percent and up to ~8.5% in certain structures), making a 2% limit comparatively modest.

In the hedge fund world, “2 and 20” is a widely recognized fee model that normalizes a 2% management fee, and retail advisory fees often range up to ~2% of assets for smaller accounts. Taken together, these Wall Street norms support a 2% maximum as prudent, investor-protective, and squarely within established industry practice.

The fees, revenues and taxes are initial set to 1% across the board. User’s can check the rates anytime with the various frontend modals or by directly calling the various read-only functions in the exchange contract.

Max/Min Parameter Bounds

All fee parameters are protected by minimum and maximum bounds to prevent malicious manipulation. 2% is set that the programmatic maximum, even in the case of a malicious actor gaining access to the deployer private keys. The lower bound of 0.5% guarantees that the protocol earns minimal revenue to help guarantee protocol sustainability.

Validation in Update Functions:

(define-public (update-exchange-fee (update uint)) (begin (asserts! (is-eq tx-sender CONTRACT_OWNER) ERR_NOT_CONTRACT_OWNER) (asserts! (<= update MAX_FEE) ERR_ZERO_AMOUNT) ;; Maximum check (asserts! (>= update MIN_FEE) ERR_ZERO_AMOUNT) ;; Minimum check (var-set fee update) (ok {fee: update}) ) ) (define-public (update-exchange-rev (update uint)) (begin (asserts! (is-eq tx-sender CONTRACT_OWNER) ERR_NOT_CONTRACT_OWNER) (asserts! (<= update MAX_REV) ERR_ZERO_AMOUNT) ;; Maximum check (asserts! (>= update MIN_REV) ERR_ZERO_AMOUNT) ;; Minimum check (var-set rev update) (ok {rev: update}) ) ) (define-public (update-exchange-tax (update uint)) (begin (asserts! (is-eq tx-sender CONTRACT_OWNER) ERR_NOT_CONTRACT_OWNER) (asserts! (<= update MAX_TAX) ERR_ZERO_AMOUNT) ;; Maximum check (asserts! (>= update MIN_TAX) ERR_ZERO_AMOUNT) ;; Minimum check (var-set tax update) (ok {tax: update}) ) )

Protection Against Attacks:

Private Key Compromise Scenarios:

  • Cannot eliminate fees: Minimum bounds prevent setting fees to 0, ensuring continued protocol revenue
  • Cannot drain protocol: Maximum bounds prevent excessive fee extraction (max 2% per trade)
  • Cannot stop LP rewards: Fees automatically flow to rewards contract regardless of treasury compromise

Current Parameter Ranges:

  • Fee: 0.5% - 2.00% (u50 - u200)
  • Revenue: 0.5% - 2.00% (u50 - u200)
  • Tax: 0.5% - 2.00% (u50 - u200)

This bounded approach ensures protocol sustainability even in worst-case security scenarios while maintaining reasonable fee structures for users.

Last updated on