Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable zaps on Fantom vaults #297

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Enable zaps on Fantom vaults #297

wants to merge 1 commit into from

Conversation

mazurroman
Copy link

@mazurroman mazurroman commented Jun 8, 2022

Description

Whenever a deposit/withdraw happens and the vault underlying !== token, it will make an API call to https://api.joinwido.com/swaproute, get the swap route, and call the executeOrder function on 0x7Bbd6348db83C2fb3633Eebb70367E1AEc258764.

Related Issue

yearn/yearn-finance-v3#710

Motivation and Context

Remove friction for deposits into Yearn vaults. This is Step 1 of the Yearn <> Wido Router integration proposal to enable frictionless deposits into all Yearn vaults, regardless of the chain the user is depositing from.

This is just a draft PR to kick off the discussion.

Zaps have been pretty successful on Ethereum, contributing to almost 50% of all deposits (see chart below).

image

Note on the chart: It's filtered down to curve vaults with at least one zapIn function call each month to skip vaults with no support for zaps. Source.

How Has This Been Tested?

It was tested locally with the frontend running the yalc'ed SDK.

Left ToDo

  • Add wido.spec.ts
  • Signed permits not working
  • Use an api instead of importing the abi
  • Use options.slippage when calculating minOutputToken
  • Simulating output value (when withdrawing) is wrong
  • After approve, the button stays enabled, and you need to refresh the page
  • Update token metadata for USDC and vaults to include zapInWith: zapperZapIn commit
  • Add wido contract to yearn’s on-chain AllowList to allow tx validation to pass: diff

Example txs:

https://ftmscan.com/tx/0x4bcd9791a24307bc7760f543ce2d3f15201d578aff5460976d759288f80b834a
https://ftmscan.com/tx/0xc8d1c86e90dda1a1487672cda5dba0005646ba0ad6b4057408526586aae963c6

Screenshots:

The following 4 screenshots show how zapIn into a Fantom vault looks

@mazurroman mazurroman changed the title [DRAFT] Enable zaps on Fantom vaults Enable zaps on Fantom vaults Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants