de-dot-fi / defiyield-self-integrations

9 stars 35 forks source link

Unable to get price in lp configured by izumi finance #60

Closed Xiaxuliang closed 1 year ago

Xiaxuliang commented 1 year ago

Bug Report

Current Behavior price wrong.

*Expected behavior * can get price by izumi.finance or dexscreener

Details

Additional context/Screenshots image

Xiaxuliang commented 1 year ago

exmaple: dex: https://api.dexscreener.com/latest/dex/pairs/zksync/0x2f801cc2b7213be05fd73febb80b627cfd625c9f

izumi.finance: /// @notice Estimate amount of tokenX required when an user wants to buy tokenY given amount of tokenX user wants to buy /// calling this function will not generate any real exchanges in the pool. /// @param tokenX tokenX of swap pool /// @param tokenY tokenY of swap pool /// @param fee fee amount of swap pool /// @param desireY amount of tokenY user wants to buy /// @param lowPt highest point during exchange /// @return amountX estimated amount of tokenX user need to pay /// @return finalPoint estimated point of pool after swap function swapX2YDesireY( address tokenX, address tokenY, uint24 fee, uint128 desireY, int24 lowPt ) public returns (uint256 amountX, int24 finalPoint);

witem commented 1 year ago

@Xiaxuliang, you can add fetchMissingTokenPrices to the project with some logic. Example: https://github.com/de-dot-fi/defiyield-self-integrations/blob/478bc5eb293a072ac31849d89143a2911c78c040/apps/workshop/projects/CroSwap/modules/CroSwap.ts#L102C9-L124

Or you can just wait when price for this token will be available on coingecko

Xiaxuliang commented 1 year ago

has resolved ,thanks