yearn-sdk
yearn-sdk copied to clipboard
Enable zaps on Fantom vaults
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
https://github.com/yearn/yearn-finance-v3/pull/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).

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


