Contract Specifications
The codebase of our Liquid Staking Protocol can be found on our GitHub, inside the milkyway-labs/milkyway-contracts repository. Particularly, you will find two smart contracts:
The staking contract: it contains the logic that allows to stake TIA tokens in exchange for our milkTIA Liquid Staking Token, as well as unstaking such token to receive back TIA.
The treasury contract: this is where all the fees collected by MilkyWay are stored and managed.
Both contracts are deployed on the Osmosis mainnet at the following addresses:
How to liquid stake $TIA
In order to liquid stake some TIA and receive milkTIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract
message having the following structure:
{
"@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
"sender": "<Address of the user wanting to liquid stake their TIA>",
"contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
"funds": [
{
"denom": "ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877",
"amount": "<Amount of uTIA to be liquid staked (1 TIA = 1.000.000 uTIA)>"
}
],
"msg": {
"liquid_stake": {}
}
}
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (
osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)Make sure the user has bridged the amount of TIA they want to liquid stake to the Osmosis mainnet using IBC. This because we only support IBC TIA to be liquid staked (denom:
ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877
)Make sure the amount of tokens to be liquid staked is multiplied by
1.000.000
when creating the message. This means that if the users wants to liquid stake 10.5 TIA, you should set10500000
as the amount.
How to liquid unstake milkTIA
In order to liquid unstake some milkTIA and receive back TIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract
message having the following structure:
{
"@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
"sender": "<Address of the user that wants to liquid unstake their milkTIA>",
"contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
"funds": [
{
"denom": "factory/osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0/umilkTIA",
"amount": "<Amount of umilkTIA to be unstaked (1 milkTIA = 1.000.000 umilkTIA)"
}
],
"msg": {
"liquid_unstake": {}
}
}
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (
osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)Make sure the amount of tokens to be liquid unstaked is multiplied by
1.000.000
when creating the message. This means that if the users wants to liquid unstake 10.5 milkTIA, you should set10500000
as the amount.
Claiming unstaked tokens
After you request your milkTIA to be unstaked, it will need around 14 days for them to be available again. Once that time has passed, you can use the following message in order to claim your tokens:
{
"@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
"sender": "<Address of the user that wants to claim their tokens>",
"contract": "osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0",
"funds": [],
"msg": {
"withdraw": {
"batch_id": <ID of the batch inside which your request was added>
}
}
}
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (
osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)The
batch_id
provided matches the value returned by theliquid_unstake
operation execution.
Last updated