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
Name | Type | Description |
---|---|---|
tokenId | uint256 | A staking position token ID |
tranchedPool | contract ITranchedPool | A TranchedPool in which to deposit |
tranche | uint256 | The tranche ID of tranchedPool in which to deposit |
usdcAmount | uint256 | The 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.
Name | Type | Description |
---|---|---|
poolTokenId | uint256 | The 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.
Name | Type | Description |
---|---|---|
poolTokenId | uint256 | The 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.
Name | Type | Description |
---|---|---|
tokenId | uint256 | A staking position token ID |
fiduAmount | uint256 | The amount in FIDU from the staked position to zap |
usdcAmount | uint256 | The 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)