START HERE! Vektor Quickstart Guide π

Nobody fully grasps just how powerful Vektor is when they first log in. When you use a language like VXL, there are unlimited workflow possibilities. So we made you a list of commands to discover and get familiar. Follow this script and you'll be a master in no time! π₯π₯π₯π ποΈ
π₯ Beginner Commands π₯
Copy and paste the VXL statement that you see in the CODE BLOCKS
below (or retype them yourself) into Vektor's command line.
BLOCKCHAINS
orBLOCKS
- View a list of our supported blockchainsVENUES
- View a list of our supported venuesFUNCTIONS
- View a a list of all Vektor functions and subfunctions
.
π¨ The next step is very important to access Vektor's best functionalities π¨
.- Add your first "label" (named address) using ββ
LABELS.ADD("MY_ADDRESS", $INSERT ADDRESS HERE$)
ββor, if you want to use a demo address, try
ββLABELS.ADD("DEMO_ADDRESS", 0X870078AA499547584145308B7CFA0CA36FB676C0)
CLEAR
- Clear the workspaceLABELS
- View a list of all your labelsPOSITIONS
- Get a summary of ALL your positions across all different types, chains, venues, and labels) e.g. LP positions on Ethereum, Lend positions on Arbitrum etc.BALANCES
- Get a list of global spot balances - all labels, chains, assetsBALANCES(INCLUDE_BLOCKCHAINS=[ETHEREUM, POLYGON])
- filtered view of balancesSELL.QUOTES(1000, USDC, USDT)
- Get all the different pool swap quotes for selling 1000 USDC for USDTSELL(100%, USDC, USDT, ARBITRUM, DEMO_ADDRESS)
- Sell all of the USDC on Arbitrum at the DEMO_ADDRESS label for USDTTRANSACTIONS
- Get a list of all transactions built using Vektor
Good job! π₯ CLEAR
the workspace and get ready for the Intermediate level. π
Further reading (Beginner) - optional
π₯ Intermediate Commands π₯
HISTORY
- View a list of command line historyβ
(up arrow) - Put last submitted command back in the command linePRICE(ETH)
- View the price of an assetPRICE(ETH, QUOTE=WBTC)
- View the price of ETH, quoted in Bitcoin (WBTC)ALERT(PRICE(ETH) > 2000)
- Set price alert for when ETH price > $2,000ALERT(PRICE(WBTC, QUOTE=ETH) > 20)
- Set alert for when BTC/ETH ratio > 20ALERTS
orALERT.LIST
- View a list of your alertsLEND.MARKETS
- View a list of all supported lend marketsLEND.MARKETS(INCLUDE_ASSETS=[USDT, USDC], INCLUDE_BLOCKCHAINS=[ARBITRUM, OPTIMISM])
- View a list of USDT and USDC lend markets on either Arbitrum or OptimismSORT(LEND.MARKETS(INCLUDE_ASSETS=[USDT, USDC]), "SUPPLY_APY", ASC=FALSE)
- View a list of USDT and USDC markets, sorted by supply APY (highest first)LEND.POSITIONS
- Get all your lending positions across all chains, venues, and labelsBORROW.POSITIONS
- Get all your borrow positions across all chains, venues, and labelsLEND(1, ETH, AAVE_V3, ARBITRUM, DEMO_ADDRESS)
- Lend 1 ETH to Aave v3 on Arbitrum (adjust parameters for your purposes)BRIDGE.QUOTES(1000, USDT, ARBITRUM, OPTIMISM)
- Get a list of quotes for bridging 1000 USDT from Arbitrum to OptimismBRIDGE(50%, USDT, ARBITRUM, OPTIMISM, DEMO_ADDRESS)
- Bridge 50% of your USDT at DEMO_ADDRESS from Arbitrum to Optimism using the default quoteMCAP(ETH) + MCAP(STETH)
- Compute combined market cap of ETH and STETH assetsLP.POOLS(INCLUDE_ASSETS=[STETH])
- View a list of all supported LP pools containing STETH as a constituent assetLIST.CONCAT(LP.POOLS(INCLUDE_ASSETS=[STETH]), LP.POOLS(INCLUDE_ASSETS=[RETH]))
- Join together (concatenate) a list of LP pools containing STETH with a list of LP pools containing RETHLP.POSITIONS
- Get all your LP positions across all chains, venues, and labelsLP.DEPOSIT(0.5, WETH, LP.POOL([LUSD, WETH], SUSHISWAP, ETHEREUM), DEMO_ADDRESS)
- Deposit 0.5 WETH and equivalent LUSD to the LUSD-WETH pool on Sushiswap on Ethereum (adjust for your purposes)
Good job! π₯ CLEAR
the workspace and get ready for the Advanced level. π
Further reading (Intermediate) - optional
- Lend & Borrow announcement or detailed docs
- Formulaic alert announcement or detailed docs
- BRIDGE function announcement or detailed docs
- LP functions announcement or detailed docs
π₯ Advanced Commands π₯
PRICES
- Get a list of prices for all assetsSORT(PRICES, "CHANGE_24H", ASC=FALSE)
- Get a list of prices for all assets, sorted by 24hr price change % in descending order (i.e. largest first)ROW(SORT(PRICES, "CHANGE_24H", ASC=FALSE), 1)
- Extract the first row from the above listROW(SORT(PRICES, "CHANGE_24H", ASC=FALSE), 1).ASSET
- Access the the "ASSET" data point from the above row struct/object (i.e. the asset name for the best performing asset in the last 24h)BALANCES.ASSET.SYMBOL
- Get a list of all the asset symbols of your spot balances across all chains and labelsLIST.CONTAINS(BALANCES.ASSET.SYMBOL, ROW(SORT(PRICES, "CHANGE_24H", ASC=FALSE), 1).ASSET)
- Conditional test (TRUE/FALSE) whether your spot balances include the best performing asset in the last 24h- Set an alert for the above; Alert me when the 24hr best performing asset is something in my portfolio (i.e. so I can think about selling it)
βALERT(LIST.CONTAINS(BALANCES.ASSET.SYMBOL, ROW(SORT(PRICES,"CHANGE_24H", ASC=FALSE), 1).ASSET), NAME="YOU HAVE A HIGH-PERFORMING ASSET!")
ASSETS
- Get a list of all supported assetsASSETS(INCLUDE_BLOCKCHAINS=[ARBITRUM])
- Get a list of all supported assets, filtered for only Arbitrum assetsPRICES(INCLUDE_ASSETS=ASSETS(INCLUDE_BLOCKCHAINS=[ARBITRUM])
- Get a list of prices for all Arbitrum assetsPRICES(INCLUDE_ASSETS=ASSETS(INCLUDE_BLOCKCHAINS=[ARBITRUM]).MARKET_CAP
- Get a list of market cap data points for all Arbitrum assetsSUM(PRICES(INCLUDE_ASSETS=ASSETS(INCLUDE_BLOCKCHAINS=[ARBITRUM]).MARKET_CAP)
- Get the total market cap of all Arbitrum assets- Find out "How much TVL do I have on Curve?"
SUM(COLUMN(LP.POSITIONS(INCLUDE_VENUES=[CURVE]), "VALUE"))
orSUM(LP.POSITIONS(INCLUDE_VENUES=[CURVE]).VALUE)
- Find out "What's the Average supply APY across a basket of stablecoins?"
AVERAGE(LEND.MARKETS(INCLUDE_ASSETS=[USDC, USDT, DAI, SUSD, BUSD, GUSD, LUSD], INCLUDE_BLOCKCHAINS=[ETHEREUM]).SUPPLY_APY)
- Find out "What's the best APY if I LP my stETH?"
MAX(LP.POOLS(INCLUDE_ASSETS=[STETH]).APYS.AVG_30D)
BORROW.ACCOUNTS
- Get account-level borrow information on all your labels- Set an alert for when your riskiest debt position is close to getting liquidated
ALERT(MIN(COLUMN(BORROW.ACCOUNTS, "HEALTH_FACTOR")) < 1.1, NAME="LIQUIDATION IMMINENT, ADD MORE COLLATERAL!")
Amazing job! π₯ CLEAR
the workspace and get ready for the Expert level. π
Further reading (Advanced) - optional
π Expert Commands π
- Set an alert for when your LP position is no longer in the best APY pool
ALERT(NOT(LIST.CONTAINS(LP.POSITIONS.POOL, MAX(LP.POOLS(INCLUDE_ASSETS=[WMATIC]), ["APYS", "AVG_30D"]))))
- Generate a list of all the assets in Uniswap v3 pools on BNB chain
LIST.UNIQUE(LIST.FLATTEN(LP.POOLS(INCLUDE_VENUES=[UNISWAP_V3], INCLUDE_BLOCKCHAINS=[BNBCHAIN]).ASSETS))
- Deposit a concentrated liquidity position to a range
LP.DEPOSIT(0.15, ETH, LP.POOL([WETH, USDC], UNISWAP_V3, ARBITRUM), DEMO_ADDRESS, RANGE=[1600, 1700])
(adjust parameters for your purposes) - Set an alert for when your LP position is no longer in range
ALERT(NOT(LP.POSITION(LP.POOL([WMATIC, USDC], UNISWAP_V3, POLYGON), DEMO_ADDRESS).RANGE.IN_RANGE), NAME="POSITION OUT OF RANGE!!")
- Simulate entering a position with 3 different deposit quotes
LP.DEPOSIT_QUOTE(100, ETH, LP.POOL([ETH, STETH], UNISWAP_V3, ETHEREUM), RANGE=[0.9, 1.11]); LP.DEPOSIT_QUOTE(100, ETH, LP.POOL([ETH, STETH], UNISWAP_V3, ETHEREUM), RANGE=[0.94, 1.04]); LP.DEPOSIT_QUOTE(100, ETH, LP.POOL([ETH, STETH], UNISWAP_V3, ETHEREUM), RANGE=[0.98, 1.00])
(you can also use Shift-N instead of;
to add multi-line statements) - Compute the Lend-Borrow spread for USDC on Compound V3 on Arbitrum
BORROW.MARKET(USDC, COMPOUND_V3_USDC, ARBITRUM).BORROW_APY - LEND.MARKET(USDC, COMPOUND_V3_USDC, ARBITRUM).SUPPLY_APY
- Set a multi-criteria alert
ALERT(AND(OR(PRICE(ETH) < 1700, PRICE(ETH) > 2000),OR(PRICE(WBTC) < 22000, PRICE(WBTC) > 30000)))
Superb job! π
CLEAR
the workspace and get ready for the Master level. π
Further reading (Expert) - optional
- Concentrated Liquidity announcement or detailed docs
ποΈ Master Commands ποΈ
These depend on functionality that's still in development. We will add soon! π°οΈ
Any questions about Vektor or VXL please Let us know! We're always happy to help.