---
# System prepended metadata

title: ACTIVE stage callable functions
tags: [sublime]

---

# ACTIVE stage callable functions

###### tags: `sublime`

links:
[PCL stages](https://github.com/sublime-finance/sublime-v1-private/blob/master/contracts/interfaces/IPooledCreditLineEnums.sol)
[PCL.sol](https://github.com/sublime-finance/sublime-v1-private/blob/master/contracts/PooledCreditLine/PooledCreditLine.sol)
[LP.sol](https://github.com/sublime-finance/sublime-v1-private/blob/master/contracts/PooledCreditLine/LenderPool.sol)

## PooledCreditLine

### Callbacks from LenderPool

- [ ] accept
- [x] liquidate
- [ ] cancelRequestOnLowCollection

### Admin calls

- [ ] updateBorrowLimitLimits
- [ ] updateIdealCollateralRatioLimits
- [ ] updateBorrowRateLimits
- [ ] updateCollectionPeriodLimits
- [ ] updateDurationLimits
- [ ] updateDefaultGracePeriodLimits
- [ ] updateGracePenaltyRateLimits
- [ ] updateProtocolFeeFraction
- [ ] updateProtocolFeeCollector

### State changing

- [ ] initialize
- [x] request
- [x] depositCollateral
- [x] withdrawCollateral [only borower]
- [x] withdrawCollateral [only borower]
- [x] borrow [only borrower]
- [x] repay
- [x] close [only borrower]
- [ ] cancelRequest [only borrower]
- [x] terminate [only admin]
    - if collateral amount is 0 terminate will revert in savings account trasnfer method check [line](https://github.com/sublime-finance/sublime-v1-private/blob/c5d0c2b0dcb7c9ebba26589c4ca55f8a9eb5e1f9/contracts/PooledCreditLine/PooledCreditLine.sol#L866) 
- [x] getStatusAndUpdate

### View

- [ ] withdrawableCollateral
- [ ] calculateTotalCollateralTokens
- [ ] getRequiredCollateral
- [ ] calculateBorrowableAmount
- [ ] calculateInterestAccrued
- [ ] calculateCurrentDebt
- [ ] collateralTokensToLiquidate
- [ ] calculateCurrentCollateralRatio
- [ ] getPrincipal
- [ ] getBorrowerAddress
- [ ] getEndsAt

## Lender Pool

### Callbacks from PooledCreditLine

- [x] create
- [x] borrowed
- [x] repaid
- [ ] requestCancelled
- [x] terminate

### State changing

- [ ] lend
    - reverts because `startTime` is deleted
- [ ] start
    - reverts because startTime is deleted
- [x] withdrawInterest
- [ ] withdrawLiquidity
- [x] liquidate
    - TODO: add if condition on `_transferCollateral` inside PCL liquidate function so that PCL status can be changed to LIQUIDATED without reverting on `_transferCollateral` in case the `_collateralToLiquidate` is 0
- [ ] withdrawLiquidation
    - reverts in `_withdrawLiquidity`
- [x] Token transfer
    - TODO: check when functions names `calculate` alter the state and when they don't. Ideally state altering functions should be renamed.

### View

- [ ] getLenderInterest
- [ ] calculatePrincipalWithdrawable
- [ ] getLenderInfo