Skip to main content

IBondTeller

Git Source

Functions

purchase

Exchange quote tokens for a bond in a specified market

function purchase(address recipient_, address referrer_, uint256 id_, uint256 amount_, uint256 minAmountOut_)
external
returns (uint256, uint48);

Parameters

NameTypeDescription
recipient_addressAddress of recipient of bond. Allows deposits for other addresses
referrer_addressAddress of referrer who will receive referral fee. For frontends to fill. Direct calls can use the zero address for no referrer fee.
id_uint256ID of the Market the bond is being purchased from
amount_uint256Amount to deposit in exchange for bond
minAmountOut_uint256Minimum acceptable amount of bond to receive. Prevents frontrunning

Returns

NameTypeDescription
<none>uint256Amount of payout token to be received from the bond
<none>uint48Timestamp at which the bond token can be redeemed for the underlying token

getFee

Get current fee charged by the teller based on the combined protocol and referrer fee

function getFee(address referrer_) external view returns (uint48);

Parameters

NameTypeDescription
referrer_addressAddress of the referrer

Returns

NameTypeDescription
<none>uint48Fee in basis points (3 decimal places)

setProtocolFee

Set protocol fee

Must be guardian

function setProtocolFee(uint48 fee_) external;

Parameters

NameTypeDescription
fee_uint48Protocol fee in basis points (3 decimal places)

setCreateFeeDiscount

Set the discount for creating bond tokens from the base protocol fee

The discount is subtracted from the protocol fee to determine the fee when using create() to mint bond tokens without using an Auctioneer

function setCreateFeeDiscount(uint48 discount_) external;

Parameters

NameTypeDescription
discount_uint48Create Fee Discount in basis points (3 decimal places)

setReferrerFee

Set your fee as a referrer to the protocol

Fee is set for sending address

function setReferrerFee(uint48 fee_) external;

Parameters

NameTypeDescription
fee_uint48Referrer fee in basis points (3 decimal places)

claimFees

Claim fees accrued by sender in the input tokens and sends them to the provided address

function claimFees(ERC20[] memory tokens_, address to_) external;

Parameters

NameTypeDescription
tokens_ERC20[]Array of tokens to claim fees for
to_addressAddress to send fees to