OptionAMMPool
The contract pool responsible for trade, add and remove liquidity of a pair PodOption:ERC20.

Properties

input name
Type
Required
Description
tokenA
address
PodOption contracts
Must be an option token (PodOption)
tokenB
address
ERC20 token
The ERC20 will be used as the pair of the option. Will be easier if the price of the option is denominated in any stablecoin.
priceProvider
address
-
Contract address of the PriceProvider contract for spotPrice
priceMethod
address
-
Contract address of the PriceMethod contract (E.g: BlackScholes)
impliedVolatility
address
-
Contract address of the sigma (Implied Volatility - IV)
feePoolA
address
Contract address of the fee pool related to the tokenA
feePoolB
address
Contract address of the fee pool related to the tokenB
priceProperties
struct
All the properties related to the pricing calculation:
  • option expiration
  • option strikePrice
  • option underlyingAsset
  • option type
  • pool current sigma (IV)
  • pool current risk-free rate
  • pool last sigma initial guess

Methods

addLiquidity

This function is used to add new liquidity to the pool. Since we use a single-sided AMM, amountOfA or amountOfB can be 0 if you want to add liquidity to just one side of the pool. This function can only be called before option expiration.
Disclaimer: with the current UI, users can only provide or remove liquidity equally on both sides
input name
Type
Required
Description
amountOfA
uint256
-
Amount of Token A to add
amountOfB
uint256
-
Amount of Token B to add
owner
address
-
Add on behalf of someone
Solidity
Web3
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
uint256 amountOfA = 10000000; // Need to take in consideration asset decimals
6
uint256 amountOfB = 10000000000000; // Need to take in consideration asset decimals
7
address owner = '0x3ab...';
8
9
optionAMMPool.addLiquidity(amountOfA, amountOfB, owner);
10
11
// OptionAMMPool.sol
12
/**
13
* @notice addLiquidity in any proportion of tokenA or tokenB
14
*
15
* @dev This function can only be called before option expiration
16
*
17
* @param amountOfA amount of TokenA to add
18
* @param amountOfB amount of TokenB to add
19
* @param owner address of the account that will have ownership of the liquidity
20
*/
21
function addLiquidity(
22
uint256 amountOfA,
23
uint256 amountOfB,
24
address owner
25
) external override beforeExpiration {}
Copied!
1
// Parameters example
2
// You can check our deployed contracts of priceProvider, priceMethod and Sigma
3
const amountOfA = 10000000; // Need to take in consideration asset decimals
4
const amountOfB = 10000000000000; // Need to take in consideration asset decimals
5
const owner = '0x3ab...';
6
7
const optionAMMPoolAddress = '0x3c...'
8
9
/////////////
10
// Web3.js
11
12
// Instantiate contract
13
const optionAMMPool = await web3.eth.Contract('Contract ABI', optionAMMPoolAddress)
14
15
await optionAMMPool.methods.addLiquidity(
16
amountOfA,
17
amountOfB,
18
owner
19
).send({ from: 'yourWallet' })
20
21
/////////////
22
// Ethers.js
23
24
// Instantiate contract
25
const optionAMMPool = await ethers.getContractAt(optionAMMPoolAddress, 'Contract ABI')
26
27
await optionAMMPool.addLiquidity(
28
amountOfA,
29
amountOfB,
30
owner
31
)
Copied!

removeLiquidity

This function is used to remove liquidity from the pool. Since we use a single-sided AMM, percentA or percentB can be 0 if you want to remove liquidity from just one side of the pool. The percentA and percentB represent the percentage of the exposition in each asset you want to remove. If you want to check upfront what the amount represent certain exposition, you can call getRemoveLiquidityAmounts.
Disclaimer: with the current UI, users can only provide or remove liquidity equally on both sides
input name
Type
Required
Description
percentA
uint256
0 - 100
Percent of the exposition of amount of Token A to remove (Eg: 100 = 100% available)
percentB
uint256
0 - 100
Exposition of amount of Token B to remove
Solidity
Web3
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
uint256 percentA = 100; // Will remove 100% of exposition of Asset A
5
uint256 percentB = 50; // Will remove 50% of exposition of Asset B
6
7
optionAMMPool.removeLiquidity(percentA, percentB);
8
9
// OptionAMMPool.sol
10
/**
11
* @notice removeLiquidity in any proportion of tokenA or tokenB
12
*
13
* @param amountOfA amount of TokenA to add
14
* @param amountOfB amount of TokenB to add
15
*/
16
function removeLiquidity(
17
uint256 percentA,
18
uint256 percentB
19
) external override {}
Copied!
1
// Parameters example
2
// You can check our deployed contracts of priceProvider, priceMethod and Sigma
3
const amountOfA = 10000000; // Need to take in consideration asset decimals
4
const amountOfB = 10000000000000; // Need to take in consideration asset decimals
5
6
const optionAMMPoolAddress = '0x3c...'
7
8
/////////////
9
// Web3.js
10
11
// Instantiate contract
12
const optionAMMPool = await web3.eth.Contract('Contract ABI', optionAMMPoolAddress)
13
14
await optionAMMPool.methods.removeLiquidity(
15
amountOfA,
16
amountOfB
17
).send({ from: 'yourWallet' })
18
19
/////////////
20
// Ethers.js
21
22
// Instantiate contract
23
const optionAMMPool = await ethers.getContractAt(optionAMMPoolAddress, 'Contract ABI')
24
25
await optionAMMPool.removeLiquidity(
26
amountOfA,
27
amountOfB
28
)
Copied!

tradeExactAInput

This function represents "selling token A to the pool" or "buying token B from the pool". msg.sender is able to trade exact amount of token A in exchange for minimum amount of token B and send the tokens B to the owner. After that, this function also updates the priceProperties.currentSigma.
input name
Type
Required
Description
exactAmountAIn
uint256
-
Exact amount of A token that will be transfer from msg.sender
minAmountBOut
uint256
-
Minimum acceptable amount of token B to transfer to owner
owner
address
address that will receive the token in exchange
sigmaInitialGuess
uint256
!= 0
For gas cost-saving purpose, it is possible to run getOptinTradedDDetails before the trade in order to send the best sigma possible
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
6
uint256 exactAmountAIn = 10000000; // Need to take in consideration asset decimals
7
uint256 minAmountBOut = 10000000000000; // Need to take in consideration asset decimals
8
address owner = 0x3a...
9
uint256 sigmaInitialGuess = 660000000000 // should run getOptionTradeDetails before
10
11
optionAMMPool.tradeExactAInput(
12
exactAmountAIn,
13
minAmountBOut,
14
owner,
15
sigmaInitialGuess
16
);
17
18
// IOptionAMMPool.sol
19
/**
20
* @notice tradeExactAInput msg.sender is able to trade exact amount of token A in exchange for minimum
21
* amount of token B and send the tokens B to the owner. After that, this function also updates the
22
* priceProperties.currentSigma
23
*
24
* @dev sigmaInitialGuess is a parameter for gas saving costs purpose. Instead of calculating the new sigma
25
* out of thin ar, caller can help the Numeric Method achieve the result in less iterations with this parameter.
26
* In order to know which guess the caller should use, call the getOptionTradeDetailsExactAInput first.
27
*
28
* @param exactAmountAIn exact amount of A token that will be transfer from msg.sender
29
* @param minAmountBOut minimum acceptable amount of token B to transfer to owner
30
* @param owner the destination address that will receive the token B
31
* @param sigmaInitialGuess The first guess that the Numeric Method (getPutSigma / getCallSigma) should use
32
*/
33
function tradeExactAInput(
34
uint256 exactAmountAIn,
35
uint256 minAmountBOut,
36
address owner,
37
uint256 sigmaInitialGuess
38
) external override beforeExpiration returns (uint256) {}
Copied!

tradeExactAOutput

This function represents "buying token A from the pool" or "selling token B to the pool". owner is able to receive exact amount of token A in exchange of a max acceptable amount of token B transfer from the msg.sender. After that, this function also updates the priceProperties.currentSigma
input name
Type
Required
Description
exactAmountAOut
uint256
-
Exact amount of token A that will be transfer to owner
maxAmountBIn
uint256
-
Maximum acceptable amount of token B to transfer from msg.sender
owner
address
address that will receive the token in exchange
sigmaInitialGuess
uint256
!= 0
For gas cost-saving purpose, it is possible to run getOptionTradedDDetails before the trade in order to send the best sigma possible
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
6
uint256 exactAmountAOut = 10000000; // Need to take in consideration asset decimals
7
uint256 maxAmountBIn = 10000000000000; // Need to take in consideration asset decimals
8
address owner = 0x3a...
9
uint256 sigmaInitialGuess = 660000000000 // should run getOptionTradeDetails before
10
11
optionAMMPool.tradeExactAOutput(
12
exactAmountAOut,
13
maxAmountBIn,
14
owner,
15
sigmaInitialGuess
16
);
17
18
// IOptionAMMPool.sol
19
/**
20
* @notice _tradeExactAOutput owner is able to receive exact amount of token A in exchange of a max
21
* acceptable amount of token B transfer from the msg.sender. After that, this function also updates
22
* the priceProperties.* currentSigma
23
*
24
* @dev sigmaInitialGuess is a parameter for gas saving costs purpose. Instead of calculating the new sigma
25
* out of thin ar, caller can help the Numeric Method achieve the result in less iterations with this parameter.
26
* In order to know which guess the caller should use, call the getOptionTradeDetailsExactAOutput first.
27
*
28
* @param exactAmountAOut exact amount of token A that will be transfer to owner
29
* @param maxAmountBIn maximum acceptable amount of token B to transfer from msg.sender
30
* @param owner the destination address that will receive the token A
31
* @param sigmaInitialGuess The first guess that the Numeric Method (getPutSigma / getCallSigma) should use
32
*/
33
function tradeExactAOutput(
34
uint256 exactAmountAOut,
35
uint256 maxAmountBIn,
36
address owner,
37
uint256 sigmaInitialGuess
38
) external returns (uint256)';
Copied!

tradeExactBInput

This function represents "selling token B to the pool" or "buying token A from the pool". msg.sender is able to trade exact amount of token B in exchange for minimum amount of token A and send the tokens B to the owner. After that, this function also updates the priceProperties.currentSigma.
input name
Type
Required
Description
exactAmountBIn
uint256
-
Exact amount of A token that will be transfer from msg.sender
minAmountAOut
uint256
-
Minimum acceptable amount of token B to transfer to owner
owner
address
address that will receive the token in exchange
sigmaInitialGuess
uint256
!= 0
For gas cost-saving purpose, it is possible to run getOptionTradedDDetails before the trade in order to send the best sigma possible
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
uint256 exactAmountBIn = 10000000; // Need to take in consideration asset decimals
6
uint256 minAmountAOut = 10000000000000; // Need to take in consideration asset decimals
7
address owner = 0x3a...
8
uint256 sigmaInitialGuess = 660000000000 // should run getOptionTradeDetails before
9
10
optionAMMPool.tradeExactBInput(
11
exactAmountBIn,
12
minAmountAOut,
13
owner,
14
sigmaInitialGuess
15
);
16
17
// IOptionAMMPool.sol
18
/**
19
* @notice _tradeExactBInput msg.sender is able to trade exact amount of token B in exchange for minimum
20
* amount of token A sent to the owner. After that, this function also updates the priceProperties.currentSigma
21
*
22
* @dev sigmaInitialGuess is a parameter for gas saving costs purpose. Instead of calculating the new sigma
23
* out of thin ar, caller can help the Numeric Method achieve the result ini less iterations with this parameter.
24
* In order to know which guess the caller should use, call the getOptionTradeDetailsExactBInput first.
25
*
26
* @param exactAmountBIn exact amount of token B that will be transfer from msg.sender
27
* @param minAmountAOut minimum acceptable amount of token A to transfer to owner
28
* @param owner the destination address that will receive the token A
29
* @param sigmaInitialGuess The first guess that the Numeric Method (getPutSigma / getCallSigma) should use
30
*/
31
function tradeExactBInput(
32
uint256 exactAmountBIn,
33
uint256 minAmountAOut,
34
address owner,
35
uint256 sigmaInitialGuess
36
) external returns (uint256);
Copied!

tradeExactBOutput

This function represents "selling token A to the pool" or "buying token B from the pool". owner is able to receive exact amount of token B in exchange of a max acceptable amount of token A transfer from the msg.sender. After that, this function also updates the priceProperties.currentSigma
input name
Type
Required
Description
exactAmountBOut
uint256
-
Exact amount of token B that will be transfer to owner
maxAmountAIn
uint256
-
Maximum acceptable amount of token A to transfer from msg.sender
owner
address
address that will receive the token in exchange
sigmaInitialGuess
uint256
!= 0
For gas cost-saving purpose, it is possible to run getOptionTradedDDetails before the trade in order to send the best sigma possible
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
6
uint256 maxAmountBIn = 10000000; // Need to take in consideration asset decimals
7
uint256 exactAmountBOut = 10000000000000; // Need to take in consideration asset decimals
8
address owner = 0x3a...
9
uint256 sigmaInitialGuess = 660000000000 // should run getOptionTradeDetails before
10
11
optionAMMPool.tradeExactBOutput(
12
exactAmountBOut,
13
maxAmountBIn,
14
owner,
15
sigmaInitialGuess
16
);
17
18
// IOptionAMMPool.sol
19
/**
20
* @notice _tradeExactAOutput owner is able to receive exact amount of token A in exchange of a max
21
* acceptable amount of token B transfer from the msg.sender. After that, this function also updates
22
* the priceProperties.* currentSigma
23
*
24
* @dev sigmaInitialGuess is a parameter for gas saving costs purpose. Instead of calculating the new sigma
25
* out of thin ar, caller can help the Numeric Method achieve the result in less iterations with this parameter.
26
* In order to know which guess the caller should use, call the getOptionTradeDetailsExactAOutput first.
27
*
28
* @param exactAmountAOut exact amount of token A that will be transfer to owner
29
* @param maxAmountBIn maximum acceptable amount of token B to transfer from msg.sender
30
* @param owner the destination address that will receive the token A
31
* @param sigmaInitialGuess The first guess that the Numeric Method (getPutSigma / getCallSigma) should use
32
*/
33
function tradeExactBOutput(
34
uint256 exactAmountBOut,
35
uint256 maxAmountAIn,
36
address owner,
37
uint256 sigmaInitialGuess
38
) external returns (uint256);
Copied!

getPoolBalances

Check the current pool amount of Token A and Token B.

Return Values

Input name
Type
Description
totalTokenA
uint256
Pool total balance of token A
totalTokenB
uint256
Pool total balance of token B
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
(uint256 totalTokenA, uint256 totalTokenB) = optionAMMPool.getPoolBalances();
6
7
// IOptionAMMPool.sol
8
/**
9
* @notice getPoolBalances external function that returns the current pool balance of token A and token B
10
*
11
* @return totalTokenA balanceOf this contract of token A
12
* @return totalTokenB balanceOf this contract of token B
13
*/
14
function getPoolBalances() external view returns (uint256 totalTokenA, uint256 totalTokenB)
Copied!

getUserDepositSnapshot

Check the original balance of a user, returning its original deposit of Token A, the original balance of Token B, and the opening value factor at the moment of the deposit.

Input Parameters

Input name
Type
Description
user
uint256
Address to consult the balance

Return Values

Input name
Type
Description
tokenABalance
uint256
Exact amount of token B that will be transfer to owner
tokenBBalance
uint256
Maximum acceptable amount of token A to transfer from msg.sender
fImpUser
uint256
address that will receive the token in exchange
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
address user = '0x3aab...';
6
7
(uint256 tokenABalance, uint256 tokenBBalance, uint256 fImpUser) =
8
optionAMMPool.getUserDepositSnapshot(user);
9
10
// IOptionAMMPool.sol
11
/**
12
* @notice getUserDepositSnapshot external function that User original balance of token A,
13
* token B and the Opening Value * * Factor (Fimp) at the moment of the liquidity added
14
*
15
* @param user address to check the balance info
16
*
17
* @return tokenABalance balance of token A by the moment of deposit
18
* @return tokenBBalance balance of token B by the moment of deposit
19
* @return fImpUser value of the Opening Value Factor by the moment of the deposit
20
*/
21
function getUserDepositSnapshot(address user)
22
external
23
view
24
returns ( uint256 tokenABalance, uint256 tokenBBalance, uint256 fImpUser );
Copied!

getOptionTradeDetailsExactAInput

View function that simulates a trade, in order the preview amountBOut, the new sigma (IV), that will be used as the sigmaInitialGuess if the caller wants to perform a trade in the sequence. Also returns the amount of Fees that will be paid to liquidity pools A and B.

Input Parameters

Input name
Type
Description
exactAmountAIn
uint256
amount of token A that will be transfer from msg.sender to the pool

Return Values

Input name
Type
Description
amountBOut
uint256
amount of B in exchange of the exactAmountAIn
newIV
uint256
New sigma that this trade will result
feesTokenA
uint256
Amount of fees of collected by token A
feesTokenB
uint256
amount of fees of collected by token B
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
address exactAmountAIn = 100000;
6
7
(uint256 amountBOut, uint256 newIV, uint256 feesTokenA, uint256 feesTokenB) =
8
optionAMMPool.getOptionTradeDetailsExactAInput(exactAmountAIn);
9
10
// IOptionAMMPool.sol
11
/**
12
* @notice getOptionTradeDetailsExactAInput view function that simulates a trade, in order the preview
13
* the amountBOut, the new sigma (IV), that will be used as the sigmaInitialGuess if caller wants to perform
14
* a trade in sequence. Also returns the amount of Fees that will be payed to liquidity pools A and B.
15
*
16
* @param exactAmountAIn amount of token A that will by transfer from msg.sender to the pool
17
*
18
* @return amountBOut amount of B in exchange of the exactAmountAIn
19
* @return newIV the new sigma that this trade will result
20
* @return feesTokenA amount of fees of collected by token A
21
* @return feesTokenB amount of fees of collected by token B
22
*/
23
function getOptionTradeDetailsExactAInput(uint256 exactAmountAIn)
24
external
25
override
26
view
27
returns (
28
uint256 amountBOut,
29
uint256 newIV,
30
uint256 feesTokenA,
31
uint256 feesTokenB
32
);
Copied!

getOptionTradeDetailsExactAOutput

View function that simulates a trade, in order the preview the amountBIn, the new sigma (IV), that will be used as the sigmaInitialGuess if the caller wants to perform a trade in the sequence. Also returns the amount of Fees that will be paid to liquidity pools A and B.

Input Parameters

Input name
Type
Description
exactAmountAOut
uint256
amount of token A that will be transfer from the pool to the owner

Return Values

Input name
Type
Description
amountBIn
uint256
amount of B that will be transfer from msg.sender to the pool
newIV
uint256
New sigma that this trade will result
feesTokenA
uint256
Amount of fees of collected by token A
feesTokenB
uint256
amount of fees of collected by token B
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
address exactAmountAOut = 100000;
6
7
(uint256 amountBIn, uint256 newIV, uint256 feesTokenA, uint256 feesTokenB) =
8
optionAMMPool.getOptionTradeDetailsExactAInput(exactAmountAOut);
9
10
// IOptionAMMPool.sol
11
/**
12
* @notice getOptionTradeDetailsExactAOutput view function that simulates a trade, in order the preview
13
* the amountBIn, the new sigma (IV), that will be used as the sigmaInitialGuess if caller wants to perform
14
* a trade in sequence. Also returns the amount of Fees that will be payed to liquidity pools A and B.
15
*
16
* @param exactAmountAOut amount of token A that will by transfer from pool to the msg.sender/owner
17
*
18
* @return amountBIn amount of B that will be transfer from msg.sender to the pool
19
* @return newIV the new sigma that this trade will result
20
* @return feesTokenA amount of fees of collected by token A
21
* @return feesTokenB amount of fees of collected by token B
22
*/
23
function getOptionTradeDetailsExactAOutput(uint256 exactAmountAOut)
24
external
25
override
26
view
27
returns (
28
uint256 amountBIn,
29
uint256 newIV,
30
uint256 feesTokenA,
31
uint256 feesTokenB
32
);
Copied!

getOptionTradeDetailsExactBInput

View function that simulates a trade, in order the preview the amountAOut, the new sigma (IV), that will be used as the sigmaInitialGuess if the caller wants to perform a trade in the sequence. Also returns the amount of Fees that will be paid to liquidity pools A and B.

Input Parameters

Input name
Type
Description
exactAmountBIn
uint256
amount of token B that will be transfer from msg.sender to the pool

Return Values

Input name
Type
Description
amountAOut
uint256
amount of A in exchange of the exactAmountAIn
newIV
uint256
New sigma that this trade will result
feesTokenA
uint256
Amount of fees of collected by token A
feesTokenB
uint256
amount of fees of collected by token B
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
address exactAmountBIn = 100000;
6
7
(uint256 amountAOut, uint256 newIV, uint256 feesTokenA, uint256 feesTokenB) =
8
optionAMMPool.getOptionTradeDetailsExactAInput(exactAmountBIn);
9
10
// IOptionAMMPool.sol
11
/**
12
* @notice getOptionTradeDetailsExactBInput view function that simulates a trade, in order the preview
13
* the amountAOut, the new sigma (IV), that will be used as the sigmaInitialGuess if caller wants to perform
14
* a trade in sequence. Also returns the amount of Fees that will be payed to liquidity pools A and B.
15
*
16
* @param exactAmountBIn amount of token B that will by transfer from msg.sender to the pool
17
*
18
* @return amountAOut amount of A in exchange of the exactAmountAIn
19
* @return newIV the new sigma that this trade will result
20
* @return feesTokenA amount of fees of collected by token A
21
* @return feesTokenB amount of fees of collected by token B
22
*/
23
function getOptionTradeDetailsExactBInput(uint256 exactAmountBIn)
24
external
25
override
26
view
27
returns (
28
uint256 amountAOut,
29
uint256 newIV,
30
uint256 feesTokenA,
31
uint256 feesTokenB
32
);
Copied!

getOptionTradeDetailsExactBOutput

View function that simulates a trade, in order the preview the amountAIn, the new sigma (IV), that will be used as the sigmaInitialGuess if the caller wants to perform a trade in the sequence. Also returns the amount of Fees that will be paid to liquidity pools A and B.

Input Parameters

Input name
Type
Description
exactAmountBOut
uint256
amount of token B that will be transfer from the pool to the owner

Return Values

Input name
Type
Description
amountAIn
uint256
amount of A that will be transfer from msg.sender to the pool
newIV
uint256
New sigma that this trade will result
feesTokenA
uint256
Amount of fees of collected by token A
feesTokenB
uint256
amount of fees of collected by token B
Solidity
1
// Instantiate OptionAMMPool
2
OptionAMMPool optionAMMPool = optionAMMPool("/*address*/");
3
4
// Parameters example
5
address exactAmountBOut = 100000;
6
7
(uint256 amountAIn, uint256 newIV, uint256 feesTokenA, uint256 feesTokenB) =
8
optionAMMPool.getOptionTradeDetailsExactAInput(exactAmountBOut);
9
10
// IOptionAMMPool.sol
11
/**
12
* @notice getOptionTradeDetailsExactBOutput view function that simulates a trade, in order the preview
13
* the amountAIn, the new sigma (IV), that will be used as the sigmaInitialGuess if caller wants to perform
14
* a trade in sequence. Also returns the amount of Fees that will be payed to liquidity pools A and B.
15
*
16
* @param exactAmountBOut amount of token B that will by transfer from pool to the msg.sender/owner
17
*
18
* @return amountAIn amount of B that will be transfer from msg.sender to the pool
19
* @return newIV the new sigma that this trade will result
20
* @return feesTokenA amount of fees of collected by token A
21
* @return feesTokenB amount of fees of collected by token B
22
*/
23
function getOptionTradeDetailsExactBOutput(uint256 exactAmountBOut)
24
external
25
override
26
view
27
returns (
28
uint256 amountAIn,
29
uint256 newIV,
30
uint256 feesTokenA,
31
uint256 feesTokenB
32
);
Copied!