[bisq-network/bisq] [WIP] Add api trade simulation scripts (#5093)

Stan notifications at github.com
Tue Jan 19 17:57:15 CET 2021


Two regtest trading simulation scripts are contained in this change:

- `trade-simulation.sh` goes through the steps of creating country based F2F payment accounts for Bob & Alice, plus each step of a trade from `createoffer` to completion.
  
- `limit-order-simulation.sh` shows a way to trigger creation of an offer when a limit price is reached.
  
Each script prints CLI commands and output as they are run, providing a basic tutorial for some of the api's features.

Examples:

- `trade-simulation.sh`          

  Simulate the entire trade protocol between Bob (taker) & Alice (maker),
  where Alice buys 0.1 BTC from Bob, paying in Renminbi (CYN).

  Note the script takes a country code (CN) not a currency code, so the
  script can create the appropriate country based face to face payment accounts.

  `$ apitest/scripts/trade-simulation.sh -d buy -c cn -m 0.0 -a 0.1`

- `limit-order.sh`          

  Create a CAD/BUY 0.1 BTC order at mkt price margin of 0.0% if price falls to
  or below 47900 CAD.

  Note the script takes a country code (CA) not a currency code, so the script
 can create the appropriate country based face to face  payment accounts.

  `$ apitest/scripts/limit-order-simulation.sh -l 47900 -d buy -c CA -m 0.0 -a 0.1`

  Create a USD/SELL 0.1 BTC order at mkt price margin of 0.0% if price rises to
  or above 37200 USD.

  `$ apitest/scripts/limit-order-simulation.sh -l 37200 -d sell -c US -m 0.0 -a 0.1
`

Both scripts depend on functions contained in supporting `bash` and `python3` scripts.

https://github.com/bisq-network/bisq/pull/5084 should be merged before this one.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5093

-- Commit Summary --

  * Add line break
  * Make opt description generic
  * Add method help docs
  * Add method help docs
  * Fix help text typos
  * Add --memo opt to help text
  * Add method help docs
  * Fix typo
  * Add method help doc
  * Explain example
  * Add method help doc
  * Add method help docs
  * Explain example
  * Keep CLI method enum members in alphabetical order
  * Merge branch 'master' into 01-add-method-help-docs
  * Add api trade simulation scripts

-- File Changes --

    A apitest/scripts/editf2faccountform.py (28)
    A apitest/scripts/getmktprice.py (22)
    A apitest/scripts/limit-order-simulation.sh (115)
    A apitest/scripts/trade-simulation-env.sh (205)
    A apitest/scripts/trade-simulation-utils.sh (174)
    A apitest/scripts/trade-simulation.sh (189)
    M cli/src/main/java/bisq/cli/CliMain.java (5)
    M cli/src/main/java/bisq/cli/Method.java (44)
    M cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java (2)
    M core/src/main/java/bisq/core/api/CoreApi.java (3)
    A core/src/main/resources/help/canceloffer-help.txt (25)
    A core/src/main/resources/help/confirmpaymentreceived-help.txt (27)
    A core/src/main/resources/help/confirmpaymentstarted-help.txt (26)
    A core/src/main/resources/help/createpaymentacct-help.txt (46)
    A core/src/main/resources/help/getaddressbalance-help.txt (23)
    A core/src/main/resources/help/getbalance-help.txt (30)
    A core/src/main/resources/help/getmyoffer-help.txt (25)
    A core/src/main/resources/help/getmyoffers-help.txt (33)
    A core/src/main/resources/help/getoffer-help.txt (26)
    A core/src/main/resources/help/getoffers-help.txt (39)
    A core/src/main/resources/help/getpaymentacctform-help.txt (44)
    A core/src/main/resources/help/gettrade-help.txt (32)
    A core/src/main/resources/help/gettransaction-help.txt (27)
    A core/src/main/resources/help/keepfunds-help.txt (31)
    M core/src/main/resources/help/lockwallet-help.txt (1)
    A core/src/main/resources/help/removewalletpassword-help.txt (19)
    A core/src/main/resources/help/sendbsq-help.txt (38)
    A core/src/main/resources/help/sendbtc-help.txt (51)
    A core/src/main/resources/help/settxfeerate-help.txt (19)
    A core/src/main/resources/help/setwalletpassword-help.txt (25)
    A core/src/main/resources/help/unlockwallet-help.txt (21)
    M core/src/main/resources/help/unsettxfeerate-help.txt (1)
    A core/src/main/resources/help/withdrawfunds-help.txt (50)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5093.patch
https://github.com/bisq-network/bisq/pull/5093.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5093
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210119/2df13e1a/attachment-0001.htm>


More information about the bisq-github mailing list