Collecting protocol fees
Each Perps market contract collects fees for the protocol inside the contract. Extracting the funds is a two step process:
- Send an unprivileged message to the contract to transfer the fees to the DAO treasury multisig wallet.
- Open a proposal on the multisig to transfer the funds to the desired destination (e.g., centralized exchange).
Transfer fees to multisig - CLI helper
The perps-deploy command line tool can be used by an engineer on the team to transfer accumulated fees from all the markets on a given network to the dao treasury wallet. The commands to run, within the perps repo, are:
cargo run --bin perps-deploy mainnet transfer-dao-fees --factory osmomainnet1
cargo run --bin perps-deploy mainnet transfer-dao-fees --factory seimainnet1
cargo run --bin perps-deploy mainnet transfer-dao-fees --factory injmainnet1
cargo run --bin perps-deploy mainnet transfer-dao-fees --factory ntrnmainnet1
Transfer fees to multisig - GUI
Alternatively, the GUI tool can be used to execute the message for each individual market. You can find a list of market addresses at the relevant frontend config pages:
You can get the full list of active markets and their addresses on the whales page. (Note: this has an extra query string parameter to indicate that addresses should be shown.)
https://share.levana.finance/whales?show_addresses=true
To transfer DAO fees:
-
Open the smart contract GUI
-
Choose the correct network and connect your wallet
-
Under "Message Type," choose "Raw Message"
-
Copy the market address into the ontract address field
-
Click on "Execute message"
-
Copy the following message into the message body field:
{"transfer_dao_fees":{}} -
Click "Send transaction" and approve the transction
Note that this can be performed from any wallet. Also, currently the smart contract GUI does not support Injective. That will hopefully be added soon.
Send funds from multisig - CLI helper
The perps-deploy command line tool can provide a message for sending all funds from the treasury wallet to a destination wallet. An engineer on the team can run this and provide the output messages to one of the multisig holders. The commands to run, within the perps repo, are:
cargo run --bin perps-deploy mainnet send-treasury --factory osmomainnet1 --dest osmo1s9w9l8jxknnpdy05sg46tzp8cg82n66y6cj58x
cargo run --bin perps-deploy mainnet send-treasury --factory seimainnet1 --dest sei1s9w9l8jxknnpdy05sg46tzp8cg82n66yl0sjh4
cargo run --bin perps-deploy mainnet send-treasury --factory injmainnet1 --dest inj1yeppm8uqheu7sdfj4urqzchq8ptp2fldw44n5h
cargo run --bin perps-deploy mainnet send-treasury --factory ntrnmainnet1 --dest neutron1s9w9l8jxknnpdy05sg46tzp8cg82n66ykugxtn
Once you have the messages, you can create a multisig proposal on each of the treasury wallets. For Osmosis and Neutron, you can use either the smart contract GUI or Apollo Safe. For Injective, you can (currently) only use Apollo. For Sei, you can only use the smart contract GUI.
In either case, make a proposal with whatever title and description you'd like, and copy the raw JSON values provided from the command above into the message field.
Send funds from multisig - using Apollo
Instead of the above steps, which require an engineer with command line experience, you can also manually create send coin messages using the Apollo GUI.
The process is easier right now for Osmosis and Injective than Sei, since the Apollo multisig web UI makes send coins an easier transaction but it does not support the Sei network yet. We can look into adding this capability to the smart contract GUI.
- Go to the treasury multisig within the Apollo multisig web UI
- Connect your wallet. Note that you must be one of the multisig holders to continue.
- Click on "Proposals," "Create Proposal," and under "Template" choose "Send."
- Fill in the "Title," "Description," and "Recipient" fields
- Choose the denom that you want to send.
- Enter the amount of the coin that you want to send. You can check the balance of the treasury multisig on mintscan.
- Submit the proposal, get two other multisig holders to vote yes, and then approve the transaction.
Sei addresses
| Description | Address |
|---|---|
| Treasury | sei1kqx8tgk9qedxngw86wseluuajk52mnqhq96q8xtv4zlv4l4qxagsv7xc3m |
ETH_USD market | sei1jvl8avv45sj92q9x9c84fq2ymddya6dkwv9euf7y365tkzma38zq5xldpy |
SEI_USD market | sei14j7zhcj50qsk6vhu7dsa48r5e7v37nthnwwx0q8q4nd0h39udy6qhqq6dm |