BTB
/

Yield Yak

Yield Aggregatorwebsite
Autocompounding strategies on Avalanche. Deposit a token into a strategy, get receipt shares, and rewards are reinvested automatically. Withdraw shares for the underlying token. Also runs YakRouter, a DEX aggregator that finds the best route across Avalanche DEXes.

What you can do

find-strategyPick a strategy by token and APYGET https://staging-api.yieldyak.com/43114/farms and /apys; keep deprecated false and check DEPOSITS_ENABLED() on the strategy before depositing.
depositDeposit depositToken into a strategyapprove the strategy for the amount, then deposit(amount). Or depositWithPermit(...) to skip the approve. Receive receipt shares (balanceOf).
withdrawRedeem receipt shareswithdraw(shares). Preview the amount with getDepositTokensForShares(shares). Works even when deposits are disabled.
check-positionValue a positiondepositToken amount = balanceOf(user) * totalDeposits() / totalSupply(), or getDepositTokensForShares(balanceOf(user)).
swapSwap tokens through the aggregatorfindBestPath(amountIn, tokenIn, tokenOut, maxSteps) on the router, approve the router for tokenIn, then swapNoSplit(trade, recipient, 0) with trade.amountOut set to the minimum acceptable output.
The two largest Yield Yak strategies on Avalanche (Benqi USDC and USDT) have DEPOSITS_ENABLED false at the time of research, so they accept withdrawals only. Check the flag before depositing.
Yield Yak strategies lend or stake through the platform (Benqi here). Platform risk, reward token price moves and withdraw fees apply.
Strategies are owner-controlled. The owner can change fees, pause deposits and rescue funds through the owner and dev functions, so read the owner address and the fee settings before large deposits.
reinvest() is open to externally owned accounts and pays the caller a reward, so keepers may call it at any time. Harvest timing is not guaranteed.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
YakRouter (aggregator)router on avalanche0xC4729E56b831d74bBc18797e0e17A295fA77488c
write swapNoSplit((uint256,uint256,address[],address[]),address,uint256)
Swap through a single route of adapters with no split. Arguments: Trade (amountIn, amountOut = minimum output required, path = token addresses, adapters = one adapter per hop), recipient, fee (integrator fee in basis points, zero for none). Approve the router for path[0] for amountIn first. Reverts with Insufficient output amount below amountOut.
write swapNoSplitFromAVAX((uint256,uint256,address[],address[]),address,uint256)
Swap native AVAX for a token. Send AVAX as msg.value equal to amountIn. path[0] must be WAVAX.
write swapNoSplitToAVAX((uint256,uint256,address[],address[]),address,uint256)
Swap a token for native AVAX. path must end in WAVAX. Approve the router for path[0] first.
write swapNoSplitWithPermit((uint256,uint256,address[],address[]),address,uint256,uint256,uint8,bytes32,bytes32)
Swap a token with an EIP-2612 permit, so no separate approve. Arguments: Trade, recipient, fee, deadline, v, r, s.
read findBestPath(uint256,address,address,uint256)
Best route for a swap. Arguments: amountIn, tokenIn, tokenOut, maxSteps (1 to 4). Returns amounts, adapters, path and gasEstimate. Use the adapters and path from the result in swapNoSplit.
read findBestPathWithGas(uint256,address,address,uint256,uint256)
Same as findBestPath but also weighs gas. The last argument is the gas price in wei.
read NAME()
Returns YakRouter. Use it to confirm the contract.
Yield Yak: Benqi USDC strategy (BENQI-USDC-2)vault on avalanche0xFB692D03BBEA21D8665035779dd3082c2B1622d0
write deposit(uint256)
Deposit depositToken. Argument: amount in the token's smallest unit. Approve the strategy for the amount first. Mints receipt shares to the caller. Reverts when DEPOSITS_ENABLED is false. Before depositing, the strategy reinvests pending rewards.
write depositWithPermit(uint256,uint256,uint8,bytes32,bytes32)
Deposit using an EIP-2612 permit signature instead of a separate approve. Arguments: amount, deadline, v, r, s. Reverts for tokens without permit.
write depositFor(address,uint256)
Deposit on behalf of another account. The receipt shares go to the account argument. Caller still pays the deposit token.
write withdraw(uint256)
Redeem receipt shares for depositToken. Argument: share amount (the strategy's own 18 decimal token, not depositToken). Returns depositToken minus any withdraw fee. Use getDepositTokensForShares to preview.
write reinvest()
Claim pending rewards, swap them and add to the position. Callable only by externally owned accounts (not contracts). Pays the caller a reward of reinvestRewardBips of the rewards.
read balanceOf(address)
Receipt share balance of an account.
read totalSupply()
Total receipt shares issued.
read totalDeposits()
Total depositToken held by the strategy, including what is deployed to the lending or staking contract.
read getDepositTokensForShares(uint256)
Depositwise value of a share amount: shares * totalDeposits / totalSupply. Use it to value a position.
read getSharesForDepositTokens(uint256)
Shares minted for a deposit amount, at the current price.
read estimateReinvestReward()
Reward a caller would earn for calling reinvest now (zero if pending rewards are below minTokensToReinvest).
read checkReward()
Pending reward tokens not yet reinvested.
read depositToken()
Token the strategy accepts for deposit (LP token or single asset).
read rewardToken()
Reward token the strategy harvests (WAVAX for these strategies).
read DEPOSITS_ENABLED()
False means no new deposits (withdrawals still work). Check this before depositing.
read owner()
Owner of the strategy (Yield Yak multisig or admin).
Yield Yak: Benqi USDT strategy (BENQI-USDT-2)vault on avalanche0xa45B0A446B91eBDBbB041f491e7244AAeB7f557A
write deposit(uint256)
Deposit depositToken. Argument: amount in the token's smallest unit. Approve the strategy for the amount first. Mints receipt shares to the caller. Reverts when DEPOSITS_ENABLED is false. Before depositing, the strategy reinvests pending rewards.
write depositWithPermit(uint256,uint256,uint8,bytes32,bytes32)
Deposit using an EIP-2612 permit signature instead of a separate approve. Arguments: amount, deadline, v, r, s. Reverts for tokens without permit.
write depositFor(address,uint256)
Deposit on behalf of another account. The receipt shares go to the account argument. Caller still pays the deposit token.
write withdraw(uint256)
Redeem receipt shares for depositToken. Argument: share amount (the strategy's own 18 decimal token, not depositToken). Returns depositToken minus any withdraw fee. Use getDepositTokensForShares to preview.
write reinvest()
Claim pending rewards, swap them and add to the position. Callable only by externally owned accounts (not contracts). Pays the caller a reward of reinvestRewardBips of the rewards.
read balanceOf(address)
Receipt share balance of an account.
read totalSupply()
Total receipt shares issued.
read totalDeposits()
Total depositToken held by the strategy, including what is deployed to the lending or staking contract.
read getDepositTokensForShares(uint256)
Depositwise value of a share amount: shares * totalDeposits / totalSupply. Use it to value a position.
read getSharesForDepositTokens(uint256)
Shares minted for a deposit amount, at the current price.
read estimateReinvestReward()
Reward a caller would earn for calling reinvest now (zero if pending rewards are below minTokensToReinvest).
read checkReward()
Pending reward tokens not yet reinvested.
read depositToken()
Token the strategy accepts for deposit (LP token or single asset).
read rewardToken()
Reward token the strategy harvests (WAVAX for these strategies).
read DEPOSITS_ENABLED()
False means no new deposits (withdrawals still work). Check this before depositing.
read owner()
Owner of the strategy (Yield Yak multisig or admin).