Methods
Register Strategy
With the registerStrategy method, you can register a custom strategy for Flashstaking. It takes as parameters:
_strategyAddress: your strategy’s smart contract address (see Flash Strategy)
_principalTokenAddress: your strategy’s principal token (staked and received). For example, if your strategy is used to stake DAI, _principalTokenAddress would be the DAI stablecoin’s smart contract address.
_fTokenName: what the fToken minted when Flashstaking/staking shall be called.
_fTokenSymbol: which symbol should be given to the fToken minted when Flashstaking/staking.
Naming convention must be followed to be added to the official frontend.
The naming convention for _fTokenSymbol is a function of the principal token symbol and the first four letters of your strategy - eg fDAI-0123
Stake
The stake method creates a new stake with a registered strategy of your choosing. Its parameters are:
_strategyAddress: address of a registered strategy. You have to register the strategy with the above-described registerStrategy method first before passing its address here.
_tokenAmount: amount (in Wei) of staked tokens.
_stakeDuration: total duration (in seconds) of the stake.
_fTokensTo: the address the minted fTokens shall be sent to.
_issueNFT: mint stake as NFT upfront.
Redirecting fTokens by providing a different address in the _fTokensTo address will result in only the resulting fTokens to be redirected. The Stake ownership will be retained by the caller. This also means when minting a FlashNFT, this will be retained by the caller (Staker).
Flashstake
The flashStake method is similar to stake, which it calls before burning the minted fTokens for yield. Upon staking, the fTokens minted will be held by the Flash Protocol and then immediately burned with the resulting yield being redirected to _yieldTo.
Redirecting yield by providing a different address in the _yieldTo address will result in only the resulting yield to be redirected. The Stake ownership will be retained by the caller. This also means when minting a FlashNFT, this will be retained by the caller (Staker).
Unstake
The unstake method unstakes your Flashstake/stake, either partially or completely. Parameters:
_id: your stake’s ID.
_isNFT: true if your stake has been minted as an NFT; false otherwise.
_fTokenToBurn: amount of fTokens to be burnt to unstake your desired amount of principal for your stake.
Stakes that have ended should pass 0 in the _fTokenToBurn parameter.
NFTs are not burned when unstaking - that means the NFTs live forever.
Issue NFT
This methods issues an NFT from a given stake. It can be called at anytime after the stake’s creation, if an NFT wasn’t initially minted.
It returns the NFT’s ID, which is different from the stake’s ID passed as parameter.
Get stake info
This method will return all the information for a given stake. The information returned is as follows:
Set Mint Fee Info
_feeRecipient: the address the fees will go to
_feePercentageBasis: the percentage of fees to take upon fToken minting
It allows the Owner to set a global fToken mint fee up to a hardcoded maximum of 20%. This means if 1,000 fTokens are minted during the Stake process and the fee is set to 20%, the user will receive 800 fTokens.
This function can only be called by the Owner.
Last updated