Skip to Content
Stacks Market V1

pool-borrow

List of Core Functions:

  1. supply: Supplies an asset to the protocol.
  2. withdraw: Withdraws an asset from the protocol.
  3. borrow: Borrows an asset from the protocol.
  4. repay: Repays a borrowed asset.
  5. liquidation-call: Executes a liquidation call on an undercollateralized loan.
  6. flashloan: Executes a flash loan transaction.
  7. set-configurator: Sets the configurator address.
  8. set-user-use-reserve-as-collateral: Sets whether a user’s reserve can be used as collateral.
  9. init: Initializes a reserve.
  10. set-reserve: Sets the state of a reserve.
  11. set-borrowing-enabled: Enables or disables borrowing for a reserve.
  12. set-usage-as-collateral-enabled: Enables or disables a reserve’s usage as collateral.
  13. add-isolated-asset: Adds an asset to the list of isolated assets.
  14. add-asset: Adds an asset to the protocol.
  15. remove-asset: Removes an asset from the protocol.
  16. remove-isolated-asset: Removes an asset from the list of isolated assets.
  17. set-borroweable-isolated: Sets an asset as borrowable when isolated assets are used as collateral.
  18. remove-borroweable-isolated: Removes an asset from the list of borrowable assets when isolated assets are used as collateral.
  19. set-e-mode : activate/deactivate the E-mode.

Detailed Tables:

supply

Supplies an asset to the protocol.

ParameterTypeDescription
lp<ft-mint-trait>The liquidity pool trait reference.
pool-reserveprincipalThe pool reserve address.
asset<ft>The asset to supply.
amountuintThe amount of the asset to supply.
ownerprincipalThe owner of the asset.

withdraw

Withdraws an asset from the protocol.

ParameterTypeDescription
pool-reserveprincipalThe pool reserve address.
asset<ft>The asset to withdraw.
oracle<oracle-trait>The oracle trait reference.
assetslistList of asset details.
amountuintThe amount to withdraw.
current-balanceuintThe current balance of the user.
ownerprincipalThe owner of the asset.

borrow

Borrows an asset from the protocol.

ParameterTypeDescription
pool-reserveprincipalThe 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.
assetslistList of asset details.
amount-to-be-borroweduintThe amount to be borrowed.
fee-calculatorprincipalThe fee calculator address.
interest-rate-modeuintThe interest rate mode.
ownerprincipalThe owner of the asset.

repay

Repays a borrowed asset.

ParameterTypeDescription
asset<ft>The asset to repay.
amount-to-repayuintThe amount to repay.
on-behalf-ofprincipalThe user on behalf of whom the repayment is made.
payerprincipalThe user who is making the repayment.

liquidation-call

Executes a liquidation call on an undercollateralized loan.

ParameterTypeDescription
assetslistList 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-userprincipalThe user being liquidated.
debt-amountuintThe amount of debt to cover in the liquidation.
to-receive-atokenboolWhether to receive aTokens or underlying asset.

flashloan

Executes a flash loan transaction.

ParameterTypeDescription
receiverprincipalThe receiver of the flash loan.
lp<ft>The liquidity pool trait reference.
asset<ft>The asset to be flash loaned.
amountuintThe amount of the flash loan.
flashloan<flash-loan>The flash loan trait reference.

set-configurator

Sets the configurator address.

ParameterTypeDescription
new-configuratorprincipalThe new configurator address.

set-user-use-reserve-as-collateral

Sets whether a user’s reserve can be used as collateral.

ParameterTypeDescription
whoprincipalThe 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-collateralboolWhether the asset should be used as collateral.
oracle<oracle-trait>The oracle trait reference.
assets-to-calculatelistList of assets to calculate for the collateral check.

init

Initializes a reserve.

ParameterTypeDescription
a-token-addressprincipalThe address of the aToken.
assetprincipalThe asset to initialize.
decimalsuintThe number of decimals for the asset.
supply-capuintThe supply cap for the asset.
borrow-capuintThe borrow cap for the asset.
oracleprincipalThe oracle address for the asset.
interest-rate-strategy-addressprincipalThe interest rate strategy address.

set-reserve

Sets the state of a reserve.

ParameterTypeDescription
assetprincipalThe asset for which to set the reserve.
statetupleThe state details of the reserve.

set-borrowing-enabled

Enables or disables borrowing for a reserve.

ParameterTypeDescription
assetprincipalThe asset for which to set borrowing.
enabledboolWhether borrowing should be enabled.

set-usage-as-collateral-enabled

Enables or disables a reserve’s usage as collateral.

ParameterTypeDescription
assetprincipalThe asset for which to set the usage.
enabledboolWhether the usage as collateral should be enabled.
base-ltv-as-collateraluintThe base LTV as collateral.
liquidation-thresholduintThe liquidation threshold.
liquidation-bonusuintThe liquidation bonus.

add-isolated-asset

Adds an asset to the list of isolated assets.

ParameterTypeDescription
assetprincipalThe asset to be added to the list.
debt-ceilinguintThe debt ceiling for the asset.

add-asset

Adds an asset to the protocol.

ParameterTypeDescription
assetprincipalThe asset to be added.

remove-asset

Removes an asset from the protocol.

ParameterTypeDescription
assetprincipalThe asset to be removed.

remove-isolated-asset

Removes an asset from the list of isolated assets.

ParameterTypeDescription
assetprincipalThe asset to be removed from the list.

set-borroweable-isolated

Sets an asset as borrowable when isolated assets are used as collateral.

ParameterTypeDescription
assetprincipalThe 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.

ParameterTypeDescription
assetprincipalThe asset to be removed from the list of borrowable.

set-e-mode

Activate or deactivate the E-mode.

ParameterTypeDescription
userprincipalthe actual user.
assetslistThe lists of available assets in e-mode.
new-e-mode-typebuff 1

0x00 is not in e-mode.
0x01 is in STX-correlated e-mode.

Last updated on