Note: If you like, you may read my proposal here (better formatting).
Astroport <> Redpoint Proposal
Background
This proposal is an updated version of the first Redpoint proposal posted here. Additional topics covered include a discussion about on-chain and off-chain solutions, a cap on Redpoint profits, and gas fee payments.
Proposal
Redpoint introduced the technique of atomically packaging user and arbitrage swaps into a single TX to the Cosmos community around August 2022.
Our proposal uses this technique in distinct stages, starting with an off-chain simulation and ending with an on-chain solution.
- The first stage is an off chain simulator that simulates arbitrage and submits a single TX to the chain containing the user’s swap plus arbitrage swap.
- The final stage is fully on chain, with Redpoint paying user gas fees for arbitrage swaps.
Reliability
Redpoint’s v1 simulator and Skip’s auction are less reliable than Redpoint’s on-chain solution. In Redpoint v1, and Skip’s auction, some arbitrage swaps will fail or be less profitable than simulated.
An off-chain simulator cannot always know the order of the TXs in the block it is simulating (geolocation, validator block reordering, etc.)
- This becomes more prevalent the more active the market gets.
- More TXs in the mempool means less guarantee of TX ordering (network effect).
- TXs can fail on-chain that pass simulation (example: slippage tolerance is violated).
Therefore, off-chain simulations (including auctions) will be unreliable compared to on-chain.
Off-chain Simulator (Stage 1)
Redpoint’s off-chain simulator submits swaps to a smart contract that guarantees there are never TX failures, even if the arbitrage swap fails. Astroport earns a fixed percentage of arbitrage revenue.
Redpoint simulations take less than 1 millisecond (plus HTTP request time). There is very little “lag time” (where unknown TXs are submitted to the chain. See Reliability section).
On-chain arbitrage capture by Redpoint
Redpoint’s on-chain arbitrage smart contract knows pool price and liquidity at the time of the trade. It will never be inaccurate as a result of incorrect data or have the reliability issues above.
- Redpoint will start by offering 3 and 4-pool cyclic arbitrage on Astroport, which will capture the majority of arbitrage, and is the most common technique used by on-chain trading bots.
- Redpoint’s solution will gradually integrate with other on-chain DEXes that offer sufficient liquidity for arbitrage purposes (e.g. on Terra, top Terraswap pools).
Redpoint will continuously evaluate cross-chain strategies as they become viable (e.g. interchain queries, interchain scheduler, swap and forward) and collaborate with Astroport on the preferred way forward.
Scenario: Off-chain vs. on-chain solutions
Redpoint’s off-chain solution can be visualized as follows.
Comparatively, Skip’s auction solution takes longer to run, and thus more TXs may squeeze between Searcher estimates:
In fairness to the Skip team, TXs can also squeeze between Redpoint’s offchain solution. The comparison being drawn is the time-to-run and the consequential impact on accuracy.
Contrast this with Redpoint’s on-chain solution.
- Note that it’s possible for the TXs from TFM and Unknown (image above) to attempt their own arbitrage capture.
- What’s important is the on-chain solution will capture a greater percentage of total arbitrage, because it knows all pool prices at the time it runs, including any impacts of TXs that add/remove liquidity, swap, etc.
- By contrast, it’s indeterminate whether the off-chain solutions above will know about the sandwiched TXs, or be able to predict where they will end up in the block.
Redpoint Fees
Note that the fee schedule has been updated after feedback from the community, and to provide incentive to complete an on-chain solution which will maximize revenue for the Astroport community.
- Redpoint will charge 5% of arbitrage revenue capped at $200,000/year per Astroport deployment while off-chain simulator is active.
- Redpoint will charge 5% (year one and two) for on-chain solution, allowing community discussion after year two.
- Redpoint will pay user’s gas fees for the arbitrage swaps in all stages of our proposal.
Proposal Highlights
- Earnings cap for v1 (simulator) which provides incentive for long term decentralization (no dependence on Redpoint or another company’s off-chain infrastructure).
- Clear fee distribution with no guesswork about searcher incentives.
- On-chain solution has significantly greater upside for Astroport (see Scenario), and removes dependence on off-chain infrastructure.
- Fully on chain solution more accurate and covers more clients than just Astroport frontend.
We believe Redpoint’s approach matches the forward-thinking and innovative spirit of Astroport!
Thanks everyone for reading and feedback!