169 похожих чатов

Man I am pulling my hair out one at a

time! Can someone save me from days of googling and ending up with no further answer? All I want to know is how to trigger Uniswap or any AMM to call this function 'swapExactTokensForTokensSupportingFeeOnTransferTokens' when user wants to sell my token via the Uniswap/Pancakeswap/Sushiswap UI. How does uniswap know that my token takes fees and then call that fee function instead of the regular one? Where do I tell it to do that in my code?? Why is this so complicated 😤😤🤬🤬

5 ответов

7 просмотров

I shared your mood friend

I've asked myself this question before, too. Didn't find a solution. The workaround is to use slippage in order to still enable your tokens to be sold. Maybe it's just the case that you simply can't tell the uniswap frontend which function to call. You'd have to provide an own frontend which calls the right function (which, I understand, is not exactly what you are looking for). If you do find a solution, please please do share it...

Pancakeswap SDK repo contains router.ts. The file contains swapCallParameters function that is called by the frontend (src/hooks/useSwapCallback.ts). Depending on there is fee or not

Sam-Dot Автор вопроса
Sam-Dot Автор вопроса
seran Tej
Pancakeswap SDK repo contains router.ts. The file ...

Yes this hook I've looked at through Uniswap github. After digging more into the frontend of uniswap it seems the trade.type needs to equal "EXACT_INPUT". I think the reason for that is that the input will be exact on input but after recalculating the reserves/balances after fees are take the output will be different. Either way this is the other function that sets the trade type and ultimately the correct feesontransfer function: /** * Constructs an exact in trade with the given amount in and route * @param route route of the exact in trade * @param amountIn the amount being passed in */ public static exactIn(route: Route, amountIn: CurrencyAmount, chainId: ChainId): Trade { return new Trade(route, amountIn, TradeType.EXACT_INPUT, chainId) }

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Ребят, что лучше для реверса: гидра или ида?
En Vind Av Sorg
26
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
Делаю велосипед логгер. К сообщению хочу прикрутить некоторую информацию, типа, кем отправлено, какой уровень, и всякое такое. И тут подумалось мне, почему бы не хранить весь...
Serjone
24
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
Комрады, хотел уточнить. Проперть в OnDestroy юнита-хозяина по-прежнему доступна? И еще уточнение: finalization юнита наступает раньше или позже OnDestroy?
Ed Doc
48
а не подскажете вот это скрин из какой IDE ?
Iluha Companets
14
Продолжая диалог про свифт в проде – сейчас возник вопрос в активном наборе бекендеров. В основном в нашей компании мы фанаты Java Spring и полностью ей довольны. Однако найм ...
Guseyn
27
Народ всем привет Подскажите, как включить самописные dll библиотеки в итоговую сборку Сейчас при запуске dev сервера локально формируется папка build, из которой запускается...
Андрей
4
Читаю сейчас [нет, уже больше не читаю!] курсовую о Булгакове, написанную, похоже, с помощью ChatGPT. Это удивительный психоделический опыт. Текст в основном написан в стиле б...
✨ Uni [🌊 В отпуске]
1
Карта сайта