Skip to content

Conversation

@khancode
Copy link
Contributor

@khancode khancode commented Aug 8, 2022

High Level Overview of Change

Adds Automated Market Maker (AMM) support to xrpl-py.

Context of Change

Adds AMM core functionality, referencing the XLS-30 spec.

New transactions added:

  • AMMCreate
  • AMMDeposit
  • AMMWithdraw
  • AMMVote
  • AMMBid
  • AMMDelete

New RPC command:

  • amm_info

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Test Plan

Created unit tests to test the transactions and RPC command models.

@khancode khancode requested a review from mvadari August 10, 2022 20:26
@khancode khancode marked this pull request as ready for review August 15, 2022 22:22
@khancode khancode requested a review from ckniffen August 15, 2022 22:25
@khancode khancode requested a review from mvadari July 17, 2023 22:38
@khancode khancode requested a review from mvadari July 28, 2023 15:59
@khancode khancode merged commit 9855c2b into master Aug 18, 2023
@khancode khancode deleted the amm branch August 18, 2023 02:42
vlad-trmlabs pushed a commit to trmlabs/xrpl-py that referenced this pull request Mar 22, 2024
* add AMMInstanceCreate

* update definitions to get AMMInstanceCreate working

* fix lint errors

* add unit test for Instance Create

* fix lint errors

* fix definitions and change AmmCreate to AMMInstanceCreate

* fix lint error

* add AMMInfo

* update AMMInfo docstring

* add docstring to AMMInfo params

* update definitions.json

* remove AMMAccount from AMMInstanceCreate model

* add AMMDeposit

* fix lint errors

* add AMMWithdraw

* add AMMVote

* add AMMBid

* fix typo

* update AMMBid test

* add MaxSlotPrice param to AMMBid

* refactor test

* update definitions and replace AMMHash with AMMID

* update lptokens type to IssuedCurrencyAmount

* assert with error message

* assert with error messages for AMMInstanceCreate and amm_info

* move to_xrpl tests to test_base_model

* rename lptokens to lp_tokens

* update amm_info request params to be in snake_case

* update docstrings

* reorder SPECIAL_CAMELCASE_STRINGS to alphabetical order

* refactor ABBREVIATIONS to be set in one place

* rename LPTokens to LPToken

* update CHANGELOG.md

* fix typo

* fix lint error

* refactor max trading fee to be in one place

* update amm_bid error message

* add AuthAccount base model for AMMBid

* update definitions to fix AMM in LEDGER_ENTRY_TYPES

* update CHANGELOG.md to specify XLS-30

* update wording on AMMDeposit & AMMWithdraw validation errors

* add negative FeeVal check

* add negative TradingFee check

* fix lint error

* export AuthAccount model

* add AuthAccount and refactor special case models check

* revert Path and _value_to_tx_json() changes

* fix AuthAccount capitalization issues (XRPLF#432)

Co-authored-by: Omar Khan <[email protected]>

* add AMMBid codec-fixture

* add AMMInstanceCreate codec-fixture

* update definitions.json with different AuthAccounts number

* remove AMM codec-fixtures

* Change amm_info asset parameters to Currency type

* API name changes with updated definitions.json

* rename amm_info param asset1 -> asset

* change AMM_MAX_TRADING_FEE to 1% and rename fee_val to trading_fee

* rename MinBidPrice -> BidMin and MaxBidPrice -> BidMax

* update definitions to change Asset & Asset2 nth values to 3 & 4

* Use asset/asset2 instead of amm_id for Deposit/Withdraw/Bid/Vote

* update definitions

* add Issue type

* add flags to AMM deposit & withdraw

* add Issue model

* add Issue type to models with asset & asset2; remove amm_id

* resolve lint errors

* rename LPToken in amm deposit & withdraw

* update docstrings

* add AMM codec-fixtures

* add one asset withdraw & withdraw all tests

* update definitions.json with refactored error codes

* add Owner Reserve Fee for AMMCreate transaction

* refactor asset pair to be Currency type

* update amm_info asset pair to be Currency type and remove Issue model

* update definitions and codec-fixtures

* update DiscountedFee definition

* update definitions and codec-fixtures

* update definitions

* remove sidechain method

* small refactor

* update docstrings

* refactor _value_to_tx_json to remove special case for auth_account

* refactor AuthAccount to be a NestedModel

* remove test_base_model tests for amm

* add test_to_xrpl_auth_accounts

* fix indentation with tests

* update definitions

* add AMMDelete

* add AMMDelete docstring

---------

Co-authored-by: Mayukha Vadari <[email protected]>
vlad-trmlabs added a commit to trmlabs/xrpl-py that referenced this pull request Mar 22, 2024
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.

5 participants