xWIN Finance
  • What is xWIN Finance?
  • Mission and Vision
  • Challenges and Solutions
  • Why use xWIN Finance?
  • Roadmap
  • Product Overview
    • Supported Native Token
      • Arbitrum
      • BSC
      • Polygon
    • Robo-Advisor
    • Vaults
      • xWIN Vault
        • Allocation (Index Fund)
        • Technical Analysis
        • Stable Coin Alpha (SCA)
        • Dollar Cost Average
        • Reverse Dollar Cost Average (RDCA)
        • Lending
      • xWin Partner Vaults
      • Private Vault
  • Fees
    • Book Cost vs High Water Mark
    • Current Fees
      • Arbitrum Vault Fees
      • BSC Vault Fees
      • Polygon Vault Fees
    • Calculating fees
    • Fee Discount
  • User Guide
    • How to Connect Wallet
    • Robo-Advisor
    • Deposit
    • Withdraw
    • Rebalance
    • Referral
    • My Menu
  • Documentation
  • XWIN Token
    • Tokenomics
    • Burn Program
    • xWIN Staking
      • xWin Auto Compound Lock
      • xWIN Master Farm
  • Audit Reports
  • xWIN Finance (one pager)
  • v1.0 Docs
    • Fund Unit Price
    • Fund Token Distribution
    • Audit Reports
    • How to Use?
      • For Users
        • How to use MetaMask on xWIN
        • xWIN Dashboard
        • Browse the Details of Vaults
        • Deposit
        • Withdrawal
      • For Vault Owners
        • Setup Target %
        • Rebalance
    • White Paper
    • Core Features
      • xWIN Sector Index Vaults
      • xWin Trading Vaults
      • Fixed Rate Staking Vaults
      • Private/Business Vaults
    • Extra features
      • XWIN Farming
      • Lucky Draw
      • xWIN Liquidity Pool Farming Vaults
      • Get XWIN-BNB LP Token
      • Buy / Sell XWIN
      • Claim Tokens and Bonus $XWIN
      • Yield Optimizer Vaults(Deprecated)
    • Farming Rewards
    • Platform Fee
  • v1.1 Docs
    • Roadmap
    • Overview
    • Intro
    • Mission & Vision
    • Challenges & Solutions
    • General
      • Dashboard
      • Markets
      • Leaderboard
    • My Menu
      • My Vaults
      • My Deposit
      • My Referral
    • Robo Advisor
    • Vaults
      • xWin Vaults
        • Public Vaults
      • Partner Vault
        • Single Asset Vault
        • Auto Trading Vault
          • Dollar-Cost-Average Vault
          • Interest Rate Trading Vault
          • BBMA Trading
          • Stable Alpha
    • Recent Vaults
    • Documents & Whitepaper
    • xWIN Staking
      • xWIN Auto
      • Master Farm
    • Fee Structure
      • Fee of User's Perspective
      • Strategy Fee
      • Platform Fee
      • Performance Fee
    • XWIN Token
      • Tokenomics
      • Burn Program
    • Technical
      • API related docs
      • xWIN Swap Engine
      • xWIN Price Oracle
      • GitHub
  • Our Team
  • Contact us
Powered by GitBook
On this page
  • FundV2
  • FundV2Factory

Was this helpful?

  1. v1.1 Docs
  2. Technical

API related docs

FundV2

Holds a portfolio of tokens and allows a fund manager to trade and rebalance tokens

Rebalance

function Rebalance(address[] _toAddr, uint256[] _targets) external

Rebalance the Portfolio Vault and redistribute the funds new tokens and weights

Parameters

Name
Type
Description

_toAddr

address[]

Token Addresses

_targets

uint256[]

Target Weights for tokens

Rebalance

function Rebalance(address[] _toAddr, uint256[] _targets, uint32 _slippage) public

Rebalance the Portfolio Vault and redistribute the funds new tokens and weights

Parameters

Name
Type
Description

_toAddr

address[]

Token Addresses

_targets

uint256[]

Target Weights for tokens

_slippage

uint32

DEX slippage for swaps

deposit

function deposit(uint256 amount) external returns (uint256)

Buy fund shares by depositing baseToken

Swaps will be done before shares are created

Parameters

Name
Type
Description

amount

uint256

Amount of baseToken to deposit

Return Values

Name
Type
Description

shares

uint256

Amount of shares received

deposit

function deposit(uint256 amount, uint32 _slippage) public returns (uint256)

Buy fund shares by depositing baseToken

Swaps will be done before shares are created

Parameters

Name
Type
Description

amount

uint256

Amount of baseToken to deposit

_slippage

uint32

DEX slippage for swaps

Return Values

Name
Type
Description

shares

uint256

Amount of shares received

withdraw

function withdraw(uint256 amount) external returns (uint256)

Exchange Portfolio vault shares for baseToken

Performance fee will be charged if a profit is made, if no deposit the entire withdraw amount will be treated as profit

Parameters

Name
Type
Description

amount

uint256

Amount of shares to withdraw

Return Values

Name
Type
Description

tokenAmt

uint256

Amount of baseToken received

withdraw

function withdraw(uint256 amount, uint32 _slippage) public returns (uint256)

Exchange Portfolio vault shares for baseToken

Performance fee will be charged if a profit is made, if no deposit the entire withdraw amount will be treated as profit

Parameters

Name
Type
Description

amount

uint256

Amount of shares to withdraw

_slippage

uint32

DEX slippage for swaps

Return Values

Name
Type
Description

tokenAmt

uint256

Amount of baseToken received

FundV2Factory

Deploys New Portfolio Fund Contracts

createFundPrivate

function createFundPrivate(string name, string symbol, address[] _toAddresses, uint256[] _targetWeight) external

Deploys a new ERC20 Private Portfolio Fund

Parameters

Name
Type
Description

name

string

Name of the Portfolio Fund

symbol

string

Symbol of the Portfolio Fund token

_toAddresses

address[]

Initial allocation token addresses

_targetWeight

uint256[]

Initial allocation target weights

massProcessPlatformFee

function massProcessPlatformFee() external

Process platform fee on all funds

processPlatformFee

function processPlatformFee(address _fundAddr) external

Process platform fee on input fund address

Parameters

Name
Type
Description

_fundAddr

address

Address of fund to collect fee

processManagerFee

function processManagerFee(address _fundAddr) external

Process manager fee on input fund address

Parameters

Name
Type
Description

_fundAddr

address

Address of fund to collect fee

massProcessManagerFee

function massProcessManagerFee() external

Process manager fee on all funds

getLatestFundID

function getLatestFundID() public view returns (uint256)

Gets the ID of the lastest fund created

getFundfromIndex

function getFundfromIndex(uint256 _index) public view returns (address)

Get Portfolio Fund address from fund ID

Parameters

Name
Type
Description

_index

uint256

id of the fund

Return Values

Name
Type
Description

address

address

Address of input fund ID

PreviousTechnicalNextxWIN Swap Engine

Last updated 1 year ago

Was this helpful?