Advanced Options

If you hate the UI

In this page we describe how to use the smart contract and other relevant tools directly. User's may choose to do so if they have a particular distaste for Margined's chosen hue of green.

Mint Power Token

In order to mint power token directly the user can use the following command:

osmosisd tx wasm execute [contract-address] '{"mint_power_perp": {"amount": "1234", "vault_id": 13, "rebase": false}}'  --from=user  --amount [collateral-amount] --gas=auto --gas-prices 0.003uosmo --gas-adjustment 1.3 --output=json --node=https://rpc.osmosis.zone:443 --chain-id='osmosis-1'

In the message they must define, the amount of power token they wish to mint; the vault id to which this should be minted and omit if they have not yet created a vault; and also whether the value should be rebased to account for normalization factor.

Lastly they should send the collateral funds they wish to use to fund the mint. Note that collateral ratio of less than 150% is not permitted and can be liquidated.

Burn Power Token

In order to burn power token user should use the following command:

osmosisd tx wasm execute osmo1rk4hregdr63rlqqj0k2rjzk6kz7w6v6tw8f5fqx2wg8203eam5equ67tdl '{"burn_power_perp": {"amount_to_withdraw": [collateral-amount], "vault_id": 1}}'  --from=user  --amount [power-token-amount] --gas=auto --gas-prices 0.003uosmo --gas-adjustment 1.3 --output=json --node=https://rpc.osmosis.zone:443 --chain-id='osmosis-1'

The message payload should contain the amount of collateral to withdraw, provided post burn it is greater than 150%; and the vault id which the message sender must be the owner of.

Additionally the power token to burn should be sent as part of the message payload.

Liquidate

In order to liquidate a position user should use the following command:

osmosisd tx wasm execute osmo1rk4hregdr63rlqqj0k2rjzk6kz7w6v6tw8f5fqx2wg8203eam5equ67tdl '{"liquidate": {"max_debt_amount": [power-amount], "vault_id": 1}}'  --from=user  --amount [collateral-to-repay-amount] --gas=auto --gas-prices 0.003uosmo --gas-adjustment 1.3 --output=json --node=https://rpc.osmosis.zone:443 --chain-id='osmosis-1'

When performing a liquidation a user must define the amount of debt, i.e. power token, they wish to repay as part of the liquidation; and additionally the vault id which they are attempting to liquidate.

Further the user should send the collateral funds they will use to repay the debt as part of the message payload.

Last updated