Bath Token
An ERC-20 token that represents user liquidity in Rubicon Pools
The Bath Token contract represents a single asset pool of liquidity within the Rubicon Pools system. These pools are named according to "bath" + the name of the underlying asset (e.g. bathUSDC). These pools allow depositors to earn yield from the Rubicon Pools system while their assets provide high-frequency liquidity on the Rubicon order book. Bath Token liquidity pools earn value from market-making yield that is passed to depositors.

Key Functions

  • deposit - this function allows a user to deposit an ERC-20 asset and receive bathTokens at a ratio of totalSupply / underlyingBalance() with their deposit. This means that a user will receive shares in the pool that are proportional to the performance of shares in the pool already; this ensures there is no way to game the system and upside is correctly shared across all participants. A bathToken represents a share of the underlying liquidity and has a claim on future yield.
    • Input Parameter: uint amount - the quantity of the ERC-20 asset to deposit.
  • withdraw - this function withdraws provided liquidity and any accrued yield that the user has (via the burning of BathTokens) earned back to their wallet.
    • Input Parameter: uint shares - the quantity of bathTokens (shares in the underlying pool) to withdraw in exchange for the underlying ERC-20 asset.
Last modified 2mo ago
Copy link