-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: master
Are you sure you want to change the base?
Conversation
source: | ||
address: "{{dydxPerpetualAddress}}" | ||
abi: DydxPerpetual | ||
startBlock: {{startBlock}} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user.mostRecentDeposit
The purpose here is to track the one time deposit to the exchange events.