Skip to Content
Stacks Market V1

pool-0-reserve

Core Functions

  1. set-flashloan-fee-total
    • Sets the total fee for flash loans for a specific asset.
  2. set-flashloan-fee-protocol
    • Sets the protocol fee for flash loans for a specific asset.
  3. set-origination-fee-prc
    • Sets the origination fee percentage for a specific asset.
  4. set-health-factor-liquidation-treshold
    • Sets the health factor liquidation threshold.
  5. set-user-reserve-data
    • Sets user reserve data for a specific user and reserve.
  6. set-user-assets
    • Sets user assets data for a specific user.
  7. update-state-on-deposit
    • Updates the state when a user deposits assets.
  8. update-state-on-flash-loan
    • Updates the state after a flash loan is executed.
  9. update-state-on-repay
    • Updates the state when a user repays a loan.
  10. update-state-on-redeem
    • Updates the state when a user redeems assets.
  11. update-state-on-liquidation
    • Updates the state during the liquidation process.
  12. update-state-on-borrow
    • Updates the state when a user borrows assets.
  13. transfer-to-user
    • Transfers assets to a user.
  14. set-user-reserve-as-collateral
    • Sets a user’s reserve as collateral.
  15. mint-to-treasury
    • Mints assets to the treasury.
  16. transfer-to-reserve
    • Transfers assets to the reserve.
  17. set-user-index
    • Sets the user index for a specific user and asset.
  18. calculate-user-global-data
    • Calculates global data for a specific user.
  19. aggregate-user-data
    • Aggregates user data for calculating global parameters.
  20. update-reserve-interest-rates-and-timestamp
    • Updates the reserve interest rates and timestamp.
  21. update-cumulative-indexes
    • Updates cumulative indexes for a specific asset.

Input Parameters

1. set-flashloan-fee-total

ParameterTypeDescription
assetprincipalThe asset to set the fee for.
feeuintThe fee amount to set.

2. set-flashloan-fee-protocol

ParameterTypeDescription
assetprincipalThe asset to set the protocol fee for.
feeuintThe protocol fee amount to set.

set-origination-fee-prc

Sets the origination fee percentage for a specific asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
feeuintThe origination fee.

get-health-factor-liquidation-threshold

Gets the health factor liquidation threshold.

No input parameters

set-health-factor-liquidation-treshold

Sets the health factor liquidation threshold.

ParameterTypeDescription
hfuintThe health factor liquidation threshold.

set-user-reserve-data

Sets the reserve data for a user.

ParameterTypeDescription
userprincipalThe user identifier.
reserveprincipalThe reserve identifier.
datatupleThe reserve data.

set-user-assets

Sets the assets for a user.

ParameterTypeDescription
userprincipalThe user identifier.
datatupleThe assets data.

set-configurator

Sets the configurator address.

ParameterTypeDescription
new-configuratorprincipalThe new configurator address.

set-lending-pool

Sets the lending pool address.

ParameterTypeDescription
new-lending-poolprincipalThe new lending pool address.

set-liquidator

Sets the liquidator address.

ParameterTypeDescription
new-liquidatorprincipalThe new liquidator address.

set-admin

Sets the admin address.

ParameterTypeDescription
new-adminprincipalThe new admin address.

set-approved-contract

Sets an approved contract status.

ParameterTypeDescription
contractprincipalThe contract identifier.
enabledboolThe status to set.

set-optimal-utilization-rate

Sets the optimal utilization rate for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
rateuintThe optimal utilization rate.

set-base-variable-borrow-rate

Sets the base variable borrow rate for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
rateuintThe base variable borrow rate.

set-variable-rate-slope-1

Sets the variable rate slope 1 for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
rateuintThe variable rate slope 1.

set-variable-rate-slope-2

Sets the variable rate slope 2 for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
rateuintThe variable rate slope 2.

set-liquidation-close-factor-percent

Sets the liquidation close factor percent for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.
rateuintThe liquidation close factor percent.

get-optimal-utilization-rate

Gets the optimal utilization rate for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.

get-base-variable-borrow-rate

Gets the base variable borrow rate for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.

get-variable-rate-slope-1

Gets the variable rate slope 1 for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.

get-variable-rate-slope-2

Gets the variable rate slope 2 for an asset.

ParameterTypeDescription
assetprincipalThe asset identifier.

is-borroweable-isolated

Checks if an asset is borrowable in isolation mode.

ParameterTypeDescription
assetprincipalThe asset identifier.

get-borroweable-isolated

Gets the list of assets borrowable in isolation.

No input parameters

is-isolated-type

Checks if an asset is an isolated type.

ParameterTypeDescription
assetprincipalThe asset identifier.

set-borroweable-isolated

Sets the assets that can be borrowed in isolation mode.

ParameterTypeDescription
new-assetslist 100 principalList of new isolated assets.

remove-isolated-asset

Removes an asset from the isolated assets list.

ParameterTypeDescription
assetprincipalThe asset to be removed.

set-isolated-asset

Sets an asset as an isolated asset.

ParameterTypeDescription
assetprincipalThe asset to be set.

is-borrowing-assets

Checks if a user is borrowing any assets.

ParameterTypeDescription
userprincipalThe user identifier.

is-in-isolation-mode

Checks if a user is in isolation mode.

ParameterTypeDescription
whoprincipalThe user identifier.

get-assets-used-as-collateral

Gets the assets used as collateral by a user.

ParameterTypeDescription
whoprincipalThe user identifier.

get-isolated-asset

Gets the isolated asset for a user in isolation mode.

ParameterTypeDescription
whoprincipalThe user identifier.

add-supplied-asset-ztoken

Adds an asset to the supplied assets list for a user when a zToken is involved.

ParameterTypeDescription
whoprincipalThe user identifier.
assetprincipalThe asset to be added.

remove-supplied-asset-ztoken

Removes an asset from the supplied assets list for a user when a zToken is involved.

ParameterTypeDescription
whoprincipalThe user identifier.
assetprincipalThe asset to be removed.

update-state-on-deposit

Updates the state of a reserve based on a deposit action.

ParameterTypeDescription
asset<ft>The asset being deposited.
whoprincipalThe user making the deposit.
amount-depositeduintThe amount of the asset being deposited.
is-first-depositboolIndicates if this is the user’s first deposit.

update-state-on-flash-loan

Updates the state after a flash loan operation.

ParameterTypeDescription
receiverprincipalThe recipient of the flash loan.
asset<ft>The asset involved in the flash loan.
available-liquidity-beforeuintAvailable liquidity before the loan.
incomeuintIncome generated from the flash loan.
protocol-feeuintProtocol fee for the flash loan.

update-state-on-repay

Updates the state of a reserve based on a repay action.

ParameterTypeDescription
asset<ft>The asset being repaid.
whoprincipalThe user making the repayment.
payback-amount-minus-feesuintThe repayment amount minus any fees.
origination-fee-repaiduintThe origination fee that was repaid.
balance-increaseuintThe increase in balance from interest.
repaid-whole-loanboolIndicates if the whole loan was repaid.

update-state-on-redeem

Updates the state of a reserve based on a redeem action.

ParameterTypeDescription
asset<ft>The asset being redeemed.
whoprincipalThe user performing the redemption.
amount-claimeduintThe amount of the asset being redeemed.
user-redeemed-everythingboolIndicates if the user has redeemed all their assets.

update-state-on-liquidation

Updates the state of reserves involved in a liquidation process.

ParameterTypeDescription
principal-reserve<ft>The principal reserve in the liquidation.
collateral-reserve<ft>The collateral reserve in the liquidation.
borrowerprincipalThe borrower undergoing liquidation.
liquidator-addrprincipalThe address of the liquidator.
principal-amount-to-liquidateuintThe amount of principal being liquidated.
collateral-to-liquidateuintThe amount of collateral being liquidated.
fee-liquidateduintThe fee associated with the liquidation.
liquidated-collateral-for-feeuintThe amount of collateral used for the fee.
balance-increaseuintThe increase in balance due to interest accrual.
purchased-all-collateralbool
Last updated on