pendulum-chain / vortex

1 stars 0 forks source link

Phase 5 - Prototype: Integrate Nabla #25

Closed vadaynujra closed 3 months ago

vadaynujra commented 4 months ago

Context

To allow users holding USD based stablecoins on Pendulum i.e. USDT/C to off-ramp, there is a need to swap the asset based on the user's choice of the currency to off-ramp. For this purpose, Nabla will be used.

Requirement

Integrate Nabla with the prototype, such that:

  1. A swap can be done from USDT or USDC to EURC or BRL (on Pendulum)
  2. User's input of source asset, destination currency and amount, returns an estimated max fee, along with a duration it is valid for

Testing

vadaynujra commented 4 months ago

@prayagd is this ticket blocked by any other ticket? Maybe the one about defining and implementing the Nabla parameters?

prayagd commented 4 months ago

Yes you are right, blocked by the parameter ticket. Updated the dependency

vadaynujra commented 4 months ago

@pendulum-chain/devs can this ticket be started on before the final parameters for Pendulum are being defined? Maybe with an integration on Foucoco?

ebma commented 4 months ago

Yes, I guess we could already start working on this but it might not be possible to accurately estimate the max fee without having the parameters finalized.

vadaynujra commented 4 months ago

True @ebma, and that's okay as long as we can estimate and display the fees based on parameters set on Foucoco.

prayagd commented 4 months ago

Hey team! Please add your planning poker estimate with Zenhub @b-yap @bogdanS98 @ebma @gianfra-t @TorstenStueber

TorstenStueber commented 4 months ago

@pendulum-chain/product This ticket has no place in Ready yet, it lacks detail and is ambiguous.

First, we should specify that this is for USDT only (not for USDC).

It should use the prototype deployment of Nabla that is described here. We can hard code the addresses of the contracts (otherwise we would need to query them from the indexer) and the decimals of each asset:

The code should create transactions for

It's easiest to use api-solang to submit these transactions, see e.g., here.

vadaynujra commented 4 months ago

Tested EUR off ramp and worked fine, need to figure out how to reduce the 3 transactions into one @prayagd

TorstenStueber commented 4 months ago

Can't be done at the moment as explained today: gas fees are overestimated and only one smart contract execution fits into one block.

gianfra-t commented 4 months ago

@vadaynujra when you tested it, was the amount auto-filled on the anchor side by any chance? If it was in the last hour or so it should have been the case.

prayagd commented 3 months ago

@gianfra-t can we close this now that the PR is merged?

ebma commented 3 months ago

I added two testing scenarios to the description. @prayagd can you follow up on them so they are completed? I think it's better to first test that this works before closing the ticket. AFAIK we did not perform the whole flow when testing the phase 5 changes that are now on staging.

TorstenStueber commented 3 months ago

I tried to test the BRL offramp on staging but when I wanted to deposit some more BRL into the pool, I realized that the indexer returns outdated results. I want to wait for this to be fixed first.

ebma commented 3 months ago

You should be able to test this now, since the indexer is up again.

vadaynujra commented 3 months ago

@gianfra-t I am not sure anymore. Shall I do another test to check this? @ebma is another EUR off ramp test from my side pending before we close this?

ebma commented 3 months ago

Yes, please test again @vadaynujra. Doesn't hurt to do it as often as we can.

prayagd commented 3 months ago

The test is completed, succesfully offramped EUR. Here

Closing this ticket.

vadaynujra commented 2 months ago

Shall we move this to production @ebma as it is successfully tested and also includes the functionality of the version currently live on production?

ebma commented 2 months ago

Sure, I'll do that.