Commit Graph

59 Commits

Author SHA1 Message Date
meep 0f592f267b
Allow developers to take additional fees from a swap (#46)
- Add a new swapWithDevFees function in the Whirlpool client class
- Add new swapQuoteByInputTokenWithDevFees quote function
2022-09-20 11:03:53 -07:00
FuzzyYeti 1acd1469bd
Update protocol_fee_rate comment (#44)
Co-authored-by: Fuzzy Yeti <fuzzyyeti@github.com>
2022-09-04 08:46:50 -07:00
solbricklayer bb1b3c47bf
update anchor installation link (#39)
Old (not working): https://project-serum.github.io/anchor/getting-started/installation.html#install-rust
New (working): https://book.anchor-lang.com/getting_started/installation.html#anchor
2022-08-16 10:20:11 -07:00
skrrb e4cd6552e9
sdk tests: fix MAX_U64 const definition (#41) 2022-08-16 10:19:32 -07:00
tmoc d7cca71df8 v0.5.1 2022-08-10 14:52:24 -04:00
tmoc 16bca0ea1f
Implement batch getPools method (#42)
* Adding getPools method in SDK client

* Adding fetching of token vault infos to whirlpool retrieval

* Adding retrieval of reward infos

* Adding comment about empty pubkey constant

* Updating comments

* Using PoolUtil to check for initialized rewards

* Updating getRewardInfos comment
2022-08-10 14:50:02 -04:00
yugure-orca 8fc92ea1af
Change data type for liquidity and sqrtPrice to BN (#40)
* Changing variable type to BN to handle liquidity
- Change type of variables handling liquidity from u64 to BN
- Fix: removing "async" from describe. must be defined synchronously.
- Fix: using BN to calculate the max value of u64 (test-constants.ts)
- Fix: adding "await" to wait transaction completion(swap-test-utils.ts)

* Changing variable type to BN to handle sqrtPrice
- Change type of variables handling sqrtPrice from u64 to BN
- Refactor: changing argument name of getTokenAmountsFromLiquidity
  to clarify required price is sqrtPrice

Co-authored-by: yugure <98769788+everlastingsong@users.noreply.github.com>
2022-08-01 20:49:52 +09:00
Otto Cheung a5e7d82494 v0.5.0 2022-07-22 10:17:08 -04:00
meep 11f17bae53
Upgrade Anchor (Typescript) dependency to 0.25 (#38)
- Updating the Anchor SDK dependency
- API changes on the parameters on WhirlpoolContext & WhirlpoolClient
2022-07-22 09:47:32 -04:00
Otto Cheung c33740ed3a v0.4.0 2022-07-21 15:26:09 -04:00
meep 025fbffdf0
Update typedocs and comments for swap refactor (#37) 2022-07-15 10:10:49 -04:00
meep 2df89bb552
[SDK] Refactoring swap-quote (#30)
- More accurate quote values - ported the swap logic from contract & add comprehensive unit-test suite to confirm quote values are identical to contract results
- More info available in quote - endTickIndex, sqrtPrice, feeAmount etc...
- Additional swapQuoteFromOutputToken to allow users to ask for a quote (and swap input parameters) based on the desired receive amount
- Bug fix on TickArray calculation that led to the annoying 0x1787 (InvalidTickArraySequence) error
- Addresses all errors in the old-swap quote where it fails to traverse tick-arrays in many cases
- Bug fix on WhirlpoolClient.swap where it incorrectly uses the quote.estimated values rather than the user defined tokenAmount value
2022-07-15 09:49:21 -04:00
meep 5798af2e51
Update comments and re-run yarn docs (#33) 2022-06-29 17:16:01 -04:00
Otto Cheung 266241f99b v0.3.1 2022-06-29 16:18:54 -04:00
meep b922062ccb
Change param ordering for Position's resolveATA (#32)
- Change parameter ordering for resolveATA as it is the most important parameter
- Default resolveATA to true. Power users who do not want to ping RPC constantly can manually turn it off
- Fix up some comments
2022-06-29 15:51:18 -04:00
meep 4416732e33
Add resolveATA option for Position's increase_liquidity (#31)
- Add an option to auto-generate ATA to perform increase_liquidity for Whirlpool's position class
2022-06-29 15:22:14 -04:00
Otto Cheung 537306c096 v0.2.3 2022-06-21 11:36:09 -05:00
Otto Cheung 3bcd4ee391 upgrade common-sdk to 0.0.7 2022-06-21 10:52:56 -05:00
meep a3ee117669
Upgrade initTickArrayForTicks for WhirlpoolClient (#28)
- Method will auto-check which tick-array requires initialization
- Will generate a list of initTickArray Ix for a transaction
- Modify test to send initTickArray + openPosition together
2022-06-21 10:51:18 -05:00
Otto Cheung dfcda482ba v0.2.2 2022-06-13 16:26:54 -07:00
meep 7c8dce249e
Add PoolUtil swap direction & token type util functions (#27)
Add util functions to PoolUtil to help identify swap direction & token A/B for token mints
2022-06-13 16:24:03 -07:00
Otto Cheung 09ddd60a34 Revert unexpected PoolUtil commits 2022-06-13 16:20:16 -07:00
Otto Cheung 076b1fc49a add return types 2022-06-13 16:17:02 -07:00
Otto Cheung 2feb023309 Revert "rename the old swapdirection in swap-quote"
This reverts commit 479acf26a2.
2022-06-13 10:50:50 -07:00
Otto Cheung 479acf26a2 rename the old swapdirection in swap-quote 2022-06-13 10:45:30 -07:00
Otto Cheung efa9daa623 add tests 2022-06-13 10:31:20 -07:00
Otto Cheung 8f387e52c2 revisions 2022-06-13 10:11:33 -07:00
Otto Cheung 0e0ff71fae additional poolutil changes 2022-06-10 12:32:56 -07:00
Otto Cheung bd7c2abd44 v0.2.1 2022-06-08 21:15:15 -07:00
Otto Cheung 34040c0645 v0.2.0 2022-06-08 20:07:59 -07:00
meep a266831d7c
[v0.2.0] Refactor swapQuote functions (#20) (#25)
- Refactor swapQuoteByInputToken as a convenience method to help users fetch the necessary information to perform the swap quote
- Add swapQuoteWithParams for the more advanced users who have previously fetched the data they need to perform the swap quote
2022-06-08 19:49:45 -07:00
meep f888d1cf20
[v0.2.0] Improve increase/decrease liquidity functions for SDK (#16)
- Add support for auto-resolving ATA accounts prior for decrease liquidity ix
- Removed sourceWallet support for increase_liquidity ix
- Add separate funder/payer support for Whirlpool/Position increase/decrease liquidity functions
- Add tests to verify functions work as intended
2022-06-08 19:36:48 -07:00
Otto Cheung efe85aa44d v0.1.7 2022-06-07 17:38:54 -07:00
Sohrab 1479717b73
fix(token): remove double clone()ing from CPI calls (#11) 2022-06-07 13:44:26 -07:00
tmoc e94d6a6314
Adding toBaseQuoteOrder method to pool-utils (#21)
* Adding toBaseQuoteOrder method to pool-utils and test

* Moving function to PoolUtil namespace

* Updating test to use PoolUtil namespace
2022-06-07 13:45:32 -04:00
tmoc 451a04040b
Variable name consistency in lib.rs and swap.rs. Regenerating IDL to pick up argument name change (#24) 2022-06-07 12:18:14 -04:00
meep c881abcc8b
Modify IncreaseLiquidity quote to use Address (#15) 2022-06-07 08:23:19 -07:00
meep 101307aa7d
update Cargo.toml to use new anchor sources (#23) 2022-06-07 08:22:20 -07:00
meep 49c8dd7c09
Fix build errors for increase/decrease liquidity Ix (#19)
Add new Increase/DecreaseLiquidityQuote type to add a layer of separation between Params and Quote
2022-06-07 08:22:01 -07:00
Jabur b4b976b802
Update anchor sources to git (#22)
Update anchor sources to git as the ones from cargo were yanked and people can't import it or face a build error.
2022-06-04 11:29:37 -07:00
meep 3d1db67b30
Add more helper classes for WhirlpoolClient classes (#18)
- Add getAddress for Whirlpool & Position helper class
- Add getFetcher for WhirlpoolClient helper class
2022-05-27 11:19:20 -07:00
meep 72666c9153
Add optional refresh parameter for whirlpoolclient (#17) 2022-05-26 10:00:01 -07:00
Otto Cheung 0ea0bb2d53 v0.1.6 2022-05-23 15:01:38 -07:00
Otto Cheung 3bef76527d v0.1.5 2022-05-23 15:00:48 -07:00
yugure 739268024c
Update whirlpool-client-impl.ts (#14)
* Fix incorrect fetch of mintA instead of mintB
2022-05-23 15:00:02 -07:00
Phil Chen f79dde5570
Add token estimates for liquidity quotes, group token resolution (#12)
- Add tokenEst to the increase/decrease liquidity quotes
- Add group token resolution to minimize RPC calls when resolving ATAs
2022-05-23 09:49:08 -07:00
meep f3f0ce24e7
Fix incorrect imports in the SDK (#13)
- Fix incorrect import for ZERO in decrease_liquidity_quote
- Fix incorrect toTx import in position_management.test.ts
- Confirmed that there are no other /sdk dependencies here
2022-05-23 09:27:15 -07:00
meep 15ccea3fec
Update package json with repository data (#10) 2022-05-13 10:22:44 -07:00
meep c0b7afc2ca
Update README.md (#8)
* Add Orca Development Portal URL
2022-05-13 08:58:54 -07:00
meep cb31d3c5b2
Update package license to Apache 2.0 (#9)
- Update package license to Apache 2.0
- Published v0.1.3
2022-05-13 08:58:23 -07:00