Liquidity
Last updated
Last updated
function buyBLTBY(
address stablecoin,
uint256 stablecoinAmount
) external returns (uint256 bltbyAmount)function buyBLTBYExact(
address stablecoin,
uint256 bltbyAmount
) external returns (uint256 stablecoinCost)// How much BLTBY for $100?
const quote = await bltbyBank.getBuyQuote(parseUnits("100", 6));
console.log(`Will receive ${formatEther(quote)} BLTBY`);const { remainingBuyToday } = await bltbyBank.getUserLimits(address);function sellBLTBY(
address stablecoin,
uint256 bltbyAmount
) external returns (uint256 stablecoinReceived)// How much stablecoin for 1000 BLTBY?
const quote = await bltbyBank.getSellQuote(parseEther("1000"));
console.log(`Will receive $${formatUnits(quote, 6)}`);const { bltby, usdc, usdt } = await bltbyBank.getReserves();function getLiquidityHealth() external view returns (
uint256 bltbyRatio, // Current/target
uint256 stablecoinRatio, // Current/target
bool isHealthy // Overall status
)