DullahanPodManager

UNIT

uint256 UNIT

1e18 scale

MAX_BPS

uint256 MAX_BPS

Max value for BPS - 100%

Pod

struct Pod {
  address podAddress;
  address podOwner;
  address collateral;
  uint96 lastUpdate;
  uint256 lastIndex;
  uint256 rentedAmount;
  uint256 accruedFees;
}

vault

Address of the Dullahan Vault

rewardsStaking

Address of the Dullahan Staking contract

podImplementation

Address of the Pod implementation

protocolFeeChest

Address of the Chest to receive fees

registry

Address of the Dullahan Registry

allowedCollaterals

Allowed token to be used as collaterals

aTokenForCollateral

Address of aToken from the Aave Market for each collateral

pods

State for Pods

allPods

List of all created Pods

ownerPods

List of Pods created by an user

feeModule

Address of the Fee Module

oracleModule

Address of the Oracle Module

discountCalculator

Address of the Discount Calculator Module

lastUpdatedIndex

Last updated value of the Index

lastIndexUpdate

Last update timestamp for the Index

extraLiquidationRatio

Extra ratio applied during liquidations

mintFeeRatio

Ratio of minted amount taken as minting fees

protocolFeeRatio

Ratio of renting fees taken as protocol fees

reserveAmount

Total amount set as reserve (holding Vault renting fees)

processThreshold

Min amount in the reserve to be processed

PodCreation

Event emitted when a new Pod is created

FreedStkAave

Event emitted when stkAAVE is clawed back from a Pod

RentedStkAave

Event emitted when stkAAVE is rented to a Pod

LiquidatedPod

Event emitted when a Pod is liquidated

PaidFees

Event emitted when renting fees are paid

MintingFees

Event emitted when minting fees are paid

ReserveProcessed

Event emitted when the Reserve is processed

NewCollateral

Event emitted when a new collateral is added

CollateralUpdated

Event emitted when a colalteral is updated

RegistryUpdated

Event emitted when the Registry is updated

FeeModuleUpdated

Event emitted when the Fee Module is updated

OracleModuleUpdated

Event emitted when the Oracle Module is updated

DiscountCalculatorUpdated

Event emitted when the Discount Calculator Module is updated

FeeChestUpdated

Event emitted when the Fee Chest is updated

MintFeeRatioUpdated

Event emitted when the Mint Fee Ratio is updated

ProtocolFeeRatioUpdated

Event emitted when the Protocol Fee Ratio is updated

ExtraLiquidationRatioUpdated

Event emitted when the Extra Liquidation Ratio is updated

ProcessThresholdUpdated

Event emitted when the Mint Fee Ratio is updated

isValidPod

Check that the caller is a valid Pod

constructor

getCurrentIndex

Get the current fee index

Return Values

Name
Type
Description

[0]

uint256

uint256 : Current index

podCurrentOwedFees

Get the current amount of fees owed by a Pod

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

uint256

uint256 : Current amount of fees owed

podOwedFees

Get the stored amount of fees owed by a Pod

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

uint256

uint256 : Stored amount of fees owed

getAllPods

Get all Pods created by this contract

Return Values

Name
Type
Description

[0]

address[]

address[] : List of Pods

getAllOwnerPods

Get the list of Pods owned by a given account

Parameters

Name
Type
Description

account

address

Address of the Pods owner

Return Values

Name
Type
Description

[0]

address[]

address[] : List of Pods

isPodLiquidable

Check if the given Pod is liquidable

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

bool

bool : True if liquidable

estimatePodLiquidationexternal

Estimate the amount of fees to repay to liquidate a Pod & the amount of collaterla to receive after liquidation

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

feeAmount

uint256

- uint256 : Amount of fees to pay to liquidate

collateralAmount

uint256

- uint256 : Amount of collateral to receive after liquidation

createPod

Create a new Pod

Clone the Pod implementation, initialize it & store the paremeters

Parameters

Name
Type
Description

collateral

address

Address of the collateral for the new Pod

Return Values

Name
Type
Description

[0]

address

address : Address of the newly deployed Pod

updateGlobalState

Update the global state

Return Values

Name
Type
Description

[0]

bool

bool : Success

updatePodState

Update a Pod state

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

bool

bool : Success

freeStkAave

Free all stkAAVE not currently needed by a Pod

Calculate the needed amount of stkAAVE for a Pod & free any extra stkAAVE held by the Pod

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

bool

bool : Success

liquidatePod

Liquidate a Pod that owes fees & has no GHO debt

Repay the fees owed by the Pod & receive some of the Pod colleteral (with an extra ratio)

Parameters

Name
Type
Description

pod

address

Address of the Pod

Return Values

Name
Type
Description

[0]

bool

bool : Success

updatePodDelegation

Update the delegator of a Pod

Parameters

Name
Type
Description

pod

address

Address of the Pod

updateMultiplePodsDelegation

Update the delegator for a list of Pods

Parameters

Name
Type
Description

podList

address[]

List of Pod addresses

processReserve

Process the Reserve

Send the Reserve to the staking contract to be queued for distribution & take a part as protocol fees

Return Values

Name
Type
Description

[0]

bool

bool : Success

getStkAave

Get the needed amount of stkAAVE for a Pod based on the GHO amount minted

Calculate the amount of stkAAVE a Pod need based on its GHO debt & amount ot be minted & request the needed amount to the Vault for renting

Parameters

Name
Type
Description

amountToMint

uint256

Amount of GHO to be minted

Return Values

Name
Type
Description

[0]

bool

bool : Success

notifyStkAaveClaim

Notify the Vault for claimed rewards from the Safety Module for a Pod

Parameters

Name
Type
Description

claimedAmount

uint256

Amount of rewards claimed

notifyPayFee

Notify fees paid by a Pod

Parameters

Name
Type
Description

feeAmount

uint256

Amount of fees paid

notifyMintingFee

Notify minting fees paid by a Pod

Parameters

Name
Type
Description

feeAmount

uint256

Amount of fees paid

_calculatedNeededStkAave

Calculates the amount of stkAAVE needed by a Pod based on its GHO debt & the amount of GHO to be minted

Parameters

Name
Type
Description

pod

address

Address of the Pod

addedDebtAmount

uint256

Amount of GHO to be minted

Return Values

Name
Type
Description

[0]

uint256

uint256 : Amount of stkAAVE needed

_accruedIndex

Calculate the index accrual based on the current fee per second

Return Values

Name
Type
Description

[0]

uint256

uint256 : index accrual

_updateGlobalState

Update the global state by updating the fee index

Return Values

Name
Type
Description

[0]

bool

bool : Success

_updatePodState

Update a Pod's state & accrued owed fees based on the last updated index

Parameters

Name
Type
Description

podAddress

address

Address of the Pod

Return Values

Name
Type
Description

[0]

bool

bool : Success

_processReserve

Send the Reserve to the staking contract to be queued for distribution & take a part as protocol fees

Return Values

Name
Type
Description

[0]

bool

bool : Success

updatePodRegistry

Update the Registry for a given Pod

Parameters

Name
Type
Description

pod

address

Address of the Pod

updateMultiplePodsRegistry

Update the Registry for a given list of Pods

Parameters

Name
Type
Description

podList

address[]

List of Pod addresses

updateAllPodsRegistry

Update the Registry for all Pods

pause

Pause the contract

unpause

Unpause the contract

addCollateral

Add a new collateral for Pod creation

Parameters

Name
Type
Description

collateral

address

Address of the collateral

aToken

address

Address of the aToken associated to the collateral

updateCollateral

Update a collateral for Pod creation

Parameters

Name
Type
Description

collateral

address

Address of the collateral

allowed

bool

Is the collateral allowed ofr Pod creation

updateFeeChest

Uodate the FeeChest

Parameters

Name
Type
Description

newFeeChest

address

Address of the new FeeChest

updateRegistry

Uodate the Registry

Parameters

Name
Type
Description

newRegistry

address

Address of the new Registry

updateFeeModule

Uodate the Fee Module

Parameters

Name
Type
Description

newModule

address

Address of the new Module

updateOracleModule

Uodate the Oracle Module

Parameters

Name
Type
Description

newModule

address

Address of the new Module

updateDiscountCalculator

Uodate the Discount Calculator Module

Parameters

Name
Type
Description

newCalculator

address

Address of the new Calculator

updateMintFeeRatio

Uodate the mint fee ratio parameter

Parameters

Name
Type
Description

newRatio

uint256

New ratio value

updateProtocolFeeRatio

Uodate the protocol fee ratio parameter

Parameters

Name
Type
Description

newRatio

uint256

New ratio value

updateExtraLiquidationRatio

Uodate the extra liquidation ratio parameter

Parameters

Name
Type
Description

newRatio

uint256

New ratio value

updateProcessThreshold

Uodate the process threshold parameter

Parameters

Name
Type
Description

newThreshold

uint256

New treshold value

safe96

Last updated

Was this helpful?