Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

generate new fork #56

Open
wants to merge 81 commits into
base: release/1.1.4
Choose a base branch
from
Open

generate new fork #56

wants to merge 81 commits into from

Conversation

MostafaSaadatnia
Copy link

This pull request triggered because we want to generate new fork from this codebase

0xalexbai and others added 30 commits September 23, 2021 18:08
* Aquafarm withdraw/deposit support

* ignore when user farm is not initialized

* @orca-so/aquafarm version bump to ^0.0.12

* extract aquafarm as a separate api

* comment todos

* variable name changes
* update README with farm info

* Bump to 1.1.5
Co-authored-by: meep <33380758+odcheung@users.noreply.github.com>
* Add DoubleDip, SingleStake farms; Update pools, tokens

* double-dips-only
* Farm getHarvestableAmount and harvest api's

* Farm harvest, getHarvestableAmount api

* add comments

* use getCurrentHarvestableAmount
* Pool add getDepositQuote, getWithdrawQuote api's

* remove unused functions

* getQuote slippage should be optional

* percentage input, constraint token

* comments update

* change types

* special case: handle SOL in getUserTokenCount

* decimal bug fix

* address comments

* comment update
* Update Usage section of readme

* update with new api
* Add new pools

* add SOCN
* Farm getWeeklyEmissions api

* add rewardTokenDecimals field

* getDailyEmissions

* comment update

* rewardTokenDecimals for new pools
Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
* Add devnet

* fix sol token equality check
scuba and others added 30 commits December 30, 2021 08:25
* Exclude revoke instruction for one-off wsol account

* Revert "Exclude revoke instruction for one-off wsol account"

This reverts commit 626321a.

* cleanupInstructions execute in reverse order

* remove comment
* Sync token list to SDK
* Update .gitignore
Bug Details:
calculate_fee function of spl-token-swap includes a process to set the fee to 1 if it is truncated to 0.
https://github.com/solana-labs/solana-program-library/blob/813aa3304022528cbf3cf7a3d32bca339194a492/token-swap/program/src/curve/fees.rs#L56

The SDK's fee calculation does not have this logic, so if the amount of input is small, fee calculation results in zero.
As a result, on-chain, the amount of input is less than the amount of fee and the output is lower than expected.

Fixes:
- Change to the same fee calculation logic as spl-token-swap
- Added test cases to constant-product-quote.test.ts and stable-quote.test.ts

Note:
To avoid exceptions when obtaining estimates, if the fees is greater than the input, the input is treated as zero.
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.

None yet

8 participants