Skip to main content

Zapper

Zapper

Deployment on Ethereum mainnet:

https://etherscan.io/address/0xd7b528e749078daDeE2f0071cde6fca4e191A521

Moves capital from the SeniorPool to TranchedPools without taking fees

config

contract GoldfinchConfig config

Zap

struct Zap {
address owner;
uint256 stakingPositionId;
}

tranchedPoolZaps

mapping(uint256 => struct Zapper.Zap) tranchedPoolZaps

PoolToken.id => Zap

initialize

function initialize(address owner, contract GoldfinchConfig _config) public

zapStakeToTranchedPool

function zapStakeToTranchedPool(uint256 tokenId, contract ITranchedPool tranchedPool, uint256 tranche, uint256 usdcAmount) public

Zap staked FIDU into the junior tranche of a TranchedPool without losing unvested rewards or paying a withdrawal fee

The minted pool token is held by this contract until either `claimZap` or `unzap` is called

NameTypeDescription
tokenIduint256A staking position token ID
tranchedPoolcontract ITranchedPoolA TranchedPool in which to deposit
trancheuint256The tranche ID of tranchedPool in which to deposit
usdcAmountuint256The amount in USDC to zap from StakingRewards into the TranchedPool

claimTranchedPoolZap

function claimTranchedPoolZap(uint256 poolTokenId) public

Claim the underlying PoolToken for a zap initiated with `zapStakeToTranchePool`. The pool token will be transferred to msg.sender if msg.sender initiated the zap and we are past the tranche's lockedUntil time.

NameTypeDescription
poolTokenIduint256The underyling PoolToken id created in a previously initiated zap

unzapToStakingRewards

function unzapToStakingRewards(uint256 poolTokenId) public

Unwind a zap initiated with `zapStakeToTranchePool`. The funds will be withdrawn from the TranchedPool and added back to the original staked position in StakingRewards. This method can only be called when the PoolToken's tranche has never been locked.

NameTypeDescription
poolTokenIduint256The underyling PoolToken id created in a previously initiated zap

zapStakeToCurve

function zapStakeToCurve(uint256 tokenId, uint256 fiduAmount, uint256 usdcAmount) public

Zap staked FIDU into staked Curve LP tokens without losing unvested rewards or paying a withdrawal fee.

NameTypeDescription
tokenIduint256A staking position token ID
fiduAmountuint256The amount in FIDU from the staked position to zap
usdcAmountuint256The amount of USDC to deposit into Curve

_hasAllowedUID

function _hasAllowedUID(contract ITranchedPool pool) internal view returns (bool)

_validPool

function _validPool(contract ITranchedPool pool) internal view returns (bool)