๐Ÿ“–
Yupana Document Portal
  • Introduction
    • What is Yupana.Finance?
    • Participants
    • FAQ
  • Lending
    • Supplying assets
      • General
    • Borrowing assets
      • General
  • Liquidation
  • Liquidity Risk
    • Yupana Interest Rate
  • โš™๏ธDeveloper space
    • yToken contract methods
      • ๐Ÿ“„Storage overview
      • accrueInterest
      • priceCallback
      • updateInterest
      • ๐Ÿ”ตLending methods
        • borrow
        • enterMarket
        • exitMarket
        • liquidate
        • mint
        • redeem
        • repay
      • ๐Ÿ”ตFA2 Token entrypoints
        • balance_of
        • get_total_supply
        • transfer
        • update_operators
      • ๐Ÿ›‘Admin methods
        • ๐Ÿ“ฅSetup entrypionts
          • setTokenAction
          • setUseAction
        • ๐ŸคนManage entrypoints
          • addMarket
          • setAdmin
          • setBorrowPause
          • setGlobalFactors
          • setTokenFactors
          • updateMetadata
          • withdrawReserve
    • InterestRate contract
      • ๐Ÿ”ตOn-chain views
        • getBorrowRate
        • getSupplyRate
        • getUtilizationRate
      • ๐Ÿ›‘Admin methods
        • setCoefficients
        • updateAdmin
    • PriceFeed contract
      • getPrice
      • receivePrice
      • ๐Ÿ›‘Admin methods
        • setProxyAdmin
        • updateOracle
        • updatePair
        • updateYToken
  • Agreements
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • Types
  • Usage
  • Errors
  1. Developer space
  2. yToken contract methods
  3. Admin methods
  4. Manage entrypoints

setGlobalFactors

params of setGlobalParams -> storage upd

Sets global factor constants to storage.

Types

type setGlobalParams    is [@layout:comb] record [
  closeFactorF          : nat;
  liqIncentiveF         : nat;
  priceFeedProxy        : address;
  maxMarkets            : nat;
]
Parameter
Type
Description

closeFactorF

nat

close factor

as float number multiplied by precision= 1000000000000000000n; (1e+18)

liqIncentiveF

nat

liquidation incentive

as float number multiplied by precision= 1000000000000000000n; (1e+18)

interestRateModel

address

priceFeed proxy contract instance

maxMarkets

nat

maximum amount of markets allowed to enter and borrow

Usage

const tokenId = 0; // or new BigNumber(0) or "0"
const yupana = await tezos.contract.at(yTokenAddress);
const proxyContractAddress = "KT1..."
const operation = await yupana.methods.setGlobalFactors(
      "500000000000000000",
      "1050000000000000000",
      proxyContractAddress,
      "2",
    ).send();
await operation.confirmation();
PRECISION = pow(10, 18)
config = {
  "close_factor": 0.5,
  "liquidity_incentive": 1.05
}
token = { "fA12": token_address } # or { "fA2": (token_address, token_id) }
yupana = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = yupana.setGlobalFactors(
                closeFactorF = int(config["close_factor"] * PRECISION),
                liqIncentiveF = int(config["liquidity_incentive"] * PRECISION),
                priceFeedProxy = "KT1...",
                maxMarkets = 2
            )
opg = call.inject()

Errors

  • yToken/not-admin - sender is not contract admin.

PrevioussetBorrowPauseNextsetTokenFactors

Last updated 3 years ago

โš™๏ธ
๐Ÿ›‘
๐Ÿคน