Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Update client library #13

Merged
merged 10 commits into from
Jan 5, 2022
Merged

Update client library #13

merged 10 commits into from
Jan 5, 2022

Conversation

jayantk
Copy link
Collaborator

@jayantk jayantk commented Dec 29, 2021

Major update to client library with several key changes:

  1. Add the PriceConf struct to allow users to combine multiple price feeds. This lets you price LP tokens and construct composite feeds (e.g., mSOL/SOL out of SOL/USD and mSOL/USD).
  2. Add test infrastructure for running the client library in BPF.
  3. Add instruction count test program to measure resource consumption
  4. Add utility functions to make this library easier-to-use in downstream applications
  5. Update README docs and rust docs

Main thing to look at here is PriceConf (which does a bunch of math). The rest of the changes should be straightforward.

jayantk and others added 3 commits December 28, 2021 08:46
* Add method for getting twap

* initial implementation, seems to work

* minor

* minor

* refactor

* found bad case

* use u128

* working on it

* clarify

* cleanup

* more cleanup

* pretty sure i need this

* better

* bad merge

* no println

* adding solana tx stuff

* change approach a bit

* this seems to work

* comment

* cleanup

* refactor

* refactor

* initial implementation of mul

* exponent

* tests for normalize

* tests for normalize

* negative numbers in div

* handle negative numbers

* comments

* stuff

* cleanup

* unused

* minor

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
* instruction counts

* reduce normalize opcount

* instruction counts

* tests

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
* uh oh

* docs

* fix error docs

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
@jayantk jayantk mentioned this pull request Dec 29, 2021
@jayantk jayantk merged commit 1c1c283 into main Jan 5, 2022
@ali-behjati ali-behjati deleted the v2 branch February 17, 2022 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant