Skip to content

Create a tenderly oracle to support the exchange in calculating slippage values. #69

Description

@realsungeunchoi

Is your feature request related to a problem? Please describe.
Today we have big trouble calculating slippage values chain.

This means that we are forced to set min amount out to 0, which is OK for small value exchanges, but for larger transfers is dangerous.

This forces us to use private TXs on mainnet but this is not feasible when we expand to other chains and also want to decentralise liquidity direction later.

This is related to https://app.dework.xyz/alluo/alluo-smart-contra?taskId=18e215f5-71f0-4207-90c0-518ef0fd5e50

because that ticket cannot be completed without the slippage values being calculated correctly.

Describe the solution you'd like
The following features should be added:

  1. Given an input of an array of {tokenFrom, tokenTo, roughEstimateToSwapFrom} objects, allow contracts to trigger an event that runs tenderly web3 actions

  2. Then calculate the rough estimate of tokenToAmountOut. Then post this data on chain into a contract with:

{tokenFrom, tokenTo, roughEstimateToSwapFrom, tokenToAmountOut}

We should be able to deploy this to multiple chains quickly.

Example:

{tokenFrom:USDC, tokenTo: 3CRV, roughEstimateToSwapFrom: 100,000 usdc}

should result in:

{tokenFrom:USDC, tokenTo:3CRV, roughEstimateToSwapFrom: 100,000 usdc, tokenToAmountOut: 95,000}

The reason why we need to post the roughEstimateToSwapFrom is because the actual number might vary so we should be able to scale this estimate up / down roughly.

Describe alternatives you've considered

Additional context
Have a look at web3 gateway for a solution to simulating swaps.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions