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

Feat: OSwap integration #617

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Feat: OSwap integration #617

wants to merge 2 commits into from

Conversation

franckc
Copy link

@franckc franckc commented Jan 13, 2024

This PR adds support for a new DEX: OSwap.

OSwap
OSwap is a Mainnet DEX built by the team at Origin Protocol.
In its V1, OSwap is hyper focused on a few LST pairs. Some characteristics of the V1 include:

  • Super gas optimized contract (~12K gas for a swap, excluding tokens transfer cost)
  • Very low fees, typically under 1bps (lower than Curve and Uniswap).
  • Currently $1.25M in liquidity

The first pair to launch (more to come) is WETH/stETH. It went live last year on Mainnet and within less than 2 weeks has achieved over $10M in trading volume.

Deployment address
The WETH/stETH pool is deployed on Mainnet at address 0x85B78AcA6Deae198fBF201c82DAF6Ca21942acc6

Contract code and documentation
The contracts code and documentation can be found in this open source repository: https://github.com/OriginProtocol/origin-swap

Interface
There is no router, each pair has a pool that should be called directly for doing swaps.
The pool's interface is Uniswap V2 Router compatible: it exposes the methods swapExactTokensForTokens and swapTokensForExactTokens.

Integration

  • Adapters: we made the decision to re-use the Smardex adapters given that they implement the Uniswap V2 Router swap interface. We felt this would be less work for the Paraswap team vs having to write and deploy yet another adapter contract for OSwap.
  • Each pair is serviced by a separate pool, with its associated token pair and deployment addresses defined in the config file.
  • Note that at the moment OSwap does not support native ETH, only WETH. We may add support for it in the future.

Tests
Tests can be run via yarn test-integration oswap

* Integration code

* Implement event tests

* Add integration tests

* Fixes

* Add gas costs, update calcPrice

* Fix e2e tests

* Clean up

* Tweaks
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.

None yet

1 participant