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

feat: add funding observation #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: add funding observation #8

wants to merge 1 commit into from

Conversation

134dd3v
Copy link
Member

@134dd3v 134dd3v commented May 14, 2022

No description provided.

let observation = new FundingObservation(observationId);
observation.pool = pool.id;
observation.timestamp = timestamp;
observation.fundingRate = getFundingRate(BigInt.fromString(pool.id));
Copy link
Member Author

Choose a reason for hiding this comment

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

Can you review if converting hex string to BigInt here is correct?

Copy link
Member

Choose a reason for hiding this comment

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

BigInt.fromString(pool.id) not enough confidence in this one.
You can try -

let bytes = ByteArray.fromHexString(hexString)
let poolIdBigInt. = BigInt.fromSignedBytes(bytes)

But I don't like that too much either, why can't you access the BigInt version of poolId from the event?

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.

2 participants