Aggregator Contract
Last updated
Last updated
The Aggregator Contract implements the functions required in the .
Additionally, it implements state variables for the management of markets across multiple Auctioneers, tracking whitelisted Auctioneers.
The Aggregator contract keeps a unique set of market IDs across multiple Tellers and Auctioneers. Additionally, it aggregates market data from multiple Auctioneers in convenient view functions for front-end interfaces.
Returns current capacity of a market
id_
uint256
Market ID
capacity
uint256
Current capacity of the market
Returns the market ID with the highest current payoutToken payout for depositing quoteToken
payout_
address
Address of payout token
quote_
address
Address of quote token
amountIn_
uint256
Amount of quote tokens to deposit
minAmountOut_
uint256
Minimum amount of payout tokens to receive as payout
maxExpiry_
uint256
Latest acceptable vesting timestamp for bond Inputting the zero address will take into account just the protocol fee.
id_
uint256
Market ID
Get the auctioneer for the provided market ID
id_
uint256
Market ID
auctioneer
contract IBondAuctioneer
Address of the auctioneer that provides the market
Returns the Teller that services the market ID
id_
uint256
Market ID
teller
contract IBondTeller
Address of the teller that services the market
Does market send payout immediately
id_
uint256
Market ID to search for
isInstant
bool
Whether the market is instant swap (true) or has vesting of the payout (false)
Is a given market accepting purchases
id_
uint256
ID of market
isLive
bool
Whether the market is accepting purchases
Returns array of active market IDs within a range
Should be used if length exceeds max to query entire array
firstIndex_
uint256
Start index of market range
lastIndex_
uint256
End index of market range
ids
uint256[]
IDs of markets
Returns an array of all active market IDs for a given owner
owner_
address
Address of owner to query by
ids
uint256[]
IDs of markets
Returns an array of all active market IDs for a given quote token
token_
address
Address of token to query by
isPayout_
bool
If true, search by payout token, else search for quote token
ids
uint256[]
IDs of markets
Counter for bond markets on approved auctioneers
nextId
uint256
Next market ID to be assigned
Calculate current market price of payout token in quote tokens
Accounts for debt and control variable decay since last deposit (vs _marketPrice())
id_
uint256
ID of market
price
uint256
Price for market (see the specific auctioneer for units)
Scale value to use when converting between quote token and payout token amounts with marketPrice()
id_
uint256
ID of market
scale
uint256
Scaling factor for market in configured decimals (see auctioneer for units)
Returns an array of all active market IDs for a given payout and quote token
payout_
address
Address of payout token
quote_
address
Address of quote token
ids
uint256[]
IDs of markets
Market IDs for payout token
payoutToken_
address
Address of payout token
ids
uint256
IDs of markets
Market IDs for quote token
quoteToken_
address
Address of quote token
ids
uint256
IDs of markets
Auctioneer for Market ID
id_
uint256
ID of market
auctioneer
contract IBondAuctioneer
Auctioneer that provides market
Returns maximum amount of quote token accepted by the market
id_
uint256
ID of market
referrer_
address
Address of referrer, used to get fees to calculate accurate payout amount. Inputting the zero address will take into account just the protocol fee.
amountIn
uint256
Max amount of quote token that can currently be exchanged with the market
Payout due for amount of quote tokens
Accounts for debt and control variable decay so it is up to date
amount_
uint256
Amount of quote tokens to spend
id_
uint256
ID of market
referrer_
address
Address of referrer, used to get fees to calculate accurate payout amount. Inputting the zero address will take into account just the protocol fee.
payout
uint256
amount of payout tokens to be paid
Register a auctioneer with the aggregatorOnly Guardian
A auctioneer must be registered with an aggregator to create markets
auctioneer_
contract IBondAuctioneer
Address of the Auctioneer to register
Register a new market with the aggregatorOnly registered depositories
payoutToken_
contract ERC20
Token to be paid out by the market
quoteToken_
contract ERC20
Token to be accepted by the market
marketId
uint256
ID of market