GEB Docs
Search
⌃K

Safe

This object represents a GEB safe. It has the entire SAFE state and provides helper functions to calculate its liquidation price, collateralization ratio etc.

Constructors

+ new Safe(contracts: ContractApis, handler: string, debt: BigNumber, collateral: BigNumber, collateralType: string, isManaged: boolean, safeId?: number): Safe
Parameters:
Name
Type
contracts
ContractApis
handler
string
debt
BigNumber
collateral
BigNumber
collateralType
string
isManaged
boolean
safeId?
number
Returns: Safe

Properties

collateral

collateral: BigNumber
Amount of collateral locked in the SAFE (WAD)

collateralType

collateralType: string
SAFE collateral type

debt

debt: BigNumber
Amount of debt generated by the SAFE (WAD)

handler

handler: string
SAFE handler in the SAFE Engine

isManaged

isManaged: boolean
Whether the safe was opened using a SAFE manager

Optional safeId

safeId? : number
Safe incremental ID, only for managed safes

Methods

getCRatio

getCRatio(): Promise‹FixedNumber | null›
Ratio used to calculate the amount of debt that can be drawn. Returns null is ratio is +Infinity. !! Uses unsafe division that can lead to precision loss.
Returns: Promise‹FixedNumber | null›
Promise CRatio

liquidationPrice

liquidationPrice(): Promise‹FixedNumber | null›
Price at which the SAFE will get liquidated.
Returns: Promise‹FixedNumber | null›
Liquidation price
Last modified 2yr ago