allowance (address owner, address spender)
transferFrom
. This value is zero by default. This value changes when approve
or transferFrom
are called.approve (address spender, uint256 amount)
uint256
of tokens as the allowance of the spender address over the caller's tokens. It returns a boolean value indicating whether the operation succeeded or not.balanceOf (address account)
increaseAllowance (address spender, uint256 addedValue)
uint256
indicates the value added to the existing allowance.decreaseAllowance (address spender, uint256 subtractedValue)
uint256
indicates the value subtracted to the existing allowance.mintPositions (uint256 _quantityToMint)
uint256
indicates the amount of positions to be minted and transferred to the user’s account.mintFromCollateralAmount(uint256 _collateralAmount)
uint256
.redeemPositions (address _to, uint256 _redeemQuantity)
address _to
. The amount of positions to redeem is given by uint256
.settlePositions ()
bulkSettlePositions (address[] calldata _settlers)
address[]
indicates the array of user accounts to be settled.totalSupply ()
transfer (address recipient, uint256 amount)
uint256
of tokens from the caller's account to the recipient address. This method returns a boolean value indicating whether the operation succeeded or not.transferFrom (address sender, address recipient, uint256 amount)
uint256
of tokens from the sender address to recipient address using the allowance mechanism. The amount transferred will be deducted from the caller's allowance. This method returns a boolean value indicating if the operation succeeded.deposit (uint _amount)
uint _amount
indicates the amount of liquidity to be deposited.withdraw (uint256 _amount)
uint256 _amount
indicates the amount of liquidity the user wants to withdraw.withdrawAll ()
earn ()
getPricePerFullShare ()
claimFee (address _to)
address _to
indicates the address to transfer the fees accrued.getExpectedOutAmount (address fromToken, address toToken, uint256 fromTokenAmount)
returns (uint256 tokensReturned, uint256 priceImpact)
uint256 fromTokemAmount
) given out in a swap operation from the fromToken
address to the toToken
address. This method returns the amount of tokens returned to the user’s account (i.e. uint256
tokensReturned
) and the price impact due to the operation (i.e. uint256 priceImpact
).getExpectedInAmount (address fromToken, address toToken, uint256 toTokenAmount)
returns (uint256 tokensReturned, uint256 priceImpact)
uint256 toTokemAmount
) received in a swap operation from the fromToken
address to the toToken
address. This method returns the amount of tokens returned to the account (i.e. uint256 tokensReturned
) and the price impact due to the operation (i.e. uint256 priceImpact
).getSwapFee ()
getBalance (address token)
handleBreach ()
isBound (address token)
token
is the address of the token. It returns the status of the token, that is if it is bounded to the balancer pool or not.swapExactAmountIn (address tokenIn, uint256 tokenAmountIn, address tokenOut, uint256 minAmountOut, uint256 maxPrice)
returns (uint256 tokenAmountOut, uint256 spotPriceAfter
uint256
tokenAmountIn
of tokenIn
taken by the pool, in exchange for an amount uint256 minAmountOut
of tokenOut given
to the user from the pool, with a maximum marginal price equal to uint 256 maxPrice
. uint256 tokenAmountOut
) and the new spot price after the swap operation (i.e. uint256 spotPriceAfter
).updateSpotAndNormalizeWeights ()
updateOracle (address _newOracle)
Address
is the new Oracle address.updateSpot (uint256 _price)
uint256
is the new updated price. The update can take place only if the arbitration price is within the contract bounds otherwise the contract settles.updateCommodityAfterBreach (address _vault, address _ltk, address _stk)
address _vault
is the vault address whereas address _ltk
and address _stk
are respectively the Long and Short token addresses.