Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deposit query to dYdX Subgraph API #11

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

yt8073
Copy link

@yt8073 yt8073 commented Jun 8, 2022

The purpose here is to track the one time deposit to the exchange events.

source:
address: "{{dydxPerpetualAddress}}"
abi: DydxPerpetual
startBlock: {{startBlock}}
Copy link
Collaborator

@lucas-dydx lucas-dydx Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startBlock should be updated to the deployment block of the dYdX perpetual contract, or else deposit events before block 12809555 on mainnet will be missing.

The deployment block of the dYdX perpetual contract on mainnet is 11834295, so that should be used instead in config/mainnet.json.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set this to the current block, because we only care about the most recent deposit that users make after Rabbithole launches their deposit matching campaign.

let userAddress: Address = event.params.depositorEthKey
let depositAmount: BigInt = event.params.quantizedAmount
let user: User = getUser(userAddress)
user.depositToPerpetual = depositAmount
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user.mostRecentDeposit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants