๐Ÿ“–
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
  1. Developer space
  2. PriceFeed contract
  3. Admin methods

updatePair

param of pairParam -> storage with upd [ pairName, pairId, tokensDecimals ]

type pairParam          is [@layout:comb] record [
  tokenId               : tokenId;
  pairName              : string;
  decimals              : nat;
]

Updates mapping of tokenId <-> pairName in storage pairName and pairId maps and updates tokensDecimals[param.pairName].

Usage

const tokenId = 0; // or new BigNumber(0) or "0"
const pairName = "XTZ-USD";
const tokenDecimal = Math.pow(10, 6);
const proxy = await tezos.contract.at(proxyAddress);
const operation = await proxy.methods.updatePair(
    tokenId, 
    pairName, 
    tokenDecimal
).send();
await operation.confirmation();
token_id = 0
pair_name = "XTZ-USD"
decimals = pow(10,6)
proxy = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = proxy.updatePair(
    tokenId=token_id
    pairName=pair_name
    decimals=decimals
)
opg = call.inject()
PreviousupdateOracleNextupdateYToken

Last updated 3 years ago

โš™๏ธ
๐Ÿ›‘