pool-borrow
List of Core Functions:
supply: Supplies an asset to the protocol.withdraw: Withdraws an asset from the protocol.borrow: Borrows an asset from the protocol.repay: Repays a borrowed asset.liquidation-call: Executes a liquidation call on an undercollateralized loan.flashloan: Executes a flash loan transaction.set-configurator: Sets the configurator address.set-user-use-reserve-as-collateral: Sets whether a user’s reserve can be used as collateral.init: Initializes a reserve.set-reserve: Sets the state of a reserve.set-borrowing-enabled: Enables or disables borrowing for a reserve.set-usage-as-collateral-enabled: Enables or disables a reserve’s usage as collateral.add-isolated-asset: Adds an asset to the list of isolated assets.add-asset: Adds an asset to the protocol.remove-asset: Removes an asset from the protocol.remove-isolated-asset: Removes an asset from the list of isolated assets.set-borroweable-isolated: Sets an asset as borrowable when isolated assets are used as collateral.remove-borroweable-isolated: Removes an asset from the list of borrowable assets when isolated assets are used as collateral.-
set-e-mode: activate/deactivate the E-mode.
Detailed Tables:
supply
Supplies an asset to the protocol.
| Parameter | Type | Description |
|---|---|---|
lp | <ft-mint-trait> | The liquidity pool trait reference. |
pool-reserve | principal | The pool reserve address. |
asset | <ft> | The asset to supply. |
amount | uint | The amount of the asset to supply. |
owner | principal | The owner of the asset. |
withdraw
Withdraws an asset from the protocol.
| Parameter | Type | Description |
|---|---|---|
pool-reserve | principal | The pool reserve address. |
asset | <ft> | The asset to withdraw. |
oracle | <oracle-trait> | The oracle trait reference. |
assets | list | List of asset details. |
amount | uint | The amount to withdraw. |
current-balance | uint | The current balance of the user. |
owner | principal | The owner of the asset. |
borrow
Borrows an asset from the protocol.
| Parameter | Type | Description |
|---|---|---|
pool-reserve | principal | The pool reserve address. |
oracle | <oracle-trait> | The oracle trait reference. |
asset-to-borrow | <ft> | The asset to borrow. |
lp | <ft> | The liquidity pool trait reference. |
assets | list | List of asset details. |
amount-to-be-borrowed | uint | The amount to be borrowed. |
fee-calculator | principal | The fee calculator address. |
interest-rate-mode | uint | The interest rate mode. |
owner | principal | The owner of the asset. |
repay
Repays a borrowed asset.
| Parameter | Type | Description |
|---|---|---|
asset | <ft> | The asset to repay. |
amount-to-repay | uint | The amount to repay. |
on-behalf-of | principal | The user on behalf of whom the repayment is made. |
payer | principal | The user who is making the repayment. |
liquidation-call
Executes a liquidation call on an undercollateralized loan.
| Parameter | Type | Description |
|---|---|---|
assets | list | List of asset details. |
collateral-lp | <a-token> | The collateral liquidity pool trait reference. |
collateral-to-liquidate | <ft> | The collateral asset to liquidate. |
debt-asset | <ft> | The debt asset involved in the liquidation. |
collateral-oracle | <oracle-trait> | The oracle trait for the collateral. |
debt-oracle | <oracle-trait> | The oracle trait for the debt. |
liquidated-user | principal | The user being liquidated. |
debt-amount | uint | The amount of debt to cover in the liquidation. |
to-receive-atoken | bool | Whether to receive aTokens or underlying asset. |
flashloan
Executes a flash loan transaction.
| Parameter | Type | Description |
|---|---|---|
receiver | principal | The receiver of the flash loan. |
lp | <ft> | The liquidity pool trait reference. |
asset | <ft> | The asset to be flash loaned. |
amount | uint | The amount of the flash loan. |
flashloan | <flash-loan> | The flash loan trait reference. |
set-configurator
Sets the configurator address.
| Parameter | Type | Description |
|---|---|---|
new-configurator | principal | The new configurator address. |
set-user-use-reserve-as-collateral
Sets whether a user’s reserve can be used as collateral.
| Parameter | Type | Description |
|---|---|---|
who | principal | The user for whom the setting is being applied. |
lp-token | <ft> | The liquidity pool token trait reference. |
asset | <ft> | The asset to set for collateral usage. |
enable-as-collateral | bool | Whether the asset should be used as collateral. |
oracle | <oracle-trait> | The oracle trait reference. |
assets-to-calculate | list | List of assets to calculate for the collateral check. |
init
Initializes a reserve.
| Parameter | Type | Description |
|---|---|---|
a-token-address | principal | The address of the aToken. |
asset | principal | The asset to initialize. |
decimals | uint | The number of decimals for the asset. |
supply-cap | uint | The supply cap for the asset. |
borrow-cap | uint | The borrow cap for the asset. |
oracle | principal | The oracle address for the asset. |
interest-rate-strategy-address | principal | The interest rate strategy address. |
set-reserve
Sets the state of a reserve.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset for which to set the reserve. |
state | tuple | The state details of the reserve. |
set-borrowing-enabled
Enables or disables borrowing for a reserve.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset for which to set borrowing. |
enabled | bool | Whether borrowing should be enabled. |
set-usage-as-collateral-enabled
Enables or disables a reserve’s usage as collateral.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset for which to set the usage. |
enabled | bool | Whether the usage as collateral should be enabled. |
base-ltv-as-collateral | uint | The base LTV as collateral. |
liquidation-threshold | uint | The liquidation threshold. |
liquidation-bonus | uint | The liquidation bonus. |
add-isolated-asset
Adds an asset to the list of isolated assets.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be added to the list. |
debt-ceiling | uint | The debt ceiling for the asset. |
add-asset
Adds an asset to the protocol.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be added. |
remove-asset
Removes an asset from the protocol.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be removed. |
remove-isolated-asset
Removes an asset from the list of isolated assets.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be removed from the list. |
set-borroweable-isolated
Sets an asset as borrowable when isolated assets are used as collateral.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be set as borrowable. |
remove-borroweable-isolated
Removes an asset from the list of borrowable assets when isolated assets are used as collateral.
| Parameter | Type | Description |
|---|---|---|
asset | principal | The asset to be removed from the list of borrowable. |
set-e-mode
Activate or deactivate the E-mode.
| Parameter | Type | Description |
|---|---|---|
user | principal | the actual user. |
assets | list | The lists of available assets in e-mode. |
new-e-mode-type | buff 1 |
|