Manual queries against Perps contracts
You'll sometimes want to run queries or transactions directly against Perps contracts. You'll generally want to follow this process:
- Get the market contract address from the
frontend-configendpoint for the relevant bots. You can see the different status URLs on the bot status pages list. Some common endpoints are:- https://bots-osmomainnet1.levana.finance/frontend-config (Osmosis mainnet)
- https://seibeta-keeper.sandbox.levana.finance/frontend-config (SEI beta)
- Open up the smart contract GUI
- Select the appropriate chain
- Connect your wallet
- Copy the appropriate contract address from the
frontend-configpage to the contract address field - Select either "Execute message" to send a transaction or "Query message" to query the contract
- Enter the JSON content in message body (more on that below)
- Click "send transaction"
As you may the selections above within the smart contract GUI, the URL will update to a permalink that can be copy-pasted to keep the same configuration (chain, contract, message, etc.). This can be useful for sharing with others, and can be safely shared outside of Levana as well.
Common messages
Below are some examples of common messages you may want to use with market contracts.
Status query
The status endpoint provides lots of information on a market, such as config, liquidity, and long/short interest. Use the following message:
{"status":{}}
Set price
This is generally only useful for QA purposes against the dragonqa contract. Other contracts use Pyth-based price updates instead.
{"set_price":{"price":"5.4","price_usd":"1.2"}}
price gives the price of the base asset in terms of the quote asset, and price_usd gives the price of the collateral asset in terms of USD.
Others
This page is intended to collect more samples of queries and execute messages that may be useful in the future. Ask someone on the engineering team to add more examples as needed. Also refer to the Cosmos CLI usage page.