# Huma Institutional

## Autotasks

The Huma protocol employs OpenZepplin's Autotasks to perform certain routine processes. There are four types of Autotasks, with each of them supporting a different aspect of the pool operation:

### AutoPay Autotask

* Fetch all credits with a due date in the next 2 days and the credit state is in `GoodStanding` or `Delayed`.
* For each credit, if the borrower has enough funds in their wallet to cover the payment amount (`nextDue + totalPastDue`), and has approved enough allowance to the pool, call `makePayment` on behalf of the borrower to pay back the pool.

### Close Epoch Autotask

* Fetch all pools where the current epoch `endTime` is in the past.
* Call `processYieldForLenders` on the junior and senior tranche.
* Call `closeEpoch` on the epoch manager contract.
* Call `investFeesInFirstLossCover` on the pool fee manager contract.
* Call `payoutYield` on all first loss cover contracts of the pool.

### Refresh Credit Autotask

* Fetch all credit lines where `nextBillRefreshDate` is in the past and credit state is in `GoodStanding` or `Delayed`.
* Call `refreshCredit` on the credit manager contract for that borrower.

### Start Committed Credit Autotask

* Fetch all credit lines where credit state is `Approved`, committed amount is greater than 0, and the designated credit start date is in the past.
* Call `startCommittedCredit` on the credit manager contract for that credit.

### Submit Redemption Request Autotask

* Fetch all pools that has the `autoRedmeptionAfterLockUp` setting enabled.
* For each pool, fetch all lenders whose deposit lockup period has expired.
* Call `addRedemptionRequest` on the contract to submit redemption requests for all the shares owned by the lender.

Unless otherwise noted, all Autotasks run every 5 minutes. For access control, Autotasks will call contracts using the Sentinel service account wallet.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.huma.finance/ecosystem-resources/technical-docs/huma-institutional.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
