mirror of
https://github.com/FlipsideCrypto/ethscore.git
synced 2026-02-06 10:48:05 +00:00
60 lines
2.3 KiB
R
60 lines
2.3 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/address_time_weighted_token_balance.R
|
|
\name{address_time_weighted_token_balance}
|
|
\alias{address_time_weighted_token_balance}
|
|
\title{Time Weighted Address Token Balance}
|
|
\usage{
|
|
address_time_weighted_token_balance(
|
|
token_address,
|
|
min_tokens = 0.01,
|
|
block_min = 0,
|
|
block_max,
|
|
amount_weighting = TRUE,
|
|
api_key
|
|
)
|
|
}
|
|
\arguments{
|
|
\item{token_address}{ERC20 token contract address to assess balance.}
|
|
|
|
\item{min_tokens}{Minimum amount of tokens acknowledged. Already decimal adjusted, useful for
|
|
ignoring dust balances.}
|
|
|
|
\item{block_min}{Initial block to start scoring balances over time, default 0 (genesis block).}
|
|
|
|
\item{block_max}{The block height to assess balance at (for reproducibility).}
|
|
|
|
\item{amount_weighting}{Weight by amounts held across time, default TRUE. If FALSE, it treats
|
|
all amounts as binary. Person had at least \code{min_tokens} at a block or they did not. To NOT
|
|
weight by time, use \code{address_token_balance()} instead of this function.}
|
|
|
|
\item{api_key}{Flipside Crypto ShroomDK API Key to create and access SQL queries.}
|
|
}
|
|
\value{
|
|
A data frame of the form:\tabular{lc}{
|
|
\tab \cr
|
|
ADDRESS \tab The EOA or contract that holds the balance \cr
|
|
TOKEN_ADDRESS \tab ERC20 address provided \cr
|
|
time_weighted_score \tab 1 point per 1 token held per 1,000 blocks (amount_weighting = FALSE is 1 point per 1000 blocks where balance was above min_tokens) \cr
|
|
ADDRESS_TYPE \tab If ADDRESS is known to be 'contract address' or 'gnosis safe address'. \cr
|
|
If neither it is assumed to be an 'EOA'. Some EOAs may have a balance but have never initiated a transaction \tab \cr
|
|
These are noted as 'EOA-0tx' Note: contracts, including gnosis safes may not have consistent owners across different EVM chains. \tab \cr
|
|
}
|
|
}
|
|
\description{
|
|
Time weighted token balance of an address between 2 block heights.
|
|
Holding 20 UNI for 10,000 blocks might be more interesting to score than someone
|
|
buying 20 UNI right before a snapshot for an airdrop.
|
|
}
|
|
\examples{
|
|
\dontrun{
|
|
address_time_weighted_token_balance(
|
|
token_address = tolower("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"), #UNI token
|
|
min_tokens = 0.01,
|
|
block_min = 10000000,
|
|
block_max = 15000000,
|
|
amount_weighting = TRUE,
|
|
api_key = readLines("api_key.txt")
|
|
)
|
|
}
|
|
}
|