Skip to main content
TVL: ~$2M | Type: Cross-Chain Spoke/Hub Lending | Docs: docs.townsquare.fi

Overview

TownSquare uses a spoke/hub architecture similar to Folks Finance. Monad acts as a spoke chain where users interact locally; the hub coordinates cross-chain state and rate discovery. Markets with zero deposits are filtered out automatically.
getTownSquareMarkets() filters out markets where totalDeposits === 0. Newly deployed markets may not appear until they receive initial deposits.

Functions

getTownSquareMarkets()

Returns all active TownSquare markets on Monad with non-zero deposits. Returns TownSquareMarket[]
FieldTypeDescription
addressstringMarket contract address
assetstringUnderlying token address
totalDepositsbigintTotal deposited assets (raw)
totalBorrowsbigintTotal borrowed assets (raw)
supplyAPYnumberCurrent supply APY as a decimal
borrowAPYnumberCurrent borrow APY as a decimal
tvlUSDnumberMarket TVL in USD
protocol'townsquare'Protocol identifier
const markets = await sdk.getTownSquareMarkets()
// → [
//   {
//     address: '0x...',
//     asset: '0x...',
//     totalDeposits: 1200000n,
//     totalBorrows: 700000n,
//     supplyAPY: 0.048,
//     borrowAPY: 0.079,
//     tvlUSD: 1200000,
//     protocol: 'townsquare'
//   },
// ]

getTownSquareTVL()

Returns total value locked across all active TownSquare markets in USD. Returns number
const tvl = await sdk.getTownSquareTVL()
// → 2000000

Usage Example

import { Rampart } from 'rampart-monad'

const sdk = new Rampart()

const markets = await sdk.getTownSquareMarkets()

if (markets.length === 0) {
  console.log('No active TownSquare markets found')
} else {
  const tvl = await sdk.getTownSquareTVL()
  console.log(`TownSquare TVL: $${(tvl / 1e6).toFixed(1)}M across ${markets.length} markets`)
}

Contract Addresses

ContractAddress
SpokeController0x8f8a0ed366439576b7db220678ed1259743239e3
AccountCtrl0xc2df24203ab3a4f3857d649757a99e18de059a16