PodCall
PodCall is a contract that should inherit PodOption and override the four main functions: mint, unmint, exercise, and withdraw.

Methods

mint

This function is meant to be called by underlying token holders wanting to write option tokens.
Locks some amount of the underlying asset and writes option tokens. The issued amount ratio is 1:1 (e.g., 1 option token for 1 underlying token). It presumes the caller has already calledIERC20.approve() on the underlying token contract to move caller funds.
This function can only be called during tradeWindow period depending on the exercise type.
For European: before exerciseWindow. For American: anytime before expiration.
Solidity
Web3
1
/// Instantiate Option
2
PodCall podCall = PodCall("/*address*/");
3
4
// Number of options to mint. The decimals of the options will be the same
5
// as the decimals of the underlying asset.
6
// (E.g: If option decimals is equal to 6, 1000000 = 1 option,
7
// givig the seller the right to buy 1 unit of underlying)
8
uint256 amountOfOptions = 1000000;
9
10
/*
11
* @param amountOfOptions The amount option tokens to be issued; this will lock
12
* same amount in a 1:1 ratio units of underlying asset into this
13
* contract.
14
15
* @param owner The address that will store at shares. owner will
16
* be able to withdraw later on behalf of the sender. It is also important
17
* to notice that the options tokens will not be send to owner, but to the msg.sender
18
*/
19
podCall.mint(amountOfOptions, owner);
Copied!
1
// Soon
Copied!

unmint

Unlocks some amount of the underlying token by burning option tokens. This mechanism ensures that users can only redeem tokens they've previously lock into this contract.
This function can only be called during tradeWindow period depending on the exercise type.
For European: before exerciseWindow. For American: anytime before expiration.
Solidity
Web3
1
/// Instantiate Option
2
PodCall podCall = PodCall("/*address*/");
3
4
uint256 amountOfOptions = 10000000;
5
6
/*
7
* @param amountOfOptions The amount option tokens to be unminted; this will burn
8
* same amount of options, releasing in a 1:1 ratio units of underlying asset.
9
*/
10
podCall.unmint(amountOfOptions);
Copied!
1
// Soon
Copied!

exercise

Allow call token holders to use them to buy some amountOfOptions units of the underlying token for the amountOfOptions * strike price units of the strike token. It presumes the caller has already called IERC20.approve() on the strike token contract to move caller funds.
During the process:
  • The amountOfOptions units of underlying tokens are transferred to the
    caller
  • The amountOfOptions option tokens are burned.
  • The amountOfOptions * strikePrice units of strike tokens are transferred into
    this contract as a payment for the underlying tokens.
This function can only be called duringexpirationWindow period depending on the exercise type.
For European: after trade window and before expiration. For American: anytime before expiration.
Solidity
Web3
1
/// Instantiate Option
2
PodCall podCall = PodCall("/*address*/");
3
4
uint256 amountOfOptions = 10000000;
5
6
// @param amountOfOptions The amount option tokens to be exercised
7
podCall.exercise(amountOfOptions);
Copied!
1
// Soon
Copied!

withdraw

Withdraws the locked amount of Strike tokens after expiration by burning Options.
The Strike Asset is NOT withdrawn on a first-come-first-serve basis. Meaning that, if there is not enough underlying asset left because the series has been exercised, The mix of underlying tokens and strike assetare distributed proportionally to the sellers.
This function can only be called during withdrawWindow which is after expiration.
Solidity
1
/// Instantiate Option
2
PodCall podCall = PodCall("/*address*/");
3
4
// Withdraws the original position. Could be only underlying asset,
5
// a mix of underlying asset and strike, or only strike asset.
6
podCall.withdraw();
Copied!
Last modified 1yr ago