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

Defined in packages/geb/src/schema/safe.ts:8

Parameters:

Name

Type

contracts

ContractApis

handler

string

debt

BigNumber

collateral

BigNumber

collateralType

string

isManaged

boolean

safeId?

number

Returns: Safe

Properties

collateral

collateral: BigNumber

Defined in packages/geb/src/schema/safe.ts:23

Amount of collateral locked in the SAFE (WAD)

collateralType

collateralType: string

Defined in packages/geb/src/schema/safe.ts:27

SAFE collateral type

debt

debt: BigNumber

Defined in packages/geb/src/schema/safe.ts:19

Amount of debt generated by the SAFE (WAD)

handler

handler: string

Defined in packages/geb/src/schema/safe.ts:15

SAFE handler in the SAFE Engine

isManaged

isManaged: boolean

Defined in packages/geb/src/schema/safe.ts:31

Whether the safe was opened using a SAFE manager

Optional safeId

safeId? : number

Defined in packages/geb/src/schema/safe.ts:35

Safe incremental ID, only for managed safes

Methods

getCRatio

getCRatio(): Promise‹FixedNumber | null›

Defined in packages/geb/src/schema/safe.ts:42

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›

Defined in packages/geb/src/schema/safe.ts:70

Price at which the SAFE will get liquidated.

Returns: Promise‹FixedNumber | null›

Liquidation price