Factor Docs
  • 🏭Introduction to Factor
  • Getting Started
    • đŸ•šī¸Quickstart
    • 🔗Supported Protocols
    • 🔐Strategy Cheatsheet
      • Swaps Cheatsheet
        • Conditional Market Order
        • Automated Market Order
        • Multi Swap
        • Automated Swap & Earn
        • Automated Scale Order
        • Scale Order Partial Fill Yield
        • Interest On Pending Trades
        • Leverage Trade
        • Leverage DCA
      • Lending Cheatsheet
        • Lending Pool Zap
        • Multi Lend
        • Market Making To Lending Switch
        • Earn Negative Interest
        • Carry Trade
        • Leveraged Staking Yields
        • Leveraged Fixed Yields
      • Borrowing Cheatsheet
        • Collateralized Borrow
        • Collateralized Borrow Zap
        • Multi Borrow
        • Debt Switching
        • Automated Debt Readjustments
        • Debt Refinancing
        • Asset Switching
      • Liquidity Provision Cheatsheet
        • Liquidity Pool Zap
        • Yield Farm Zap
        • Automated LP Adjustments
        • Yield Farm Adjustments
      • Flash Loan Cheatsheet
    • 🧠Strategy Explainers
      • Leverage
        • Leverage Performance Modelling
        • Leverage Long Simulation
        • Leverage Short Simulation
      • Yield
        • Yield Performance Modelling
      • PT Strategies
        • Leverage Long PT Simulation
      • Delta Neutral Yields
        • Levered USD & ETH Carry
    • 📖Glossary
  • Factor Discover
    • 🔍Factor Discover
      • Public Strategies User Guides
        • Deposit Into User Created Strategies
        • Withdraw From User Created Strategies
      • Leverage User Guides
        • Create A Leveraged Position
        • Adjust Position Leverage
        • Add Collateral To Position
        • Withdraw Collateral From Position
        • Repay Position Debt
      • Yield User Guides
        • Auto-compound Your Yields
      • PT User Guides
        • Redeem Your PT
      • APY Calculations
    • âš™ī¸Factor Operated Strategies
      • Yield Type Strategies
        • Arbitrum (ChainID: 42161)
          • 3.4x rETH Carry + 1x ARB Lending Yields - Aave & Compound
          • 3.9x wstETH Carry + 1x USDT Lending Yields - Aave & Compound
          • 4.4x rETH Carry + 1x USDC Lending Yields - Aave & Compound
          • 7x rETH:ETH Levered Yields - Compound
          • Amplified wstETH Yields On USDC Lend - Aave
          • Additional rETH Yields On USDC Lend
          • Additional Liquid Staked ETH Yields On USDC Lend
          • Additional Liquid Restaked ETH Yields On USDC Lend
          • Diversified USDC Lending Yields - Aave & Compound
        • Base (ChainID: 8453)
          • 4.4x cbETH Carry + 1x USDC Lending Yields - Aave & Compound
          • 3.5x Leveraged cbETH:ETH Yields - Aave
          • Additional cbETH Yields On USDC Lend
          • Additional Liquid Staked ETH Yields On USDC Lend
          • Amplified cbETH Yields On USDC Lend - Aave
          • Amplified cbETH Yields On cbBTC Lend - Aave
      • Trading Type Strategies
        • WBTC Base Switch On rETH For ETH & USDC Yields
      • Delta Neutral Type Strategies
        • Arbitrum (ChainID: 42161)
          • Delta Neutral ETH With rETH & USDC Yields
        • Base (ChainID: 8453)
          • Delta Neutral ETH With cbETH & USDC Yields
  • Factor Studio
    • 🎨Factor Studio
      • Automated Strategies
      • Conditional Strategies
    • đŸ‘ĨPublic Strategies
      • User Guide
        • Public Strategy Creation
        • Create An Exit Strategy
        • Deployment Wizard
        • Strategy Execution
      • Security
      • Exit Strategy
    • đŸ—ī¸Strategy Builder
      • Building Blocks User Guide
        • Lend
        • Borrow
        • Swap
        • Flash Loan
    • 📜Studio Contracts
      • Leverage
        • FactorLeverageDescriptor.sol
        • FactorLeverageVault.sol
        • WrapperFactorLeverageVault.sol
      • LP Management
        • FactorLPVault.sol
        • FactorLPDescriptor.sol
    • 🏠Private Strategies
      • User Guide
        • Private Strategy Creation
  • Factor SDK
    • đŸ“ĻFactor SDK
    • â†”ī¸REST APIs
      • Utility APIs
        • Pricing
        • Stats
  • Factor Building Blocks
    • 🧱Factor Building Blocks
    • âžĄī¸Lend
    • âŦ…ī¸Borrow
    • 💰Yield
      • Concepts
        • Yield Farming
        • Yield Aggregators
      • ⚡Zap
    • 🌊LP Management
      • Concepts
        • Automated Market Maker
        • Concentrated Liquidity
    • đŸĨŠStake
    • 🔀Swap
      • Concepts
        • Market Orders
        • DEX Aggregators
    • 🔄Leverage
      • Concepts
        • Collateralized Lending & Borrowing
        • Looping
      • Leverage Dev Guides
        • Create Leveraged Position
        • Add Leverage To Position
      • Strategy Contracts
        • AAVEV3LeverageStrategy.sol
        • CompoundLeverageStrategy.sol
        • LodeStarLeverageStrategy.sol
        • RadiantLeverageStrategy.sol
        • SiloLeverageStrategy.sol
        • SiloYieldTokenStrategy.sol
        • TenderLeverageStrategy.sol
      • FAQ - Leverage Building Block
    • đŸĒ„Flash Loan
      • Concepts
        • Uncollateralized Lending & Borrowing
        • Flash Loan
  • Factor Adapters
    • 🔌Factor Adapters
    • 📜Adapter Contracts
      • Leverage
      • Yield
      • Swap
      • Flash Loan
  • Governance
    • đŸ›ī¸FactorDAO
      • Factor Flywheel
      • Factor Participants
      • Governance Incentive Calculations
        • FactorDAO Incentives Model (LTIPP)
      • User Guides
        • Stake FCTR
        • Governance Migration
      • Contracts
        • FactorDAO Contract Addresses
      • FactorDAO Multisig Addresses
      • Platform Fees
    • đŸĒ™FCTR Token
      • Staking and Governance
      • Tokenomics
      • Contract Addresses
      • FAQ - Tokenomics
    • âš–ī¸Factor Scale
      • Arbitrum Foundation LTIPP
      • Emission Multiplier Calculations
        • Emissions Multiplier Model
      • User Guides
        • Stake FCTR
        • Vote On Emissions Distribution
      • Contracts
        • Factor Scale Contract Addresses
      • ❔FAQ - Factor Scale
    • 🚀Factor Boost
      • Contracts
        • Factor Boost Contract Addresses
    • đŸ’ŧFactor Bribes
      • Contracts
        • Factor Bribes Contracts
  • Security
    • đŸ›Ąī¸Security
    • 📋Audits
      • PeckShield
        • Leverage Vault Wrapper
        • Silo Yield
        • Silo Leverage
        • Penpie
        • Factor Boost
      • SourceHat
        • FactorDAO Vaults
        • FCTR & Voting Escrow
  • Reference
    • Discover Pro dApp
    • Studio dApp
    • Discover dApp
    • Official Website
    • Press Kit
    • Partnership Form
    • Media Kit
    • Geo Restrictions
  • Community
    • Factor Contributors
    • X
    • Discord
    • Telegram
    • Medium
    • Email Enquiries
Powered by GitBook
On this page
  • Properties
  • Public
  • Structs
  • TokenURIParams
  • Methods
  • setTokenName() - external
  • constructTokenURI() - public view returns
  • renderImage() - private view returns
  • renderId() - private view returns
  • renderStrategy() - private view returns
  • renderAsset() - private view returns
  • renderDebt() - private view returns

Was this helpful?

  1. Factor Studio
  2. Studio Contracts
  3. Leverage

FactorLeverageDescriptor.sol

Contract Overview

The FactorLeverageDescriptor.sol contract enables the SVG representation of a position to be generated on-chain. This is achieved via the encoding of position metadata as SVG strings.

Properties

Public

Property
Type
Modifier
Description

tokenDescriptions

mapping(address => string)

public

A mapping between the token address and the corresponding name (i.e. symbol).

Structs

TokenURIParams

A struct that defines the URI of the token (representing a position on the underlying Leverage Vault contract).

Variables
Type
Description

id

uint256

The identifier of the position managed by the Leverage Vault contract.

name

string

The name of the Leverage Vault collection. Used as the NFT collection name.

description

string

The symbol of the Leverage Vault collection. Used as the NFT collection symbol.

assetToken

address

The address of the asset used as collateral for the position.

debtToken

address

The address of the debt used as collateral for the position.

assetAmount

uint256

The amount of asset token held by the position.

debtAmount

uint256

The amount of debt token held by the position.

Methods

setTokenName() - external

Updates the token name (i.e. symbol) for the provided tokenAddress.

Parameters

Params
Type
Description

tokenAddress

address

The address of the token.

tokenDescription

string

The name (i.e. symbol) of the token to be updated.

constructTokenURI() - public view returns

Assembles the encoded string which contains the ERC721 metadata JSON. This includes a base64 string representation of the position's SVG image that contains position data.

Parameters

Params
Type
Description

params

An object that contains position information queried from the position's Strategy contract: id = Position identifier name = Name of the Leverage Vault collection description = Symbol of the Leverage Vault collection assetToken = Address of asset token debtToken = Address of debt token assetAmount = The position's asset balance debtAmount = The position's debt balance

Returns

Type
Description

string

An encoded string that contains the ERC721 metadata JSON.

renderImage() - private view returns

Renders a base64 string that represents the position's information in a SVG format.

Parameters

Params
Type
Description

id

uint256

The identifier of the position managed by the Leverage Vault contract.

assetToken

address

The address of the asset used as collateral for the position.

debtToken

address

The address of the debt used as collateral for the position.

assetAmount

uint256

The amount of asset token held by the position.

debtAmount

uint256

The amount of debt token held by the position.

Returns

Type
Description

string

A base64 string representation of the position's SVG image that contains position data.

renderId() - private view returns

Renders a SVG string of the position identifier.

Parameters

Params
Type
Description

id

uint256

The identifier of the position managed by the Leverage Vault contract.

Returns

Type
Description

string

A SVG string representation of the position identifier.

renderStrategy() - private view returns

Renders a SVG string of the Strategy's asset and debt names (i.e. symbols).

Parameters

Params
Type
Description

asset

string

The name (i.e. symbol) of the Strategy's asset token.

debt

string

The name (i.e. symbol) of the Strategy's debt token.

Returns

Type
Description

string

A SVG string representation of the position's asset and debt token names.

renderAsset() - private view returns

Renders a SVG string of the position's asset balance.

Parameters

Params
Type
Description

amount

uint256

The amount of asset token held by the position.

Returns

Type
Description

string

A SVG string representation of the position's asset balance.

renderDebt() - private view returns

Renders a SVG string of the position's asset balance.

Parameters

Params
Type
Description

amount

uint256

The amount of debt token held by the position.

Returns

Type
Description

string

A SVG string representation of the position's debt balance.

PreviousLeverageNextFactorLeverageVault.sol

Last updated 1 year ago

Was this helpful?

📜
TokenURIParams