LogoLogo
Swivel v3.0.0
Swivel v3.0.0
  • Litepaper
    • zcTokens
      • Exiting/Selling zcTokens
      • Secondary AMM's
    • nTokens
      • Exiting/Selling nTokens
    • AMM vs. Orderbook
  • Swivel Exchange
    • Testnet Setup
    • Exchange Functions
      • Fixed-Yield Lending
      • Purchasing nTokens
      • Selling zcTokens
      • Selling nTokens
      • Splitting/Combining Tokens
      • Redeeming Tokens/Interest
    • Maturity
    • Liquidity Incentives
    • Minimums, Rate Limits & Fees
    • Retroactive Distribution
    • How to Claim SWIV Tokens
  • Developers
    • Exchange API
      • GET
        • Get Markets
        • Orderbook
        • Get Order
        • OHCLV (Candles)
        • Get Effective Price (Preview Market Order)
        • Get Order History
        • Get Last Trade Info
      • POST
        • Order
    • Swivel.js
      • API
        • Swivel
        • MarketPlace
        • VaultTracker
    • Swivel.py
      • swivel
        • swivel.abstracts
          • swivel.abstracts.deployed
          • swivel.abstracts.market_place
          • swivel.abstracts.swivel
          • swivel.abstracts.vault_tracker
        • swivel.contracts
          • swivel.contracts.market_place
          • swivel.contracts.swivel
          • swivel.contracts.vault_tracker
        • swivel.vendors
          • swivel.vendors.signer
          • swivel.vendors.w3
    • Scrivel (Python Examples)
    • Contracts Overview
      • Contracts
        • Swivel
        • MarketPlace
        • VaultTracker
        • Creator
    • Ubiquitous Language V3
      • Shared Language
      • UI Language
      • Technical Language
      • Compound Language
      • Finance Terms
  • Community & Media
  • Other Resources
    • Institutions
      • Rate Profile Optimization
        • Instruments and Participants
        • Market Opportunities and Pricing
        • Counterparty Risk Management
        • Benefits and drawbacks of standardization
        • User Needs
          • Corporate Treasury and Funding
          • Institutional Investors and Asset Managers
          • Speculators and Proprietary Trading Functions
          • Brokers and Market Makers
          • Liquidity Management, Funding and Resource Management
          • Risk Management and Insurance
          • Smaller Institutions and Individuals
      • Swivel for Enterprise
        • Overview
        • How Swivel works
        • Flexible Order Book
        • Future Developments
      • Delegated Credit
        • Challenges of Delegated Credit
          • Credit Pools
          • Intermediating Trust in Credit Delegation
Powered by GitBook
On this page
  • Classes
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Description
  • Returns
  • Parameters
  • Returns
  • Returns
  • Returns
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Description
  • Parameters
  • Returns
  • Returns
  1. Developers
  2. Swivel.py
  3. swivel
  4. swivel.abstracts

swivel.abstracts.swivel

Previousswivel.abstracts.market_placeNextswivel.abstracts.vault_tracker

Last updated 2 years ago

Classes

Class Swivel

class Swivel

Helper class that provides a standard way to create an ABC using inheritance.

Ancestors

Descendants

Methods

Method admin

def admin(
    self,
    opts=None
)

The stored admin address for this contract

Returns

web3 callable, opts

Method cancel

def cancel(
    self,
    order,
    s,
    opts=None
)

Allows the cancellation of an order, preventing it from being filled further

Parameters

order (dict) An offline swivel order

s (string) Valid ECDSA signature for the order

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method combine_tokens

def combine_tokens(
    self,
    u,
    m,
    a,
    opts=None
)

Allows users to deposit/burn 1:1 amounts of both zcTokens and vault notional, in the process 'combining' the two and redeeming underlying

Parameters

u (string) Address of the underlying token

m (int) Maturity timestamp of the market

a (int) Amount of zctokens being redeemed

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method domain

def domain(
    self,
    opts=None
)

The stored EIP712 domain hash for this contract

Returns

web3 callable, opts

Method exit

def exit(
    self,
    orders,
    a,
    s,
    opts=None
)

Allows a user to exit (sell) a currently held position to the marketplace

Parameters

orders (tuple) Offline swivel orders

a (list) Order volume (principal) amounts relative to orders list

s (tuple) Valid ECDSA signatures for each order

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method feenominators

def feenominators(
    self,
    i,
    opts=None
)

The stored fee constants for this contract

Parameters

i (int) Index of the fenominator array to return

Returns

web3 callable, opts

Method hold

def hold(
    self,
    opts=None
)

The stored hold constant for this contract

Description

TODO

Returns

web3 callable, opts

Method initiate

def initiate(
    self,
    orders,
    a,
    s,
    opts=None
)

Allows a user to initiate a position

Parameters

orders (tuple) Offline swivel orders

a (list) Order volume (principal) amounts relative to orders list

s (tuple) Valid ECDSA signatures for each order

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method market_place

def market_place(
    self,
    opts=None
)

The stored address of a market place contract associated with this contract

Returns

web3 callable, opts

Method min_feenominator

def min_feenominator(
    self,
    opts=None
)

The stored constant representing the minimum value for any fee denominator

Returns

web3 callable, opts

Method name

def name(
    self,
    opts=None
)

The stored name constant for this contract

Returns

web3 callable, opts

Method redeem_vault_interest

def redeem_vault_interest(
    self,
    u,
    m,
    opts=None
)

Allows vault owners to redeem any currently accrued interest

Parameters

u (string) Address of the underlying token

m (int) Maturity timestamp of the market

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method redeem_zc_token

def redeem_zc_token(
    self,
    u,
    m,
    a,
    opts=None
)

Allows zctoken holders to redeem their tokens for underlying tokens after maturity has been reached

Parameters

u (string) Address of the underlying token

m (int) Maturity timestamp of the market

a (int) Amount of zctokens being redeemed

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method split_underlying

def split_underlying(
    self,
    u,
    m,
    a,
    opts=None
)

Allows users to deposit underlying and in the process split it into/mint zcTokens and vault notional

Parameters

u (string) Address of the underlying token

m (int) Maturity timestamp of the market

a (int) Amount of underlying being deposited

opts (dict) Optional tx opts

Returns

web3 transactable, opts

Method transfer_admin

def transfer_admin(
    self,
    a,
    opts=None
)

Allows the current admin to transfer the title to another party

Description

Note that this method is only callable by the admin

Parameters

a (address) Address of the new admin

Returns

web3 transactable, opts

Method version

def version(
    self,
    opts=None
)

The stored version constant for this contract

Returns

web3 callable, opts

swivel.abstracts.deployed.Deployed
swivel.contracts.swivel.Swivel