-
Notifications
You must be signed in to change notification settings - Fork 64
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
Feat/futures #122
base: master
Are you sure you want to change the base?
Feat/futures #122
Conversation
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.
very nice 👍 only minor things to confirm
|
||
export function handlePositionModified(event: PositionModifiedEvent): void { | ||
let futuresMarketContract = FuturesMarketContract.bind(event.transaction.to as Address); | ||
let proxyAddress = futuresMarketContract.proxy(); |
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.
seems really expensive to run a contract call here in order to set an ID... isn't there a better way to do this, such as using the FuturesMarketEntity asset
instead?
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.
yeah problem is the event doesn't emit the asset
. And the from
address is the underlying contract, which means we need to retrieve the proxy address first so we can match the position entity with the market one :(
margin: BigInt! | ||
entryPrice: BigInt! | ||
exitPrice: BigInt | ||
} |
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.
might want to add entities to track position histories as well (it can simply be a convenient store of events which can be displayed on a "Trading History" page or something)
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.
It kinda is already since we have an ID, which comes from the contract. Every different ID is a new position. So calling this entity by account or timestamp will give us a history
Cumulative futures stats
Add timestamp to minute stat
Assign timestamp
Rename averageVolume to averageTradeSize
Cumulative stats by market
can this PR be closed? the changes should be pushed to the |
Feat/futures competition
No description provided.