LogoLogo
Swivel v2.0.0
Swivel v2.0.0
  • Swivel Finance Documentation
  • 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
        • Orderbook
        • Get Order
        • OHCLV (Candles)
        • Get Effective Price (Preview Market Order)
        • Get Order History
        • Get Last Trade Info
        • Get Markets
      • 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
    • Ubiquitous Language V2
      • 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
  • Description
  • Parameters
  • Returns
  • Description
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Returns
  • Description
  • Parameters
  • Returns
  • Returns
  • Description
  • Parameters
  • Returns
  • Parameters
  • Returns
  1. Developers
  2. Swivel.py
  3. swivel
  4. swivel.abstracts

swivel.abstracts.market_place

Previousswivel.abstracts.deployedNextswivel.abstracts.swivel

Last updated 2 years ago

Classes

Class MarketPlace

class MarketPlace

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 c_token_address

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

Gets the compound token address associated with a given market

Parameters

u (string) Underlying token address

m (int) Maturity epoch

opts (dict) optional call opts

Returns

web3 callable, opts

Method create_market

def create_market(
    self,
    m,
    c,
    n,
    s,
    opts=None
)

Creates a new market

Description

New instances of both ZcToken and VaultTracker are deployed, their addresses then being associated with the newly created market.

Note that this method is only callable by the admin

Parameters

m (int) Epoch in seconds, the maturity of the market

c (string) Address of the Compound token associated with the market

n (string) Name for the new ZcToken s (string) Name for the new ZcToken

opts (dict) Optional transaction options

Returns

web3 transactable, opts

Method markets

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

Gets the market associated with the given underlying and maturity arguments

Description

The returned Market object is { cTokenAddr, ZcTokenAddr, vaultAddr }

Parameters

u (string) Underlying token address

m (int) Muturity epoch opts (dict) optional call opts

Returns

web3 callable, opts

Method mature_market

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

Called after maturity, allowing all of the zcTokens to earn floating interest on Compound until funds are released

Parameters

u (string) Underlying token address

m (int) Maturity epoch opts (dict) optional call opts

Returns

web3 transactable, opts

Method pause

def pause(
    self,
    b,
    opts=None
)

Allows the admin to pause / unpause market transactions

Parameters

b Boolean which acts as a toggle. True to pause, False to unpause

Returns

web3 transactable, opts

Method paused

def paused(
    self,
    opts=None
)

A boolean which indicates a pause in all markets if truthy

Returns

web3 callable, opts

Method set_swivel_address

def set_swivel_address(
    self,
    a,
    opts=None
)

Sets the address of the Swivel smart contract this market place is associated with

Description

Note that this method is only callable by the admin once

Parameters

a (address) The address of a deployed Swivel smart contract

opts (dict) Optional transaction options

Returns

web3 transactable, opts

Method swivel

def swivel(
    self,
    opts=None
)

The address of the associated Swivel contract deployment

Returns

web3 callable, 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 transfer_vault_notional

def transfer_vault_notional(
    self,
    u,
    m,
    t,
    a,
    opts=None
)

Transfer vault notional from sender to a given address

Parameters

u (string) Underlying token address

m (int) Muturity epoch

t (string) Address of the amount owner

a (int) Amount to transfer

opts (dict) Optional transaction opts

Returns

web3 transactable, opts

swivel.abstracts.deployed.Deployed
swivel.contracts.market_place.MarketPlace