Add maker_fee_split. Show maker/taker fee split in app

This commit is contained in:
Reckless_Satoshi 2022-03-03 04:47:55 -08:00
parent c9cdc2743d
commit c4cf995dbf
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
4 changed files with 15 additions and 9 deletions

View File

@ -49,10 +49,15 @@ NETWORK = 'testnet'
NODE_ALIAS = '🤖RoboSats⚡(RoboDevs)'
NODE_ID = '033b58d7......'
# Trade fee in percentage %
# Total trade fee as fraction
FEE = 0.002
# Bond size in percentage %
# Maker/taker fee split. As seen in https://bisq.wiki/Trading_fees . It is implicit that TAKER_FEE_SPLIT = (1 - MAKER_FEE_SPLIT)
# Shall incentivize order making
MAKER_FEE_SPLIT=0.125
# Default bond size as fraction
BOND_SIZE = 0.01
# Time out penalty for canceling takers in SECONDS
PENALTY_TIMEOUT = 60
# Time between routing attempts of buyer invoice in MINUTES

View File

@ -28,7 +28,6 @@ from django.conf import settings
from decouple import config
EXP_MAKER_BOND_INVOICE = int(config("EXP_MAKER_BOND_INVOICE"))
FEE = float(config("FEE"))
RETRY_TIME = int(config("RETRY_TIME"))
avatar_path = Path(settings.AVATAR_ROOT)
@ -335,7 +334,7 @@ class OrderView(viewsets.ViewSet):
if order.payout.status == LNPayment.Status.EXPIRE:
data["invoice_expired"] = True
# Add invoice amount once again if invoice was expired.
data["invoice_amount"] = int(order.last_satoshis * (1 - FEE))
data["invoice_amount"] = int(order.last_satoshis * (1 - float(config('FEE'))))
return Response(data, status.HTTP_200_OK)
@ -676,7 +675,8 @@ class InfoView(ListAPIView):
context["node_alias"] = config("NODE_ALIAS")
context["node_id"] = config("NODE_ID")
context["network"] = config("NETWORK")
context["fee"] = FEE
context["maker_fee"] = float(config("FEE"))*float(config("MAKER_FEE_SPLIT"))
context["taker_fee"] = float(config("FEE"))*(1 - float(config("MAKER_FEE_SPLIT")))
context["bond_size"] = float(config("BOND_SIZE"))
if request.user.is_authenticated:
context["nickname"] = request.user.username

View File

@ -39,7 +39,8 @@ export default class BottomBar extends Component {
num_public_buy_orders: 0,
num_public_sell_orders: 0,
active_robots_today: 0,
fee: 0,
maker_fee: 0,
taker_fee: 0,
today_avg_nonkyc_btc_premium: 0,
today_volume: 0,
lifetime_volume: 0,
@ -378,7 +379,7 @@ bottomBarDesktop =()=>{
<ListItemText
primaryTypographyProps={{fontSize: '14px'}}
secondaryTypographyProps={{fontSize: '12px'}}
primary={this.state.fee*100+"% (buyer)"}
primary={(this.state.maker_fee + this.state.taker_fee)*100}
secondary="Trade Fee" />
</ListItem>
</Grid>
@ -495,7 +496,7 @@ bottomBarDesktop =()=>{
primaryTypographyProps={{fontSize: '14px'}}
secondaryTypographyProps={{fontSize: '12px'}}
secondary="Trading fees">
{this.state.fee*100}% <small>(buyer)</small> | 0.0% <small>(seller)</small>
{(this.state.maker_fee*100).toFixed(3)}% <small>(maker)</small> | {(this.state.taker_fee*100).toFixed(3)}% <small>(taker)</small>
</ListItemText>
</ListItem>
</List>

File diff suppressed because one or more lines are too long