Quoter
Contract info
Contract name: Quoter Protocol
Contract addresses:
Harmony Mainnet: 0xFFFD451F62bE856E0cADdAc7c9a2e60aC5842C48
Binance Smart Chain Mainnet: 0x76540F7e38dFCdF3b39A501Bb7ef77c3705f4F17
Harmony Testnet: 0x028739801886AC60E0428e918e2bC9cA5D06399E
Functions
balance
Returns balance of a token available for use in Quoter.
Parameters:
Name | Type | Description |
---|---|---|
token | address | Token address of a token to check balance of. |
Returns:
Type | Description |
---|---|
uint256 | Balance of given token |
cancelOrderRFQ
Cancels order's quote.
Paramaters:
Name | Type | Description |
---|---|---|
orderInfo | uint256 | Order info contains timestamp and order id |
createOrUpdateSession
Creates or updates session that lets maker and taker to trade without signing messages through wallet.
Parameters:
Name | Type | Description |
---|---|---|
sessionKey | address | Public key of a session |
expirationTime | uint256 | Expiration time in unix seconds timestamp |
Returns:
Type | Description |
---|---|
SessionStatus | One of the value from enum (created, updated) that indicates the status of session |
depositToken
Deposits given token of frontend to the Quoter smart contract and stores the balance information.
Name | Type | Description |
---|---|---|
token | address | Address of token to deposit, depositing wallet must give an allowance to the Quoter smart contract for given amount |
amount | uint256 | Amount of tokens to deposit |
Returns:
Type | Description |
---|---|
uint256 | The balance after depositing the tokens |
endSession
Terminates active session
fillOrderRFQ
Fills order's quote, fully or partially (whichever is possible)
Parameters:
Name | Type | Description |
---|---|---|
order | OrderRFQ | Order quote to fill |
signature | bytes | Signature to confirm quote ownership |
takingAmount | uint256 | Taking amount |
makingAmount | uint256 | Making amount |
Returns:
Type | Description | |
---|---|---|
amounts | OrderRFQAmounts | Amounts - filled taking and making amounts |
fillOrderRFQCallPeriphery
Fills order's quote, fully or partially (whichever is possible) and calls external contract function
Parameters:
Name | Type | Description |
---|---|---|
order | OrderRFQ | Order quote to fill |
signature | bytes | Signature to confirm quote ownership |
takingAmount | uint256 | Taking amount |
makingAmount | uint256 | Making amount |
receiver | address | Address of contract that will receive the call after successful validation of RFQ order and transfer from taker to maker |
data | bytes | external call data |
Returns:
Type | Description | |
---|---|---|
amounts | OrderRFQAmounts | Amounts - filled taking and making amounts |
session
Returns session data
Parameters:
Name | Type | Description |
---|---|---|
owner | address | Wallet address of the session's owner |
Returns:
Name | Type | Description |
---|---|---|
creator | adress | Wallet address of the session's owner |
sessionKey | address | Session public key |
expirationTime | uint256 | Session expiration unix timestamp, might be zero if it was terminated |
txCount | uint256 | Number of transactions made during session |
sessionExpirationTime
Returns expiration unix timestamp of given address session
Parameters:
Name | Type | Description |
---|---|---|
owner | address | Wallet address of the session's owner |
Returns:
Name | Type | Description |
---|---|---|
expirationTime | uint256 | Session expiration unix timestamp, might be zero if it was terminated |
setReferralBonus
//Opis
Parameters:
Name | Type | Description |
---|---|---|
bonus | uint256 |
transferOwnership
//Opis
Parameters:
Name | Type | Description |
---|---|---|
to | address | Address of wallet that will receive ownership |
Returns:
Name | Type | Description |
---|---|---|
oldOwner | address | Address of previous owner |
newOwner | address | Address of new owner |
withdrawToken
Withdraws given token of frontend from the Quoter contract
Parameters:
Name | Type | Description |
---|---|---|
token | address | Address of a token to withdraw |
amount | uint256 | Amount of tokens to withdraw |
Returns:
Type | Description |
---|---|
uint256 | Balance after withdrawing the tokens |
Events
OrderFilledRFQ
Event emmited when RFQ order was filled.
Parameters:
Name | Type | Description |
---|---|---|
orderHash | bytes32 | Hash of the order |
takingAmount | uint256 | Taking amount |
makingAmount | uint256 | Making amount |
OwnershipTransfered
//opis
Parameters:
Name | Type | Description |
---|---|---|
from | address | |
to | address |
SessionCreated
Event emmited on successful session creation
Parameters:
Name | Type | Description |
---|---|---|
creator | address | Address of wallet creating the session |
sessionKey | address | Public key of the session |
expirationTime | uint256 | Session expiration time in unix timestamp |
SessionTerminated
Event emmited on successful session termination
Parameters:
Name | Type | Description |
---|---|---|
sender | address | Address of wallet terminating the session |
sessionKey | address | Public key of the session |
SessionUpdated
Event emitted on successful session update
Parameters:
Name | Type | Description |
---|---|---|
sender | address | Address of wallet updating the session |
sessionKey | address | Public key of the session |
expirationTime | uint256 | Session expiration time in unix timestamp |
SplitTokenTransfered
Event emitted on successful transfer of fee token - split between contract owner and frontend
Parameters:
Name | Type | Description |
---|---|---|
from | address | Address of wallet that transfers token |
recipient | address | Address of first recipient |
splitTo | address | Address of second recipient |
token | address | Address of deposited token |
splitPercentage | uint256 | Percentage used to split amount between recipient and splitTo |
amount | uint256 | Desposit amount |
balance | uint256 | Balance after fee token transfer |
TokenDeposited
Event emitted on successful deposit of token
Name | Type | Description |
---|---|---|
sender | address | Address of wallet depositing the token |
token | address | Address of the deposited token |
amount | uint256 | Deposit amount |
balance | uint256 | Balance after deposit |
TokenTransferred
Event emitted on successful transfer of token
Parameters:
Name | Type | Description |
---|---|---|
from | address | Address of wallet transfering the token |
recipient | address | Address of the token recipient |
token | address | Address of the transfered token |
amount | uint256 | Transfer amount |
balance | uint256 | Balance after transfer |
TokenWithdrawn
Event emitted on successful withdrawn of token
Parameters:
Name | Type | Description |
---|---|---|
sender | address | Address of wallet withdrawing the token |
token | address | Address of the withdrawn token |
amount | uint256 | Withdraw amount |
balance | uint256 | Balance after withdraw |
Models
Session
Properties:
Name | Type | Description |
---|---|---|
creator | adress | Wallet address of the session's owner |
sessionKey | address | Session public key |
expirationTime | uint256 | Session expiration unix timestamp, might be zero if it was terminated |
txCount | uint256 | Number of transactions made during session |
OrderRFQ
Properties:
Name | Type | Description |
---|---|---|
info | uint256 | |
feeAmount | uint256 | |
takerAsset | address | |
makerAsset | address | |
feeTokenAddress | address | |
frontendAddress | address | |
takerAssetData | bytes | |
makerAssetData | bytes |
OrderRQFAmounts
Properties:
Name | Type | Description |
---|---|---|
takerAsset | address | |
makerAsset | address | |
takingAmount | uint256 | |
makingAmount | uint256 |
Last updated