Open daodaoswap opened 3 years ago
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
This issue now has a funding of 300.0 DAI (300.0 USD @ $1.0/DAI) attached to it.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Workers have applied to start work.
These users each claimed they can complete the work by 265 years, 2 months from now. Please review their action plans below:
1) controlcpluscontrolv has applied to start work _(Funders only: approve worker | reject worker)_.
So let me break down what I will do for you.
Your requirement in actual data delivered was a bit hard for me to understand, so I will need further clarification on what schema and what data you actually wanted stored, but using the aforementioned techniques I can extrapolate all the data shown on Uniswap Analytic's site. I would then be able to store in a MongoDB for you to query and run.
I understand me not having Java in my portfolio might not be that inspiring, but I know the basics of the language to make queries and C(reate)R(remove)U(pdate)D(elete) in a database
Learn more on the Gitcoin Issue Details page.
Glad to be accepted! Would you mind providing me with a schema for the database you want made?
An example would be something like Collections for Each pair A Document for each day tracked inside of that collection containing all tx's with that pair
Just so I can make sure I am organizing my data how you want it!
@controlcpluscontrolv Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
I am awaiting a response on how @daodaoswap is hoping for me to structure my schema
@con Please check below.
type UniswapFactory @entity {
id: ID!
pairCount: Int!
totalVolumeUSD: BigDecimal! totalVolumeETH: BigDecimal!
untrackedVolumeUSD: BigDecimal!
totalLiquidityUSD: BigDecimal! totalLiquidityETH: BigDecimal!
txCount: BigInt! }
type Token @entity {
id: ID!
symbol: String! name: String! decimals: BigInt!
totalSupply: BigInt!
tradeVolume: BigDecimal! tradeVolumeUSD: BigDecimal! untrackedVolumeUSD: BigDecimal!
txCount: BigInt!
totalLiquidity: BigDecimal!
derivedETH: BigDecimal
tokenDayData: [TokenDayData!]! @derivedFrom(field: "token") pairDayDataBase: [PairDayData!]! @derivedFrom(field: "token0") pairDayDataQuote: [PairDayData!]! @derivedFrom(field: "token1") pairBase: [Pair!]! @derivedFrom(field: "token0") pairQuote: [Pair!]! @derivedFrom(field: "token1") }
type Pair @entity {
id: ID!
token0: Token! token1: Token! reserve0: BigDecimal! reserve1: BigDecimal! totalSupply: BigDecimal!
reserveETH: BigDecimal! reserveUSD: BigDecimal! trackedReserveETH: BigDecimal! # used for separating per pair reserves and global
token0Price: BigDecimal! token1Price: BigDecimal!
volumeToken0: BigDecimal! volumeToken1: BigDecimal! volumeUSD: BigDecimal! untrackedVolumeUSD: BigDecimal! txCount: BigInt!
createdAtTimestamp: BigInt! createdAtBlockNumber: BigInt!
liquidityProviderCount: BigInt! # used to detect new exchanges
pairHourData: [PairHourData!]! @derivedFrom(field: "pair") liquidityPositions: [LiquidityPosition!]! @derivedFrom(field: "pair") liquidityPositionSnapshots: [LiquidityPositionSnapshot!]! @derivedFrom(field: "pair") mints: [Mint!]! @derivedFrom(field: "pair") burns: [Burn!]! @derivedFrom(field: "pair") swaps: [Swap!]! @derivedFrom(field: "pair") }
type User @entity { id: ID! liquidityPositions: [LiquidityPosition!] @derivedFrom(field: "user") usdSwapped: BigDecimal! }
type LiquidityPosition @entity { id: ID! user: User! pair: Pair! liquidityTokenBalance: BigDecimal! }
type LiquidityPositionSnapshot @entity { id: ID! liquidityPosition: LiquidityPosition! timestamp: Int! # saved for fast historical lookups block: Int! # saved for fast historical lookups user: User! # reference to user pair: Pair! # reference to pair token0PriceUSD: BigDecimal! # snapshot of token0 price token1PriceUSD: BigDecimal! # snapshot of token1 price reserve0: BigDecimal! # snapshot of pair token0 reserves reserve1: BigDecimal! # snapshot of pair token1 reserves reserveUSD: BigDecimal! # snapshot of pair reserves in USD liquidityTokenTotalSupply: BigDecimal! # snapshot of pool token supply liquidityTokenBalance: BigDecimal! # snapshot of users pool token balance }
type Transaction @entity { id: ID! # txn hash blockNumber: BigInt! timestamp: BigInt!
mints: [Mint]! burns: [Burn]! swaps: [Swap]! }
type Mint @entity {
id: ID! transaction: Transaction! timestamp: BigInt! # need this to pull recent txns for specific token or pair pair: Pair!
to: Bytes! liquidity: BigDecimal!
sender: Bytes amount0: BigDecimal amount1: BigDecimal logIndex: BigInt
amountUSD: BigDecimal
feeTo: Bytes feeLiquidity: BigDecimal }
type Burn @entity {
id: ID! transaction: Transaction! timestamp: BigInt! # need this to pull recent txns for specific token or pair pair: Pair!
liquidity: BigDecimal!
sender: Bytes amount0: BigDecimal amount1: BigDecimal to: Bytes logIndex: BigInt
amountUSD: BigDecimal
needsComplete: Boolean!
feeTo: Bytes feeLiquidity: BigDecimal }
type Swap @entity {
id: ID! transaction: Transaction! timestamp: BigInt! # need this to pull recent txns for specific token or pair pair: Pair!
sender: Bytes! from: Bytes! # the EOA that initiated the txn amount0In: BigDecimal! amount1In: BigDecimal! amount0Out: BigDecimal! amount1Out: BigDecimal! to: Bytes! logIndex: BigInt
amountUSD: BigDecimal! }
type Bundle @entity { id: ID! ethPrice: BigDecimal! # price of ETH usd }
type UniswapDayData @entity { id: ID! # timestamp rounded to current day by dividing by 86400 date: Int!
dailyVolumeETH: BigDecimal! dailyVolumeUSD: BigDecimal! dailyVolumeUntracked: BigDecimal!
totalVolumeETH: BigDecimal! totalLiquidityETH: BigDecimal! totalVolumeUSD: BigDecimal! # Accumulate at each trade, not just calculated off whatever totalVolume is. making it more accurate as it is a live conversion totalLiquidityUSD: BigDecimal!
txCount: BigInt! }
type PairHourData @entity { id: ID! hourStartUnix: Int! # unix timestamp for start of hour pair: Pair!
reserve0: BigDecimal! reserve1: BigDecimal!
reserveUSD: BigDecimal!
hourlyVolumeToken0: BigDecimal! hourlyVolumeToken1: BigDecimal! hourlyVolumeUSD: BigDecimal! hourlyTxns: BigInt! }
type PairDayData @entity { id: ID! date: Int! pairAddress: Bytes! token0: Token! token1: Token!
reserve0: BigDecimal! reserve1: BigDecimal!
totalSupply: BigDecimal!
reserveUSD: BigDecimal!
dailyVolumeToken0: BigDecimal! dailyVolumeToken1: BigDecimal! dailyVolumeUSD: BigDecimal! dailyTxns: BigInt! }
type TokenDayData @entity { id: ID! date: Int! token: Token!
dailyVolumeToken: BigDecimal! dailyVolumeETH: BigDecimal! dailyVolumeUSD: BigDecimal! dailyTxns: BigInt!
totalLiquidityToken: BigDecimal! totalLiquidityETH: BigDecimal! totalLiquidityUSD: BigDecimal!
priceUSD: BigDecimal! }
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Workers have applied to start work.
These users each claimed they can complete the work by 265 years, 1 month from now. Please review their action plans below:
1) controlcpluscontrolv has applied to start work _(Funders only: approve worker | reject worker)_.
Sorry wasn't sure if you were still responding, will get back to work on the bounty now that I have schema, will get it done!
Learn more on the Gitcoin Issue Details page.
Hi @daodaoswap are you still looking for someone who can help you with this issue? I would be happy to help. As far as I understand you want to get a Java code that will read data from the Uniswap Subgraph https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2 and then save it to the database e.g. PostgreSQL. Would you like it to be a Spring service that will expose API that will trigger syncing the data for a given timespan on each call or should it be rather a background java service scheduled internally by for example Spring Boot Scheduler?
Need use Java to do below task:
Deliveries requirement: