Borrowing

In the Ordibank protocol, users have the ability to augment their account's collateral by utilizing the supply function. However, this action is constrained by the market's current state a parameter designed to mitigate risk exposure to collateral assets.

The inclusion of collateral assets amplifies a user's borrowing capacity, and this augmentation is contingent upon the asset's borrowCollateralFactor. These factors, depicted as percentages, signify the fraction of the collateral value that is eligible for borrowing.

To initiate borrowing of the base asset, the withdraw function is employed. However, adherence to the borrowing collateral factor requirements is imperative. In the event that a borrowing account falls short of these criteria, it is precluded from borrowing additional assets until it either fortifies its collateral by supplying more assets or reduces its borrow balance using the supply function.

Account balances for the base token are represented as signed integers. A positive balance signifies that the base asset has been supplied, while a negative balance indicates that the base asset has been borrowed.

Internally, Ordibank utilizes dB to store account balances as principal values, also manifested as signed integers. The principal value, synonymous with the day-zero balance, denotes the balance an account would have at T0 to equate to the present account balance after interest accrual.

The global indices for supply and borrow operate as unsigned integers, progressively increasing over time to accommodate interest accrual on each side. Whenever an account engages with the protocol, the indices undergo updates and are persistently saved. Developers can calculate an account's present balance using the current index with the provided formulas:

[Principal>0]Balance=Principal×BaseSupplyIndex[Principal>0][Principal > 0]Balance=Principal×BaseSupplyIndex[Principal > 0]

[Principal<0]Balance=Principal×BaseBorrowIndex[Principal<0][Principal < 0]Balance=Principal×BaseBorrowIndex[Principal < 0]

This intricate system ensures precise tracking of collateral and borrowing activities in the Ordibank platform, enhancing developer control and user transparency within the cBTC money market.

Last updated