Ref Finance’s challenge for the NEAR Hackathon
Providing liquidity involves adding two tokens in equal proportion to the ratio of the corresponding pool. If you have already both tokens, the process is quite simple. If you don't, the process often involves swapping one token for another. Then repeating the same process for the other token. For example, let's assume that you have 100 DAI and want to provide liquidity into the REF <> NEAR pool. You would do the following actions:
A Zap Swap will be directly a Swap from 100 DAI to the corresponding REF <> NEAR LP tokens. A similar feature can be studied and analysed on Trader Joe [1].
A Zap Swap can be very useful, facilitating the user experience by having access / exposure to any pools with his / her principal.
In this challenge, you would need to create a demo to prove that your solution can manage / execute a Zap Swap. In other words, one or multipe transactions that contain(s) the following actions:
To keep it simple, you can consider NEAR as token A (token-in) for the solution, NEAR being the 'quote' token for most pairs in Ref Finance.
As a bonus, and with the StableSwap feature coming very soon, we would pay attention to the fact that the solution can scale or be configured to add another swap action to the whole process:
S being a stablecoin and A being NEAR in our example.