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

Prompt for the Fee Asset Data #30

Open
dekz opened this issue Jan 2, 2020 · 7 comments
Open

Prompt for the Fee Asset Data #30

dekz opened this issue Jan 2, 2020 · 7 comments
Labels
bug 🪲 Something isn't working

Comments

@dekz
Copy link
Member

dekz commented Jan 2, 2020

V2 assumed ZRX was the fee asset data and no prompt was made. In V3 Fee Asset data can be any token and isn't being set in the wizard.

MAKER_FEE_ASSET_DATA and TAKER_FEE_ASSET_DATA should be set in the backend container.

Prompt for the ERC20 contract address and encode as ERC20 asset data for the golden path.

@SvenMeyer
Copy link

@dekz maybe you can already give an example how a proper value set would look like in docker-compose.yml ?

@dekz
Copy link
Member Author

dekz commented Jan 6, 2020

backend:
        image: 0xorg/launch-kit-backend:v3
        environment:
            HTTP_PORT: '3000'
            CHAIN_ID: '1'
            WHITELIST_ALL_TOKENS: 'true'
            FEE_RECIPIENT: '0x0000000000000000000000000000000000000001'
            MAKER_FEE_UNIT_AMOUNT: '1'
            TAKER_FEE_UNIT_AMOUNT: '1'
            MAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
            TAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
            MESH_ENDPOINT: 'ws://mesh:60557'
        ports:
            - '3000:3000'

Should set the correct values when the order is created. Here both Maker and Taker fees are in WETH 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.

@SvenMeyer
Copy link

... and ..._FEE_UNIT_AMOUNT is whatever smallest unit that currency has, so in case of (W)ETH it would be 10^-18 ETH = 1 wei or is it percent of trade volume?

@dekz
Copy link
Member Author

dekz commented Jan 6, 2020

You are correct, for WETH it is wei.

Percentage based fees is not currently supported.

@SvenMeyer
Copy link

  1. Thanks , that's good to know
  2. Most exchanges work with a percentage based fee, as it is more fair (I would say). Would be great if that could be supported as well ...

@vlddm
Copy link

vlddm commented Jan 29, 2020

Got a error while creating order:

Unknown fee token: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

My setup is:

        MAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
        TAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
        MAKER_FEE_UNIT_AMOUNT: '100000000000000'
        TAKER_FEE_UNIT_AMOUNT: '100000000000000'

@dekz dekz pinned this issue Feb 9, 2020
@AdamSC1-ddg
Copy link

AdamSC1-ddg commented Apr 14, 2020

backend:
        image: 0xorg/launch-kit-backend:v3
        environment:
            HTTP_PORT: '3000'
            CHAIN_ID: '1'
            WHITELIST_ALL_TOKENS: 'true'
            FEE_RECIPIENT: '0x0000000000000000000000000000000000000001'
            MAKER_FEE_UNIT_AMOUNT: '1'
            TAKER_FEE_UNIT_AMOUNT: '1'
            MAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
            TAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
            MESH_ENDPOINT: 'ws://mesh:60557'
        ports:
            - '3000:3000'

Should set the correct values when the order is created. Here both Maker and Taker fees are in WETH 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.

@dekz Can either of these fees be set to a relative address, for example can we take the maker side fee in wETH and then the taker side fee in the counter-party token? Such as by echoing out the relevant address on each call?

Since it is an open order relayer and has a forwarding contract I imagine we could set one of the fees to a specific token if we were only trading one pair ETH/[X], but its unclear how it would work if multiple pair types are available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants