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

Exchange tokens via mento broker #106

Merged
merged 18 commits into from
Feb 6, 2024
Merged

Exchange tokens via mento broker #106

merged 18 commits into from
Feb 6, 2024

Conversation

aaronmgdr
Copy link
Member

@aaronmgdr aaronmgdr commented Jan 30, 2024

Description

builds a swap transaction via mento sdk for exchanges.

The swap transaction is constructed via mento sdk using ethers js and then signed via the celo connection package to ensure compatibility with existing cli signing methods.

note on terms

  • minAmount / forAtLeast -- user specified min amount of token the want
  • quoted -- how much mento expects us to get based on how the act of swapping will shift prices
  • market price -- the price given by the oracles.

Other changes

made yarn dev always build first

Tested

successfully made a swap

Related issues

requires mento-protocol/mento-sdk#49

Backwards compatibility

yes

Documentation

same same

Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: 2546acd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@celo/celocli Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

socket-security bot commented Jan 30, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@mento-protocol/[email protected] None 0 2.35 MB bayological
npm/@mento-protocol/[email protected] Transitive: environment, filesystem, network +49 21.4 MB bayological

View full report↗︎

@aaronmgdr aaronmgdr changed the title WIP -- exchange via mento broker Exchange tokens via mento broker Feb 5, 2024
@aaronmgdr aaronmgdr marked this pull request as ready for review February 5, 2024 08:59
@aaronmgdr aaronmgdr requested a review from a team as a code owner February 5, 2024 08:59
@aaronmgdr
Copy link
Member Author

think showing exchange rates doesn't work because this call results in an empty array?

➜  cli git:(aaronmgdr/mento-broker) ✗ yarn dev exchange:show --node https://alfajores-forno.celo-testnet.org/

Running in development mode
Fetching exchange rates...... done

…se getAmountOut when getting quote for stable to celo swaps

use for estimated since for at least is a command flag and confusing
@aaronmgdr
Copy link
Member Author

think showing exchange rates doesn't work because this call results in an empty array?

➜  cli git:(aaronmgdr/mento-broker) ✗ yarn dev exchange:show --node https://alfajores-forno.celo-testnet.org/

Running in development mode
Fetching exchange rates...... done

fixed

@aaronmgdr aaronmgdr merged commit 0a3a570 into master Feb 6, 2024
17 checks passed
@aaronmgdr aaronmgdr deleted the aaronmgdr/mento-broker branch February 6, 2024 11:30
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.

cUSD exchange doesn't work
2 participants