TermAuctionList.sol#TermAuctionList
State Variables
NULL_NODE
Functions
_getNext
Get the next node in the list
Parameters
listData
TermAuctionListData
The list data
current
bytes32
The current node
Returns
<none>
bytes32
The next node
_count
Count the number of nodes in the list
Parameters
listData
TermAuctionListData
The list data
Returns
count
uint256
The number of nodes in the list
pendingOffers
Retrieves an array of offer IDs representing the pending offers
This function iterates through the list of offers and gathers their IDs into an array of bytes32
. This makes it easier to process and manage the pending offers.
Parameters
listData
TermAuctionListData
The list data
Returns
offers
bytes32[]
An array of offer IDs representing the pending offers
insertPending
Inserts a new pending offer into the list data
This function inserts a new pending offer while maintaining the list sorted by auction address. The function iterates through the list to find the correct position for the new offerId
and updates the pointers accordingly.
Parameters
listData
TermAuctionListData
The list data
offerId
bytes32
The ID of the offer to be inserted
pendingOffer
PendingOffer
The PendingOffer
struct containing details of the offer to be inserted
removeCompleted
Removes completed or cancelled offers from the list data and processes the corresponding repoTokens
This function iterates through the list of offers and removes those that are completed or cancelled. It processes the corresponding repoTokens by validating and inserting them if necessary. This helps maintain the list by clearing out inactive offers and ensuring repoTokens are correctly processed.
Parameters
listData
TermAuctionListData
The list data
repoTokenListData
RepoTokenListData
The repoToken list data
discountRateAdapter
ITermDiscountRateAdapter
The discount rate adapter
asset
address
The address of the asset
getPresentValue
Calculates the total present value of all relevant offers related to a specified repoToken
This function calculates the present value of offers in the list. If repoTokenToMatch
is provided, it will filter the calculations to include only the specified repoToken. If repoTokenToMatch
is not provided, it will aggregate the present value of all repoTokens in the list. This provides flexibility for both aggregate and specific token evaluations.
Parameters
listData
TermAuctionListData
The list data
repoTokenListData
RepoTokenListData
The repoToken list data
discountRateAdapter
ITermDiscountRateAdapter
The discount rate adapter
purchaseTokenPrecision
uint256
The precision of the purchase token
repoTokenToMatch
address
The address of the repoToken to match (optional)
Returns
totalValue
uint256
The total present value of the offers
getCumulativeOfferData
Get cumulative offer data for a specified repoToken
offer processed, but auctionClosed not yet called and auction is new so repoToken not on List and wont be picked up checking repoTokendiscountRates to make sure we are not double counting on re-openings
This function calculates cumulative data for all offers in the list. The repoToken
and newOfferAmount
parameters are optional and provide flexibility to include the newOfferAmount for a specified repoToken in the calculation. If repoToken
is set to address(0)
or newOfferAmount
is 0
, the function calculates the cumulative data without adjustments.
Parameters
listData
TermAuctionListData
The list data
repoTokenListData
RepoTokenListData
The repoToken list data
discountRateAdapter
ITermDiscountRateAdapter
The discount rate adapter
repoToken
address
The address of the repoToken (optional)
newOfferAmount
uint256
The new offer amount for the specified repoToken
purchaseTokenPrecision
uint256
The precision of the purchase token
Returns
cumulativeWeightedTimeToMaturity
uint256
The cumulative weighted time to maturity
cumulativeOfferAmount
uint256
The cumulative repoToken amount
found
bool
Whether the specified repoToken was found in the list
Last updated