Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ProfitClient): Fix fill amount USD computation #1688

Merged
merged 7 commits into from
Jul 22, 2024
Merged

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Jul 18, 2024

The ProfitClient currently assumes that the value of a fill can be determined from the input token price * the output amount of the output token. This is roughly correct for most Across deposits, but falls over when the deposit includes an in-protocol swap to an output token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken AERO on Base.

Deposit hash:
0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pxrl pxrl merged commit c27ebd4 into master Jul 22, 2024
4 checks passed
@pxrl pxrl deleted the pxrl/profitUSD branch July 22, 2024 20:09
ishantiw pushed a commit to LiskHQ/across-relayer that referenced this pull request Aug 8, 2024
)

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
ishantiw pushed a commit to LiskHQ/across-relayer that referenced this pull request Aug 8, 2024
)

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
sameersubudhi pushed a commit to LiskHQ/across-relayer that referenced this pull request Sep 10, 2024
)

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
sameersubudhi pushed a commit to LiskHQ/across-relayer that referenced this pull request Sep 10, 2024
)

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
sameersubudhi pushed a commit to LiskHQ/across-relayer that referenced this pull request Sep 10, 2024
)

The ProfitClient currently assumes that the value of a fill can be
determined from the input token price * the output amount of the
output token. This is roughly correct for most Across deposits, but
falls over when the deposit includes an in-protocol swap to an output
token with a different number of decimals.

This was exposed on an Optimism deposit for inputToken USDC, outputToken
AERO on Base.

Deposit hash:
  0x4a3febcfb764467d9eae261b3a3938137db383289fe328050a2871eb407e1147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants