You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -32,20 +32,20 @@ Fee-abs mechanism in a nutshell:
32
32
33
33
3. Swap accumulated ibc-token fee:
34
34
35
-
- The collected ibc-token users use for tx fee is periodically swaped back to customer chain's native token using osmosis.
35
+
- The collected ibc-token users use for tx fee is periodically swapped back to customer chain's native token using osmosis.
36
36
37
-
We'll goes into all the details now:
37
+
We'll go into all the details now:
38
38
39
39
#### Pulling `twap data` and update exchange rate
40
40
41
-
For this to work, we first has to set up an ibc channel from `feeabs` to `async-icq`. This channel set-up process can be done by anyone, just like setting up an ibc transfer channel. Once that ibc channel is there, we'll use that channel to ibc-query Twap data. Let's call this the querying channel.
41
+
For this to work, we first have to set up an ibc channel from `feeabs` to `async-icq`. This channel set-up process can be done by anyone, just like setting up an ibc transfer channel. Once that ibc channel is there, we'll use that channel to ibc-query Twap data. Let's call this the querying channel.
42
42
43
43
The process of pulling Twap data and update exchange rate :
44
44
45
45

46
46
47
47
Description :
48
-
For every `update exchange rate period`, at fee-abs `BeginBlocker()` we submit a`InterchainQueryPacketData` which wrapped `QueryArithmeticTwapToNowRequest` to the querying channel on the customer chain's end. Then relayers will submit `MsgReceivePacket` so that our `QueryTwapPacket` which will be routed to `async-icq` module to be processed. `async-icq` module then unpack `InterchainQueryPacketData` and send query to TWAP module. The correspone response will be wrapped in the ibc acknowledgement. Relayers then submit `MsgAcknowledgement` to the customer chain so that the ibc acknowledgement is routed to fee-abs to be processed. Fee-abs then update exchange rate according to the Twap wrapped in the ibc acknowledgement.
48
+
For every `update exchange rate period`, at fee-abs `BeginBlocker()` we submit an`InterchainQueryPacketData` which wrapped `QueryArithmeticTwapToNowRequest` to the querying channel on the customer chain's end. Then relayers will submit `MsgReceivePacket` so that our `QueryTwapPacket` which will be routed to `async-icq` module to be processed. `async-icq` module then unpack `InterchainQueryPacketData` and send query to TWAP module. The corresponding response will be wrapped in the ibc acknowledgement. Relayers then submit `MsgAcknowledgement` to the customer chain so that the ibc acknowledgement is routed to fee-abs to be processed. Fee-abs then update exchange rate according to the Twap wrapped in the ibc acknowledgement.
49
49
50
50
#### Handling txs with ibc-token fee
51
51
@@ -61,10 +61,10 @@ Fee-abstraction will use osmosis's Cross chain Swap (XCS) feature to do this. We
61
61
62
62
###### Reverse With Path-unwinding to get Ibc-token on Osmosis
63
63
64
-
- Create a ibc transfer message with a specific MEMO to work with ibc [``packet-forward-middleware``](https://github.com/strangelove-ventures/packet-forward-middleware) which is path-unwinding (an ibc feature that allow to automatic define the path and ibc transfer multiple hop follow the defined path)
64
+
- Create an ibc transfer message with a specific MEMO to work with ibc [``packet-forward-middleware``](https://github.com/strangelove-ventures/packet-forward-middleware) which is path-unwinding (an ibc feature that allows to automatic define the path and ibc transfer multiple hop follow the defined path)
65
65
- Ibc transfer the created packet to get the fee Ibc-token on Osmosis
66
66
67
-
Ex: When you sent STARS on Hub to Osmosis, you will get Osmosis(Hub(STARS)) which is different with STARS on Osmosis Osmosis(STARS). It will reverse back Osmosis(Hub(STARS)) to Osmosis(STARS):
67
+
Ex: When you sent STARS on Hub to Osmosis, you will get Osmosis(Hub(STARS)) which is different from STARS on Osmosis Osmosis(STARS). It will reverse back Osmosis(Hub(STARS)) to Osmosis(STARS):
68
68
69
69

Copy file name to clipboardExpand all lines: x/feeabs/spec/03_epoch.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Epoch
2
2
3
-
The fee abstraction levegage the Osmosis `epoch` which is used to schedule the Inter-Blockchain Communication (IBC) send packet requests. These requests are for ``QueryArithmeticTwapToNowRequest` and `SwapIBCToken`.
3
+
The fee abstraction leverages the Osmosis `epoch` which is used to schedule the Inter-Blockchain Communication (IBC) send packet requests. These requests are for ``QueryArithmeticTwapToNowRequest` and `SwapIBCToken`.
4
4
5
5
The `QueryArithmeticTwapToNowRequest` packet is used to request Time-Weighted Average Price (TWAP) data from Osmosis network.
Copy file name to clipboardExpand all lines: x/feeabs/spec/07_ibc.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -56,15 +56,15 @@ This message is expected to fail if:
56
56
-`Receiver` is empty.
57
57
-`TimeoutHeight` and `TimeoutTimestamp` are both zero.
58
58
59
-
Feeabs module will send an ibc transfer message with a sepecific data in `Memo` field. This `Memo` field data will be used in Ibc transfer middleware on counterparty chain to swap the amount of ibc token to native token on Osmosis.
59
+
Feeabs module will send an ibc transfer message with specific data in `Memo` field. This `Memo` field data will be used in Ibc transfer middleware on counterparty chain to swap the amount of ibc token to native token on Osmosis.
60
60
61
61
# Host Chain
62
62
63
63
Host chain is the swap service provider that fee abstraction uses to swap a token for native fee. Currently, host chain is designed for Osmosis.
64
64
65
65
Fee Abstraction connection to host chain should always be kept alive unless specified FROZEN, as this is crucial to the normal function of fee abstraction.
66
66
67
-
A host chain config for fee abstraction will contains:
67
+
A host chain config for fee abstraction will contain:
68
68
69
69
```proto
70
70
enum HostChainFeeAbsStatus {
@@ -89,4 +89,4 @@ message HostChainFeeAbsConfig {
89
89
There are four status of fee abstraction connection to host chain:
90
90
* UPDATED: the connection is up - to - date.
91
91
* OUTDATED: the connection is out of date after failure to ibq query, or fail to cross - chain swap after 5 retries. Should be resumed after 30 mins.
92
-
* FROZEN: the connection is frozen, no further actions will be performed.
92
+
* FROZEN: the connection is frozen, no further actions will be performed.
Copy file name to clipboardExpand all lines: x/feeabs/spec/README.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
## Abstract
2
2
3
-
When making a transactions, usually users need to pay fees in native token, but `Feeabs` module enable users on any Cosmos chain which implements this module with IBC connections to pay fee using ibc token. When users use an ibc denom as fees, the ``FeeAbstrationMempoolFeeDecorator`` ante handler will check whether the chain support the transactions to be paid by that ibc denom. It will calculate the amount of ibc tokens equivalent to native token when users make a normal transaction based on Osmosis ``twap`` between ibc denom and native denom.
3
+
When making a transaction, usually users need to pay fees in native token, but the `Feeabs` module enables users on any Cosmos chain which implements this module with IBC connections to pay fee using ibc token. When users use an ibc denom as fees, the ``FeeAbstrationMempoolFeeDecorator`` ante handler will check whether the chain supports the transactions to be paid by that ibc denom. It will calculate the amount of ibc tokens equivalent to native token when users make a normal transaction based on Osmosis ``twap`` between ibc denom and native denom.
4
4
5
-
After that, the ``FeeAbstractionDeductFeeDecorate`` ante handler swaps ibc token for native token to pay for transaction fees. The accumulated ibc token will be swaped on Osmosis Dex every epoch.
5
+
After that, the ``FeeAbstractionDeductFeeDecorate`` ante handler swaps ibc token for native token to pay for transaction fees. The accumulated ibc token will be swapped on Osmosis Dex every epoch.
6
6
7
-
The `Feeabs` module fetches Osmosis [twap](https://github.com/osmosis-labs/osmosis/tree/main/x/twap) at the begin of every [epoch](01_concepts.md#Epoch) and swap all of ibc tokens left in the module to native token using `swap router` and `ibc hooks` on Osmosis.
7
+
The `Feeabs` module fetches Osmosis [twap](https://github.com/osmosis-labs/osmosis/tree/main/x/twap) at the beginning of every [epoch](01_concepts.md#Epoch) and swap all of ibc tokens left in the module to native token using `swap router` and `ibc hooks` on Osmosis.
0 commit comments