Swivel
Annotated source of the Swivel.sol smart contract
Last updated
Annotated source of the Swivel.sol smart contract
Last updated
Name | Type | Description |
---|---|---|
Allows a user to initiate a position
Name | Type | Description |
---|---|---|
Allows a user to initiate a Vault by filling an offline zcToken initiate order
This method should pass (underlying, maturity, maker, sender, principalFilled) to MarketPlace.custodialInitiate
Allows a user to initiate a zcToken by filling an offline vault initiate order
This method should pass (underlying, maturity, sender, maker, a) to MarketPlace.custodialInitiate
Allows a user to initiate zcToken? by filling an offline zcToken exit order
This method should pass (underlying, maturity, maker, sender, a) to MarketPlace.p2pZcTokenExchange
Allows a user to initiate a Vault by filling an offline vault exit order
This method should pass (underlying, maturity, maker, sender, principalFilled) to MarketPlace.p2pVaultExchange
Allows a user to exit (sell) a currently held position to the marketplace.
Allows a user to exit their zcTokens by filling an offline zcToken initiate order
This method should pass (underlying, maturity, sender, maker, principalFilled) to MarketPlace.p2pZcTokenExchange
Allows a user to exit their Vault by filling an offline vault initiate order
This method should pass (underlying, maturity, sender, maker, a) to MarketPlace.p2pVaultExchange
Allows a user to exit their Vault filling an offline zcToken exit order
This method should pass (underlying, maturity, maker, sender, a) to MarketPlace.exitFillingExit
Allows a user to exit their zcTokens by filling an offline vault exit order
This method should pass (underlying, maturity, sender, maker, principalFilled) to MarketPlace.exitFillingExit
Allows a user to cancel an order, preventing it from being filled in the future
Allows the admin to schedule the withdrawal of tokens
Emergency function to block unplanned withdrawals
Allows the admin to withdraw the given token, provided the holding period has been observed
Allows the admin to set a new fee denominator
Allows the admin to bulk approve given compound addresses at the underlying token, saving marginal approvals
Allows users to deposit underlying and in the process split it into/mint zcTokens and vault notional. Calls mPlace.mintZcTokenAddingNotional
Allows users deposit/burn 1-1 amounts of both zcTokens and vault notional, in the process "combining" the two, and redeeming underlying. Calls mPlace.burnZcTokenRemovingNotional.
Allows zcToken holders to redeem their tokens for underlying tokens after maturity has been reached (via MarketPlace).
Allows Vault owners to redeem any currently accrued interest (via MarketPlace)
Varifies the validity of an order and it's signature.
Emitted on any initiate*
filled is 'principalFilled' when (vault:false, exit:false) && (vault:true, exit:true) filled is 'premiumFilled' when (vault:true, exit:false) && (vault:false, exit:true)
Emitted on any exit*
filled is 'principalFilled' when (vault:false, exit:false) && (vault:true, exit:true) filled is 'premiumFilled' when (vault:true, exit:false) && (vault:false, exit:true)
Emitted on token withdrawal scheduling
Emitted on token withdrawal blocking
Emitted on a change to the feenominators array
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
m
address
deployed MarketPlace contract address
o
struct Hash.Order[]
Array of offline Swivel.Orders
a
uint256[]
Array of order volume (principal) amounts relative to passed orders
c
struct Sig.Components[]
Array of Components from valid ECDSA signatures
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (premium) being filled by the taker's initiate
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (principal) being filled by the taker's initiate
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (principal) being filled by the taker's initiate
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (interest) being filled by the taker's exit
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order[]
Array of offline Swivel.Orders
a
uint256[]
Array of order volume (principal) amounts relative to passed orders
c
struct Sig.Components[]
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (interest) being filled by the taker's exit
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (principal) being filled by the taker's exit
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (principal) being filled by the taker's exit
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being filled
a
uint256
Amount of volume (interest) being filled by the taker's exit
c
struct Sig.Components
Components of a valid ECDSA signature
o
struct Hash.Order
Order being cancelled
c
struct Sig.Components
Components of a valid ECDSA signature
a
address
Address of a new admin
e
address
Address of (erc20) token to withdraw
e
address
Address of token withdrawal to block
e
address
Address of token to withdraw
i
uint16
The index of the new fee denominator
d
uint16
The new fee denominator
u
address[]
array of underlying token addresses
c
address[]
array of compound token addresses
u
address
Underlying token address associated with the market
m
uint256
Maturity timestamp of the market
a
uint256
Amount of underlying being deposited
u
address
Underlying token address associated with the market
m
uint256
Maturity timestamp of the market
a
uint256
Amount of zcTokens being redeemed
u
address
Underlying token address associated with the market
m
uint256
Maturity timestamp of the market
a
uint256
Amount of zcTokens being redeemed
u
address
Underlying token address associated with the market
m
uint256
Maturity timestamp of the market
o
struct Hash.Order
An offline Swivel.Order
c
struct Sig.Components
Components of a valid ECDSA signature
the
struct Hash.Order
hashed order.
## Events
### Cancel
```solidity
event Cancel(
)
```
Emitted on order cancellation