; and (C) such other matters as the Secretary determines appropriate. (f) Contract terms (1) Payment of monthly fees for management Subject to paragraph (2), the Secretary shall pay to each eligible entity with a contract under this section for a stockpile of generic drugs at risk of shortage appropriate monthly fees for the management of the stockpile. (2) Payment conditioned on stockpile adequacy (A) In general Except as provided in subparagraph (B), each contract with an eligible entity under this section shall provide that no payment under the contract may be made until the entity demonstrates to the Secretary that the entity has stockpiled such portion of the total quantity of drugs to be stockpiled under the contract as the Secretary determines to be acceptable for payment. (B) Exceptions for advance payments (i) In general A contract under this section may provide that, if the Secretary determines (in the Secretary’s discretion) that an advance payment, partial payment for significant milestones, or payment to increase capacity is necessary to ensure success of the terms of the contract, the Secretary shall pay, in advance of delivery, an amount not to exceed 10 percent of the total contract amount to be paid to the eligible entity by the Secretary pursuant to the contract over the full period of the contract. (ii) Cost of capital A contract under this section may provide for payments to compensate the contracting eligible entity for additional capital requirements related to the additional inventory to be maintained. (iii) Timing The Secretary shall, to the extent practicable, make any determination under clause (i) to make an advance payment at the same time as the issuance of a solicitation. (iv) Repayment If the Secretary makes an advance payment pursuant to clause (i), the Secretary shall require the eligible entity receiving such advance payment to repay it if there is a failure to perform by the eligible entity. (3) Termination Nothing in this section shall be construed as affecting the rights of