KyberDeveloper · Powering Liquidity for the Ecosystem

KyberDeveloper · Powering Liquidity for the Ecosystem

  • Home
  • Integrations
  • Reserves
  • KyberPRO
  • Addresses
  • API/ABI
  • Trade Debugger
  • Tracker
  • GitHub

›Misc Contracts

Getting Started

  • Introduction

RESTful API

  • RESTful API Overview
  • RESTful API

Widgets

  • Widgets Overview
  • KyberWidget
  • Sign In Widget

Core Smart Contracts

  • IKyberNetworkProxy
  • KyberNetworkProxy
  • IKyberNetwork
  • ISimpleKyberProxy
  • IKyberMatchingEngine
  • KyberMatchingEngine
  • IKyberHint
  • KyberHintHandler
  • IKyberFeeHandler
  • KyberFeeHandler
  • IKyberStaking
  • KyberStaking
  • IKyberDao
  • KyberDao
  • IKyberStorage
  • KyberStorage
  • IKyberHistory
  • KyberHistory
  • IKyberReserve
  • KyberReserve
  • ConversionRates
  • LiquidityConversionRates
  • IEpochUtils
  • EpochUtils

Contract ABIs

  • ABIs

Plugins

  • Plugins Overview
  • WooCommerce Plugin

Code Snippets

  • Token Quantity Conversion

Misc Contracts

  • KyberNetwork
  • ConversionRatesInterface
  • OrderbookReserveInterface
  • PermissionGroups
  • SanityRates
  • SanityRatesInterface
  • Withdrawable

ConversionRatesInterface

interface ConversionRatesInterface

Source: ConversionRatesInterface.sol


INDEX

  • getRate
  • recordImbalance

REFERENCE

Functions

getRate

Gets the conversion rate of the ERC20 token depending on quantity at block height


function getRate(ERC20 token, uint currentBlockNumber, bool buy, uint qty) public view returns (uint)

ParameterTypeDescription
tokenERC20ERC20 token contract address
currentBlockNumberuintcurrent block height or block number
buybooltrue if action is to buy, otherwise false if action is to sell
qtyuintwei amount of ERC20 tokens

Returns:
Conversion rate of ERC20 token depending on quantity at block height

recordImbalance

Records the wei amount of net absolute (+/-) change for a token in a block


function recordImbalance(ERC20 token, int buyAmount, uint rateUpdateBlock, uint currentBlock) public

ParameterTypeDescription
tokenERC20ERC20 token contract address
buyAmountintbuy amount of ERC20 tokens in wei
rateUpdateBlockuintNOT SURE
currentBlockuintcurrent block height or block number


← PreviousNext →
  • INDEX
  • REFERENCE
    • Functions
    • getRate
    • recordImbalance
KyberDeveloper · Powering Liquidity for the Ecosystem
EssentialsGetting StartedDesign PrinciplesProtocol OverviewSmart Contract Architecture
IntegrationsDAppsVendorsWalletsPlatform Fees
ReservesFed PriceAutomated Price
© 2019 Kyber Network. All rights reserved.
Follow us on Facebook
Follow us on Twitter
Follow us on Github
Follow us on Reddit
Join our Telegram group
Subscribe to our Youtube channel
Read our blog on Medium