Skip to main content
Balancer Pools provide continuous liquidity for tokenized securities through weighted constant-product market makers. Each pool pairs a security token with a stablecoin at configured weight ratios, enabling 24/7 trading without traditional order books or market makers.

Why Use Balancer Pools

Continuous Liquidity

Always-available two-sided markets without waiting for counterparties

Oracle Protection

Automatic trading halts when prices deviate beyond configured thresholds

Compliance Enforcement

Identity verification and transfer restrictions validated before every swap

Custom Weight Ratios

Configure token exposure through asymmetric pool weights (e.g., 80/20)

Pool Mechanics

Balancer Pools use weighted constant-product formulas that maintain the invariant (balanceA^weightA) × (balanceB^weightB) = k. Unlike 50/50 constant-product pools, weighted pools let you configure exposure ratios—an 80/20 pool means 80% value in the security token and 20% in stablecoin. When users swap tokens, the pool calculates output amounts based on current balances, configured weights, and swap fees. Before executing any swap, the pool queries the oracle for current security pricing and validates the AMM price falls within acceptable deviation thresholds.
Weight ratios determine capital efficiency and impermanent loss exposure:80/20 Pool (Stock/USDC):
  • Requires less stablecoin liquidity for same token coverage
  • Higher exposure to stock price movements
  • Suitable for trending markets where you expect appreciation
50/50 Pool (Stock/USDC):
  • Balanced capital requirements on both sides
  • Reduced impermanent loss compared to asymmetric weights
  • Better for ranging markets with bidirectional volatility
20/80 Pool (Stock/USDC):
  • Minimal stock exposure, heavy stablecoin weight
  • Lower impermanent loss but requires significant stablecoin reserves
  • Useful for bearish positioning or conservative liquidity provision
All pools maintain the same trading functionality regardless of weight configuration.

Oracle Integration

Every swap triggers oracle validation before execution. The oracle compares the AMM-calculated price against external price feeds from banks or data providers, rejecting trades that exceed maximum deviation thresholds.
Deviation CheckActionResult
Price within thresholdExecute swapTrade completes at AMM price
Price exceeds thresholdHalt tradingTransaction reverts with deviation alert
Oracle feed staleUse cached priceHigher slippage tolerance applied
Oracle unavailableReject swapNo trading until feed restored
This dual-pricing mechanism prevents manipulation—users can’t exploit temporary AMM price dislocations because the oracle enforces external market reality. Pools automatically resume trading when deviation resolves or administrators manually approve resumed operations.

Swap Execution Flow

// POST https://api.trusset.org/v1/trading/pools/swap

const response = await fetch('https://api.trusset.org/v1/trading/pools/swap', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    poolId: "0x1234...abcd",
    tokenIn: "0xStockToken",
    tokenOut: "0xUSDC",
    amountIn: "1000000000000000000", // 1 token
    minAmountOut: "95000000", // 95 USDC minimum
    deadline: Math.floor(Date.now() / 1000) + 300 // 5 min
  })
});

const swap = await response.json();
// Returns: amountOut, executionPrice, oraclePrice
The swap flow validates identity, checks token restrictions, queries oracle pricing, calculates expected output with configured slippage tolerance, executes the Balancer vault swap, and validates actual output meets minimum requirements. All steps execute atomically—any failure reverts the entire transaction.

Liquidity Provision

Pool creators and liquidity providers deposit tokens to earn trading fees. Balancer distributes fees proportionally to liquidity providers based on their pool share, calculated from LP tokens received during deposits.
Pool creators must provide both tokens at the configured weight ratio during initialization. For an 80/20 pool targeting 100ktotalvalue,deposit100k total value, deposit 80k worth of stock tokens and $20k USDC.
// POST https://api.trusset.org/v1/trading/pools/initialize

await fetch('https://api.trusset.org/v1/trading/pools/initialize', {
  method: 'POST',
  body: JSON.stringify({
    poolId: "0x1234...abcd",
    stockAmount: "800000000000000000000", // 800 tokens
    stableAmount: "20000000000", // 20,000 USDC
    recipient: "0xYourAddress"
  })
});
// Receives LP tokens representing pool ownership
Impermanent loss occurs when token prices diverge from deposit ratios. Liquidity providers may receive less total value during withdrawal compared to holding tokens outside the pool, though trading fees can offset this loss in active markets.

Trading Fees

Configure swap fees as basis points of trade value—typically 10-100 bps (0.1%-1%). Fees accrue to the pool automatically, increasing LP token value over time without requiring distribution transactions. Fee revenue depends on trading volume. High-frequency markets with tight spreads benefit from lower fees (10-25 bps) while illiquid securities may justify higher fees (50-100 bps) to compensate liquidity providers for capital lock-up and impermanent loss risk.