Skip to main content

IBAMM

Functions

fetchPrice

function fetchPrice() external returns (uint256)

returns ETH price scaled by 1e18

getSwapEthAmount

function getSwapEthAmount(
uint256 lusdQty
) external returns (uint256 ethAmount, uint256 feeEthAmount)

returns amount of ETH received for an LUSD swap

Parameters

NameTypeDescription
lusdQtyuint256

LUSD

function LUSD() external returns (contract IERC20)

LUSD token address

SP

function SP() external returns (contract IStabilityPool)

Liquity Stability Pool Address

balanceOf

function balanceOf(
address account
) external returns (uint256)

BAMM shares held by user

Parameters

NameTypeDescription
accountaddress

totalSupply

function totalSupply() external returns (uint256)

total BAMM shares

bonus

function bonus() external returns (address)

Reward token

deposit

function deposit(
uint256 lusdAmount
) external

deposit LUSD for shares in BAMM

Parameters

NameTypeDescription
lusdAmountuint256

withdraw

function withdraw(
uint256 numShares
) external

withdraw shares in BAMM for LUSD + ETH

Parameters

NameTypeDescription
numSharesuint256

transfer

function transfer(
address to,
uint256 amount
) external

transfer shares

Parameters

NameTypeDescription
toaddress
amountuint256

swap

function swap(
uint256 lusdAmount,
uint256 minEthReturn,
address dest
) external returns (uint256)

swap LUSD to ETH in BAMM

Parameters

NameTypeDescription
lusdAmountuint256
minEthReturnuint256
destaddress